/* O Windows não desenha bandeiras: esta fonte cobre só elas (ver licencas.txt). */
@font-face { font-family: "Bandeiras"; font-display: swap; src: url(/fonts/twemoji-country-flags.woff2) format("woff2");
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F; }
/* Identidade StormKnight: preto profundo, gelo, dourado e azul tempestade (ver chat.stormknight.com.br). */
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/fonts/inter-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/fonts/inter-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter Tight"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/fonts/inter-tight-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter Tight"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/fonts/inter-tight-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #020203;
  --panel: #0b0c0f;
  --chat: #07080a;
  --raised: #121419;
  --hover: #16181e;
  --line: rgba(236, 236, 238, 0.08);
  --line-strong: rgba(236, 236, 238, 0.16);
  --ink: #ececee;
  --muted: #8a8f98;
  --subtle: #5d626b;
  --gold: #b89a4e;
  --gold-soft: rgba(184, 154, 78, 0.14);
  --storm: #9fb3ff;
  --storm-soft: rgba(159, 179, 255, 0.1);
  --ok: #5cc98f;
  --danger: #e5606f;
  --radius: 10px;
  --display: "Bandeiras", "Inter Tight", "Inter", system-ui, sans-serif;
  font-family: "Bandeiras", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-size: 15px; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--gold-soft); color: var(--ink); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--danger); min-height: 1.2em; margin: 0; font-size: 13px; }
* { scrollbar-width: thin; scrollbar-color: var(--raised) transparent; }

/* Login */
/* Rola quando a janela é baixa; margin:auto no cartão centraliza quando cabe. */
.login { height: 100%; display: flex; overflow-y: auto; padding: 16px;
  background: radial-gradient(80% 50% at 50% -10%, rgba(159, 179, 255, 0.1), transparent 70%), var(--bg); }
.login-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 10px; margin: auto; }
.brand { text-align: center; margin-bottom: 22px; }
.wordmark { display: inline-flex; flex-direction: column; align-items: flex-start; font-family: var(--display); line-height: 1; }
.wordmark .storm { font-weight: 600; font-size: 13px; letter-spacing: .55em; color: var(--muted); text-transform: uppercase; margin-left: 4px; }
/* Cor sólida: o gradiente recortado no texto desenhava uma caixa escura em máquinas sem aceleração de vídeo. */
.wordmark .knight { font-weight: 700; font-size: 76px; letter-spacing: -0.045em; margin: 4px 0 2px; color: #f1f1f3; }
.wordmark .wm-chat { align-self: flex-end; display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13px; letter-spacing: .55em; color: var(--gold); text-transform: uppercase; }
.wordmark .wm-chat::before { content: ""; width: 36px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.brand p { margin: 18px 0 0; font-size: 13px; }
.login-card form, .login-fields { display: flex; flex-direction: column; gap: 10px; }
label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
input, textarea, select { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; outline: none; transition: border-color .15s; }
input:focus, textarea:focus, select:focus { border-color: rgba(184, 154, 78, .55); }
input:disabled { opacity: .5; }
.primary { background: var(--ink); color: #0a0a0c; border: 0; border-radius: var(--radius); padding: 10px 16px; font-weight: 600; transition: background .15s; }
.primary:hover { background: #fff; }
.secondary { background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; }
.secondary:hover { border-color: var(--line-strong); }
.danger { background: transparent; border: 1px solid rgba(229, 96, 111, .5); color: var(--danger); border-radius: var(--radius); padding: 8px 12px; }
.danger:hover { background: rgba(229, 96, 111, .1); }
.icon-btn { background: transparent; border: 0; color: var(--muted); padding: 4px 8px; border-radius: 6px; font-size: 15px; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }

/* Layout */
/* Barra no topo e três colunas embaixo: chat | salas | amigos. */
.app { display: grid; grid-template-columns: minmax(0, 1fr) 0px 252px; grid-template-rows: 60px minmax(0, 1fr);
  grid-template-areas: "top top top" "chat side salas"; height: 100%; transition: grid-template-columns .24s cubic-bezier(.2, .8, .2, 1); }
/* Membros: terceira coluna só quando a pessoa abre (fica salvo neste computador) */
.app.members-open { grid-template-columns: minmax(0, 1fr) 240px 252px; grid-template-areas: "top top top" "chat side salas"; }
/* Fechada, a coluna fica com largura 0 (sem sumir do grid): assim abrir e fechar desliza. */
.members-col { overflow: hidden; }
.members-col > * { min-width: 240px; }
.app:not(.members-open) .members-col, .app.no-server .members-col { border-left-color: transparent; }
.app:not(.members-open) .members-col > *, .app.no-server .members-col > * { opacity: 0; }
.members-col > * { transition: opacity .18s; }

.rail { background: var(--bg); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 0; overflow-y: auto; border-right: 1px solid var(--line); }
.rail-servers { display: flex; flex-direction: column; gap: 8px; }
.rail-btn { width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: .02em; display: grid; place-items: center; position: relative; transition: background .15s, border-color .15s; }
.rail-btn:hover { border-color: var(--line-strong); background: var(--raised); }
.rail-btn.active { background: var(--ink); color: #0a0a0c; border-color: var(--ink); }
.rail-btn.active::before { content: ""; position: absolute; left: -13px; width: 3px; height: 26px; border-radius: 0 3px 3px 0; background: var(--gold); }
.rail-btn.add, .rail-btn.join { color: var(--gold); font-size: 20px; font-weight: 400; background: transparent; border-style: dashed; }
.rail-btn.add:hover, .rail-btn.join:hover { background: var(--gold-soft); border-color: var(--gold); }

.sidebar { background: var(--panel); display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--line); }
.server-header { height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px 0 16px;
  border-bottom: 1px solid var(--line); font-family: var(--display); font-weight: 600; letter-spacing: -.01em; position: relative; }
.server-header span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu { position: absolute; top: 50px; right: 8px; left: 8px; background: var(--raised); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 6px; z-index: 10; box-shadow: 0 16px 40px rgba(0, 0, 0, .6); font-family: "Inter", sans-serif; }
.menu button { display: block; width: 100%; text-align: left; background: transparent; border: 0; padding: 8px 10px; border-radius: 6px; font-weight: 500; font-size: 14px; }
.menu button:hover { background: var(--hover); }
.menu button.danger-item { color: var(--danger); }
.menu button.danger-item:hover { background: rgba(229, 96, 111, .1); }

.channel-list { flex: 1; overflow-y: auto; padding: 8px; }
.category { margin: 16px 0 6px 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--subtle); }
.channel { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: transparent; border: 0;
  padding: 7px 10px; border-radius: 8px; color: var(--muted); font-size: 14.5px; }
.channel:hover { background: var(--hover); color: var(--ink); }
.channel.active { background: var(--raised); color: var(--ink); box-shadow: inset 2px 0 0 var(--gold); }
.channel .glyph { width: 16px; text-align: center; color: var(--subtle); }
.channel.active .glyph { color: var(--gold); }
.channel .lock { margin-left: auto; font-size: 11px; opacity: .6; }

.voice-panel { margin: 8px; padding: 12px; background: var(--chat); border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; }
.voice-panel .grants { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
.chip { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--raised); border: 1px solid var(--line); }
.chip.on { color: var(--ok); border-color: rgba(92, 201, 143, .3); }
.chip.off { color: var(--subtle); text-decoration: line-through; }

.me { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--bg); }
.me-name { flex: 1; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 12px; color: var(--ink); flex: none; position: relative; }
.conn { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.conn.on { background: var(--ok); }
.conn.off { background: var(--danger); }

.chat { display: flex; flex-direction: column; min-width: 0; background: var(--chat); }
.chat-header { height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid var(--line); }
.channel-title { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; }
.messages { flex: 1; overflow-y: auto; padding: 16px 0; display: flex; flex-direction: column; }
.messages .empty { margin: auto; text-align: center; padding: 20px; }
.msg { display: grid; grid-template-columns: 38px 1fr auto; gap: 0 12px; padding: 5px 20px; position: relative; }
.msg:hover { background: rgba(236, 236, 238, .025); }
.msg.grouped { padding-top: 1px; padding-bottom: 1px; }
.msg.grouped .avatar { visibility: hidden; height: 0; }
.msg .avatar { width: 38px; height: 38px; border-radius: 12px; font-size: 13px; }
.msg.pending .body { opacity: .5; }
.msg .meta { display: flex; gap: 8px; align-items: baseline; }
.msg .author { font-weight: 600; font-size: 14.5px; }
.msg .time { font-size: 11px; color: var(--subtle); }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; color: #dcdde0; }
.msg .edited { font-size: 11px; color: var(--subtle); margin-left: 4px; }
.msg .actions { visibility: hidden; display: flex; gap: 2px; align-self: start; background: var(--raised); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.msg:hover .actions { visibility: visible; }
.msg .actions:empty { display: none; }
.msg .actions button { font-size: 13px; padding: 2px 6px; }
.history-note { text-align: center; font-size: 12px; color: var(--subtle); padding: 10px; letter-spacing: .04em; }

.composer { padding: 0 20px 20px; }
.composer textarea { width: 100%; resize: none; background: var(--panel); border: 1px solid var(--line); padding: 12px 14px; border-radius: 12px; max-height: 200px; line-height: 1.45; }

.members { background: var(--panel); border-left: 1px solid var(--line); overflow-y: auto; padding: 12px 8px; }
.members h3 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--subtle); margin: 14px 8px 6px; }
.member { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; font-size: 14px; }
.member:hover { background: var(--hover); }
.member.offline { opacity: .4; }
.avatar.has-img:has(> .dot, > .pdot) { overflow: visible; } /* a foto já é redonda; sem isso a bolinha de status era cortada */
.member .dot { position: absolute; z-index: 1; right: -3px; bottom: -3px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--panel); background: var(--subtle); }
.member .dot.on { background: var(--ok); }
.member .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .role-tag { font-size: 11px; color: var(--gold); }

/* Modal */
.modal { border: 1px solid var(--line-strong); border-radius: 16px; padding: 0; background: var(--panel); color: var(--ink);
  width: min(660px, calc(100vw - 32px)); max-height: calc(100vh - 64px); box-shadow: 0 30px 80px rgba(0, 0, 0, .7); }
.modal::backdrop { background: rgba(2, 2, 3, .75); backdrop-filter: blur(3px); }
.modal-inner { display: flex; flex-direction: column; max-height: calc(100vh - 64px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-family: var(--display); font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.modal-body { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > input { flex: 1; min-width: 160px; }
.code { font-family: Consolas, "Cascadia Mono", monospace; font-size: 22px; background: var(--chat); border: 1px solid var(--line); color: var(--gold);
  padding: 12px 16px; border-radius: var(--radius); user-select: all; letter-spacing: .08em; text-align: center; }
.split { display: grid; grid-template-columns: 180px 1fr; gap: 16px; min-height: 320px; }
.list { display: flex; flex-direction: column; gap: 2px; }
.list button { text-align: left; background: transparent; border: 0; padding: 8px 10px; border-radius: 8px; font-size: 14px; }
.list button:hover { background: var(--hover); }
.list button.active { background: var(--raised); box-shadow: inset 2px 0 0 var(--gold); }
.perm-grid { display: flex; flex-direction: column; gap: 2px; }
.perm { text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 13.5px; font-weight: 500; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 8px; border-radius: 8px; }
.perm:hover { background: var(--hover); }
.perm .desc { font-size: 12px; font-weight: 400; color: var(--muted); }
.perm input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--gold); }
.tri { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: none; }
.tri button { border: 0; background: transparent; width: 30px; height: 26px; color: var(--subtle); }
.tri button.sel[data-v=deny] { background: rgba(229, 96, 111, .85); color: #fff; }
.tri button.sel[data-v=inherit] { background: var(--raised); color: var(--ink); }
.tri button.sel[data-v=allow] { background: var(--ok); color: #0a0a0c; }
.audit { font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.audit div { padding: 8px 10px; background: var(--chat); border: 1px solid var(--line); border-radius: 8px; }
.assign { display: flex; flex-direction: column; gap: 4px; max-height: 160px; overflow-y: auto; }
.assign label { text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 14px; font-weight: 400; display: flex; gap: 8px; align-items: center; }
.field { display: flex; flex-direction: column; gap: 10px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--raised); border: 1px solid var(--line-strong);
  padding: 10px 16px; border-radius: var(--radius); box-shadow: 0 12px 30px rgba(0, 0, 0, .6); z-index: 100; max-width: calc(100vw - 32px); font-size: 14px; }
.toast.err { border-color: rgba(229, 96, 111, .6); }

@media (max-width: 1100px) {
  .app { grid-template-columns: minmax(0, 1fr) 0px 224px; }
  .app.members-open { grid-template-columns: minmax(0, 1fr) 216px 224px; }
}
/* Janela estreita: a lista de membros passa a abrir por cima do chat, em vez de roubar uma coluna dele,
   e a coluna das salas encolhe. Assim o chat nunca fica espremido. */
@media (max-width: 900px) {
  .app, .app.members-open { grid-template-columns: minmax(0, 1fr) 0px 200px; }
  /* Com o grid posicionado, a área (de largura 0) vira a referência: right: 0 cola na coluna das salas. */
  .app { position: relative; }
  .app.members-open .members-col { position: absolute; top: 0; right: 0; bottom: 0; width: 240px; z-index: 20;
    box-shadow: -12px 0 30px rgba(0, 0, 0, .45); }
}
@media (max-width: 640px) {
  .app, .app.members-open { grid-template-columns: minmax(0, 1fr) 0px 172px; }
}
@media (max-width: 600px) {
  .split { grid-template-columns: 1fr; }
  .wordmark .knight { font-size: 60px; }
}

/* Voz: ocupantes na lista de canais */
.channel.connected .glyph { color: var(--ok); }
.voice-user { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 32px; font-size: 13px; color: var(--muted); }
.voice-user .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-user.speaking .avatar { box-shadow: 0 0 0 2px var(--ok); }
.avatar.small { width: 22px; height: 22px; border-radius: 7px; font-size: 9px; }
.vs-icon { margin-left: auto; font-size: 11px; opacity: .7; }

/* Painel de voz conectada */
.voice-panel { display: flex; flex-direction: column; gap: 10px; }
.vp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.vp-info { min-width: 0; }
.vp-status { color: var(--ok); font-weight: 600; font-size: 12.5px; }
.vp-where { background: none; border: 0; padding: 0; color: var(--muted); font-size: 12px; text-align: left; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-where:hover { color: var(--ink); text-decoration: underline; }
.hangup:hover { background: rgba(229, 96, 111, .15); color: var(--danger); }
.vp-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.vbtn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 4px; border-radius: 8px; border: 1px solid var(--line); background: var(--raised); font-size: 11px; color: var(--muted); }
.vbtn:hover { border-color: var(--line-strong); color: var(--ink); }
.vbtn .vicon { font-size: 15px; }
.vbtn.off { color: var(--danger); border-color: rgba(229, 96, 111, .35); }
.vbtn.live { background: var(--gold); color: #0a0a0c; border-color: var(--gold); font-weight: 600; }
.quality { padding: 6px 8px; font-size: 12px; }

/* Palco: transmissões de tela */
.stage { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 16px; overflow: auto; }
.screen { position: relative; background: #000; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; }
.screen.big { flex: 1; min-height: 240px; cursor: default; }
.screen video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.screen:fullscreen { border: 0; border-radius: 0; }
.screen-label { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 8px; align-items: center; background: rgba(2, 2, 3, .7); padding: 4px 10px; border-radius: 8px; font-size: 13px; }
.screen .fs { position: absolute; right: 10px; bottom: 10px; background: rgba(2, 2, 3, .7); color: var(--ink); }
.thumbs { display: flex; gap: 10px; height: 110px; flex: none; }
.thumbs .screen { width: 196px; flex: none; }
.thumbs .screen:hover { border-color: #e5484d; }
.stage-empty { flex: 1; display: grid; place-content: center; text-align: center; gap: 6px; min-height: 200px; border: 1px dashed var(--line-strong); border-radius: 12px; }
.stage-empty-title { font-family: var(--display); font-size: 20px; font-weight: 600; }
.people { display: flex; flex-wrap: wrap; gap: 10px; flex: none; }
.person { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 132px; padding: 12px 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; transition: border-color .15s; }
.person.speaking { border-color: var(--ok); }
.person.speaking .avatar { box-shadow: 0 0 0 2px var(--ok); }
.avatar.big { width: 52px; height: 52px; border-radius: 16px; font-size: 16px; }
.person-name { font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vol { width: 100%; padding: 0; accent-color: var(--gold); background: none; border: 0; }

/* ---------- Cara de aplicativo, não de site ---------- */
html, body { overflow: hidden; overscroll-behavior: none; }
body { display: flex; flex-direction: column; user-select: none; -webkit-user-select: none; cursor: default; }
.login, .app { flex: 1; min-height: 0; height: auto; }
input, textarea, .msg .body, .code, .vp-where { user-select: text; -webkit-user-select: text; }
.msg .body { cursor: text; }
img, a, svg, video { -webkit-user-drag: none; }
.messages, .channel-list, .members, .stage, .modal-body { overscroll-behavior: contain; }
button:focus { outline: none; }
button:focus-visible, select:focus-visible, input[type=range]:focus-visible { outline: 2px solid rgba(184, 154, 78, .7); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--raised); border: 3px solid transparent; background-clip: padding-box; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--hover); background-clip: padding-box; border: 3px solid transparent; }
::-webkit-scrollbar-corner { background: transparent; }

/* Barra de título própria (só no app desktop) */
.titlebar { height: 32px; flex: none; display: flex; align-items: center; justify-content: space-between; background: var(--bg); border-bottom: 1px solid var(--line); }
.tb-brand { display: flex; align-items: baseline; gap: 8px; padding-left: 14px; height: 100%; align-items: center; flex: 1; }
.tb-storm { font-family: var(--display); font-weight: 600; font-size: 11px; letter-spacing: .32em; color: var(--muted); }
.tb-chat { font-family: var(--display); font-weight: 600; font-size: 10px; letter-spacing: .32em; color: var(--gold); }
.tb-buttons { display: flex; height: 100%; }
.tb-btn { width: 46px; height: 100%; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; }
.tb-btn:hover { background: var(--hover); color: var(--ink); }
.tb-btn.close:hover { background: #c42b1c; color: #fff; }
.tb-btn .ic-restore { display: none; }
.titlebar.maximized .ic-max { display: none; }
.titlebar.maximized .ic-restore { display: block; }

/* Janela de transmissão */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.choice { text-align: left; background: var(--chat); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; transition: border-color .15s, background .15s; }
.choice:hover { border-color: var(--line-strong); }
.choice.sel { border-color: var(--gold); background: var(--gold-soft); }
.choice-title { font-weight: 600; font-size: 14px; }
.choice-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
label.toggle { display: flex; align-items: center; gap: 10px; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 400; color: var(--ink); margin-top: 4px; }
label.toggle input { width: 18px; height: 18px; accent-color: var(--gold); }
.row.end { justify-content: flex-end; margin-top: 6px; }

/* Logo do cavaleiro */
.tb-logo { width: 18px; height: 18px; border-radius: 5px; margin-right: 2px; }
.login-logo { display: block; width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 18px; box-shadow: 0 0 0 1px var(--line), 0 18px 50px rgba(159, 179, 255, .08); }

/* Iframe do isolamento do Tauri: o Tauri o esconde com estilo inline, que a nossa CSP bloqueia.
   Escondido aqui ele continua funcionando (é só o canal seguro de IPC). */
iframe[src*="isolation-"] { display: none !important; }

/* Seletor de tela nativo */
.modal.wide { width: min(980px, calc(100vw - 32px)); }
.picker-tabs { display: flex; gap: 6px; align-items: center; }
.ptab { background: transparent; border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px; font-size: 13px; color: var(--muted); }
.ptab:hover { color: var(--ink); border-color: var(--line-strong); }
.ptab.sel { background: var(--ink); color: #0a0a0c; border-color: var(--ink); font-weight: 600; }
.picker-tabs .refresh { margin-left: auto; font-size: 18px; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; min-height: 260px; align-content: start; }
.picker-loading { grid-column: 1 / -1; text-align: center; padding: 60px 0; }
.pick { text-align: left; background: var(--chat); border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, transform .15s; }
.pick:hover { border-color: var(--gold); transform: translateY(-1px); }
.pick-thumb { aspect-ratio: 16 / 9; background: #000; border-radius: 8px; overflow: hidden; display: grid; place-items: center; }
.pick-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pick-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-sub { font-size: 11.5px; color: var(--muted); margin-top: -4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.small { font-size: 12.5px; }

/* Link do instalador na tela de login (só no navegador) */
.download-app { display: block; text-align: center; font-size: 13px; color: var(--gold); text-decoration: none; padding-top: 4px; }
.download-app span { color: var(--subtle); }
.download-app:hover { text-decoration: underline; }

/* Aviso de atualização na barra de título */
.tb-update { margin-left: auto; margin-right: 8px; align-self: center; background: rgba(184, 154, 78, .14); color: var(--gold);
  border: 1px solid rgba(184, 154, 78, .45); border-radius: 99px; padding: 3px 12px; font-size: 12px; font-weight: 600; }
.tb-update:hover:not(:disabled) { background: rgba(184, 154, 78, .24); }
.tb-update:disabled { opacity: .7; cursor: default; }

/* Login: entrar / criar conta */
.auth-step { display: flex; flex-direction: column; gap: inherit; }
.auth-step.hidden { display: none; }
.auth-step .link-btn { align-self: center; }
.auth-title { font-size: 16px; font-weight: 600; margin: 0; }
.auth-note { margin: 0; padding: 9px 11px; border-radius: 8px; border: 1px solid rgba(184, 154, 78, .5); color: var(--gold); font-size: 13px; }
.btn-create { font-size: 16px; padding: 14px; font-weight: 700; }
.age-alert { display: flex; flex-direction: column; gap: 4px; padding: 11px 12px; border-radius: 8px; border: 1px solid #e5484d; background: rgba(229, 72, 77, .12); color: #ff8a8d; font-size: 13px; line-height: 1.4; }
.age-alert b { color: #ff6b6f; font-size: 14px; }
:root[data-theme="light"] .age-alert, :root[data-theme="light"] .age-alert b { color: #b3261e; }
.check-row { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; font-weight: 400; line-height: 1.4; letter-spacing: normal; text-transform: none; color: var(--ink); cursor: pointer; }
.check-row input { flex: none; width: 16px; height: 16px; margin: 1px 0 0; }
.check-row a { color: var(--gold); }
.warn-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.alpha-btn { display: inline-flex; align-items: center; gap: 7px; flex: none; padding: 7px 13px; border-radius: 99px; border: 1px solid var(--gold); background: rgba(184, 154, 78, .14); color: var(--gold); font-size: 13px; font-weight: 700; white-space: nowrap; }
.alpha-btn:hover { background: rgba(184, 154, 78, .26); }
.alpha-btn.hidden { display: none; }
.owner-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.admin-list { display: flex; flex-direction: column; gap: 10px; }
.admin-list p { margin: 0; }
.admin-card { display: flex; flex-direction: column; gap: 6px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--ink); text-align: left; }
.admin-card.faded { opacity: .6; }
.admin-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
button.admin-row:hover { border-color: var(--line-strong); }
.admin-card .row, .admin-list .row { flex-wrap: wrap; }
.report-text { padding: 8px 10px; border-radius: 8px; background: rgba(255, 255, 255, .05); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.appeal-box { display: flex; flex-direction: column; gap: 6px; }
.quota-bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-bottom: 6px; }
.quota-fill { height: 100%; width: 0; background: var(--gold); }
.auth-or { display: flex; align-items: center; gap: 10px; color: var(--subtle); font-size: 12px; margin: 2px 0; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.google-btn { background: transparent; border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px; color: var(--ink); font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 10px; }
.google-btn:hover { border-color: var(--ink); }
#login-info:empty, #login-error:empty { display: none; }
/* Abertura: aviso quando o servidor não responde */
.sp-status { margin-top: 18px; font-size: 13px; color: var(--muted); text-align: center; }

/* Botões do rodapé do usuário: ícones de traço, compactos, para o nome caber */
.me-btn { display: grid; place-items: center; padding: 6px; }
.me { gap: 6px; }

/* Janelas baixas: logo e nome menores para o formulário caber sem rolar */
@media (max-height: 820px) {
  .login-logo { width: 52px; height: 52px; border-radius: 14px; margin-bottom: 10px; }
  .wordmark .knight { font-size: 54px; }
  .brand { margin-bottom: 12px; }
  .brand p { margin-top: 10px; }
}

/* Categorias recolhíveis */
.category { display: flex; align-items: center; gap: 2px; padding-right: 6px; }
.cat-toggle { flex: 1; display: flex; align-items: center; gap: 4px; background: none; border: 0; padding: 0; color: inherit;
  font: inherit; letter-spacing: inherit; text-transform: inherit; text-align: left; cursor: pointer; min-width: 0; }
.cat-toggle:hover { color: var(--ink); }
.cat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Seta desenhada em CSS (o caractere ficava parecendo um traço em tamanho pequeno) */
.chev { flex: none; width: 5px; height: 5px; margin: 0 4px 2px 1px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .15s; }
.category.collapsed .chev { transform: rotate(-45deg); margin-bottom: 0; }
.cat-add { background: none; border: 0; color: var(--muted); font-size: 16px; line-height: 1; padding: 0 4px; border-radius: 4px; opacity: 0; transition: opacity .15s; }
.category:hover .cat-add, .cat-add:focus-visible { opacity: 1; }
.cat-add:hover { color: var(--ink); background: var(--hover); }
.optional { text-transform: none; letter-spacing: 0; color: var(--subtle); font-weight: 400; }

/* Menu de botão direito */
.ctx-menu { position: fixed; z-index: 1000; min-width: 200px; padding: 6px; background: #111216; border: 1px solid var(--line-strong);
  border-radius: 10px; box-shadow: 0 16px 40px rgba(0, 0, 0, .55); display: flex; flex-direction: column; gap: 1px; }
.ctx-item { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%;
  background: none; border: 0; color: var(--ink); font-size: 13px; text-align: left; padding: 7px 10px; border-radius: 6px; cursor: default; }
.ctx-item:hover, .ctx-item:focus-visible { background: rgba(159, 179, 255, .12); outline: none; }
.ctx-item.danger { color: #ff8a8a; }
.ctx-item.danger:hover { background: rgba(255, 90, 90, .14); }
.ctx-sep { height: 1px; background: var(--line); margin: 4px 6px; }
.ctx-arrow, .ctx-check { color: var(--muted); }
.ctx-check { color: var(--gold); }
.has-sub > .ctx-menu { display: none; position: absolute; left: calc(100% + 4px); top: -6px; }
.ctx-menu.flip .has-sub > .ctx-menu { left: auto; right: calc(100% + 4px); }
.has-sub:hover > .ctx-menu, .has-sub:focus-within > .ctx-menu { display: flex; }

/* Rodinha de atualização no rodapé */
.me-update { color: var(--gold); border-radius: 50%; padding: 3px; }
.me-update:hover { color: var(--gold); background: rgba(184, 154, 78, .14); }
.me-update .ring-bg { stroke: rgba(184, 154, 78, .28); }
.me-update .ring { stroke: var(--gold); transform: rotate(-90deg); transform-origin: 12px 12px; transition: stroke-dashoffset .25s; }
.me-update:not(.updating):not(.waiting) { animation: skc-pulse-o 2.4s ease-in-out infinite; }
/* pulso só com opacidade: a placa não precisa redesenhar a sombra a cada quadro */
@keyframes skc-pulse-o { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.me-update.updating { cursor: progress; }
.me-update.updating .arrows, .me-update.waiting .arrows { animation: skc-spin 1s linear infinite; transform-origin: 12px 12px; }
@keyframes skc-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(184, 154, 78, .35); } 50% { box-shadow: 0 0 0 5px rgba(184, 154, 78, 0); } }
@keyframes skc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .me-update, .me-update .arrows { animation: none !important; } }
.update-version { font-family: var(--display); font-size: 18px; font-weight: 700; margin: 0; }
.update-notes { margin: 0; line-height: 1.5; }

/* ===== Layout novo ===== */
.chat { grid-area: chat; position: relative; }
.salas { grid-area: salas; position: relative; border-right: 0; border-left: 1px solid var(--line); }
.side { grid-area: side; background: var(--bg); border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; padding: 12px; overflow-y: auto; min-width: 0; }

/* Cabeçalho das salas */
.sh-text { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.sh-label { font-family: "Inter", sans-serif; font-size: 10.5px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }

/* Salas como cartões */
.salas .channel { background: var(--chat); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; margin-bottom: 6px; }
.salas .channel:hover { border-color: var(--line-strong); }
.salas .channel.active { border-color: rgba(184, 154, 78, .7); box-shadow: none; background: var(--raised); }
.salas .voice-user { margin: -2px 0 6px 18px; }

/* ===== Amigos ===== */
.friends-view { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 16px 20px; gap: 14px; place-items: initial; }
.fv-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.fv-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.ptab.attention:not(.sel) { color: var(--gold); border-color: rgba(184, 154, 78, .6); }
.fv-add { display: flex; gap: 8px; flex: 1; max-width: 420px; min-width: 260px; }
.fv-add input { flex: 1; }
.fv-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.fv-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.fv-row:hover { border-color: var(--line-strong); }
.fv-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fv-name { font-weight: 600; }
.fv-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fv-sub.in-voice { color: #3ee08a; }
.fv-actions { display: flex; gap: 6px; align-items: center; }
.fv-actions button { padding: 6px 12px; font-size: 13px; }
.fv-actions .icon-btn { padding: 4px 8px; }
.fv-empty { text-align: center; padding: 40px 0; }
.pdot { position: absolute; z-index: 1; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; background: #5d626b; border: 2px solid var(--panel); }
.pdot.on { background: #3ee08a; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--gold); color: #0a0a0c; font-size: 11px; font-weight: 700;
  display: inline-grid; place-items: center; }
.side-friends { display: flex; flex-direction: column; gap: 2px; }
.sf { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; padding: 6px; border-radius: 10px; color: var(--ink); text-align: left; }
.sf:hover, .sf.active { background: var(--hover); }
.sf .avatar { width: 28px; height: 28px; border-radius: 9px; font-size: 10px; }
.sf-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.sf-voice { color: #3ee08a; font-size: 12px; }

/* Ajustes */
.set-section { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.set-section:first-child { border-top: 0; padding-top: 0; }
.set-section h3 { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.set-line { margin: 0; }
.danger-text { color: var(--danger); }

/* ===== Layout v3: barra do topo ===== */
.topbar { grid-area: top; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 12px 0 14px;
  background: var(--panel); border-bottom: 1px solid var(--line); min-width: 0; }
.tb-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-sep { width: 1px; height: 28px; background: var(--line-strong); flex: none; }
.servers { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; }
.servers .muted { font-size: 12.5px; white-space: nowrap; }

/* Escudo de cavaleiro: SVG com borda arredondada; a cor vem das variáveis */
.shield { --sh-fill: transparent; --sh-line: var(--line-strong); --sh-ink: var(--muted);
  position: relative; flex: none; width: 38px; height: 42px; padding: 0; border: 0; background: none; display: grid; place-items: center;
  color: var(--sh-ink); transition: transform .12s; }
.shield .sh-shape { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.shield .sh-shape path { fill: var(--sh-fill); stroke: var(--sh-line); stroke-width: 1.6; transition: fill .15s, stroke .15s; }
.shield .sh-label, .shield .sh-icon { position: relative; margin-top: -4px; font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: .01em; }
.shield:hover { --sh-line: var(--muted); --sh-ink: var(--ink); }
.shield:active { transform: translateY(1px); }
.shield:focus-visible { outline: none; --sh-line: var(--ink); }
.shield.active { --sh-line: var(--gold); --sh-ink: var(--gold); }
.shield.temp { opacity: .75; }
.shield.temp .sh-shape path { stroke-dasharray: 3 3; }
/* Casinha dourada do Início */
.home-btn { position: relative; flex: none; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 11px;
  background: none; color: var(--gold); transition: background .15s; }
.home-btn:hover, .home-btn.open, .home-btn:focus-visible { background: var(--gold-soft); outline: none; }
.home-dot { position: absolute; top: 5px; right: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); border: 2px solid var(--panel); }
.shield .badge { position: absolute; top: -3px; right: -6px; height: 16px; min-width: 16px; font-size: 10px; padding: 0 4px; border: 2px solid var(--panel); box-sizing: content-box; }

/* Lista "Seus servidores" que o escudo do Início abre */
.srv-pop { position: fixed; z-index: 40; width: 290px; max-height: min(460px, calc(100vh - 90px)); overflow-y: auto; padding: 8px;
  background: var(--raised); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 18px 44px rgba(0, 0, 0, .6); }
.srv-pop-title { font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--subtle); padding: 4px 8px 8px; }
.srv-pop-row { display: flex; align-items: center; gap: 4px; border-radius: 9px; padding: 2px 4px 2px 2px; }
.srv-pop-row:hover, .srv-pop-row.active { background: var(--hover); }
.srv-pop-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 5px 6px; background: none; border: 0; text-align: left; color: var(--ink); font-size: 14px; }
.srv-pop-open .shield { width: 26px; height: 29px; pointer-events: none; }
.srv-pop-open .shield .sh-label { font-size: 9.5px; margin-top: -3px; }
.srv-pop-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv-pop-row .badge { flex: none; }
.srv-pop-btn { flex: none; width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--subtle); }
.srv-pop-btn:hover { background: var(--panel); color: var(--ink); }
.srv-pop-btn.on { color: var(--gold); }
.srv-pop-btn.muted-on { color: var(--danger); }
.srv-pop-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.srv-pop-action { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-size: 14px; text-align: left; }
.srv-pop-action:hover { background: var(--hover); color: var(--ink); }
.srv-pop-action.gold { color: var(--gold); }
.srv-pop-empty { padding: 6px 10px 10px; margin: 0; font-size: 13px; }

/* Perfil no canto direito do topo: nome, status clicável, avatar com o anel neon */
.profile { --neon: var(--gold); display: flex; align-items: center; gap: 10px; flex: none; }
.profile[data-status="online"] { --neon: #3ee08a; }
.profile[data-status="playing"] { --neon: #5aa9ff; }
.profile[data-status="idle"] { --neon: #f0b232; }
.profile[data-status="dnd"] { --neon: #ef5a6b; }
.profile[data-status="invisible"] { --neon: #8a8f98; }
.profile[data-status="off"] { --neon: #e5606f; }
.profile[data-status="connecting"] { --neon: var(--gold); }
.profile-text { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; gap: 1px; }
.profile .me-name { flex: none; font-family: var(--display); font-weight: 700; font-size: 14.5px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.me-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--neon); margin-right: -6px; padding: 2px 6px; border: 0; border-radius: 6px;
  background: none; max-width: 240px; transition: background .15s; }
.me-status:hover, .me-status:focus-visible { background: var(--raised); }
.me-status #me-status-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-status .conn { flex: none; background: var(--neon); box-shadow: 0 0 8px var(--neon); }
.me-status .chev { flex: none; opacity: .7; color: var(--muted); }
.pf-ring { flex: none; padding: 2px; border-radius: 50%; border: 2px solid var(--neon);
  box-shadow: 0 0 10px color-mix(in srgb, var(--neon) 45%, transparent); transition: border-color .3s, box-shadow .3s; }
.profile .pf-ring .avatar { width: 34px; height: 34px; border-radius: 50%; font-size: 12px; }
/* Online e jogando pulsam devagar: o pulso quer dizer "estou ativo" */
.profile[data-status="online"] .pf-ring, .profile[data-status="playing"] .pf-ring { animation: skc-neon 2.6s ease-in-out infinite; }
@keyframes skc-neon {
  0%, 100% { box-shadow: 0 0 5px color-mix(in srgb, var(--neon) 40%, transparent), inset 0 0 3px color-mix(in srgb, var(--neon) 20%, transparent); }
  50% { box-shadow: 0 0 16px color-mix(in srgb, var(--neon) 75%, transparent), inset 0 0 7px color-mix(in srgb, var(--neon) 35%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .profile .pf-ring { animation: none !important; } }
.pf-gear { flex: none; display: grid; place-items: center; padding: 7px; border-radius: 10px; color: var(--muted); }
.pf-gear:hover, .pf-gear:focus-visible { color: var(--ink); background: var(--raised); }

/* Cabeçalhos das três colunas: mesma altura, alinhados como uma faixa só */
.col-head { height: 48px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); }
.server-header { height: 48px; font-size: 15px; }
.server-header #server-name { flex: 1; min-width: 0; }
.menu { top: 44px; }

/* Salas */
.chat { grid-area: chat; position: relative; }
.salas { grid-area: salas; position: relative; border-right: 0; border-left: 1px solid var(--line); }
.channel.unread { color: var(--ink); font-weight: 600; }
.channel .ch-badge { margin-left: auto; }

/* Coluna da direita (membros) */
.side { grid-area: side; background: var(--bg); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.col-title { font-family: var(--display); font-weight: 600; font-size: 14px; white-space: nowrap; }
.col-title .count { color: var(--gold); margin-left: 4px; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 0; color: var(--gold); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.link-btn:hover { text-decoration: underline; }
.link-btn.active { text-decoration: underline; }
.members-col .members { flex: 1; overflow-y: auto; padding: 4px 8px 12px; background: none; border: 0; }
.member .who { min-width: 0; display: flex; flex-direction: column; }
.member .game { font-size: 11.5px; color: #5aa9ff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.members h3 .role-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--gold); }
#btn-toggle-members[aria-pressed="true"] { color: var(--gold); }
.pdot.idle, .member .dot.idle { background: #f0b232; }
.pdot.dnd, .member .dot.dnd { background: #ef5a6b; }
.pdot.playing, .member .dot.playing { background: #5aa9ff; }
.fv-sub.playing { color: #5aa9ff; }

/* Painel do Início: amigos, servidores e criar/entrar */
.srv-pop-action .badge { margin-left: auto; }
.srv-pop-empty { line-height: 1.45; }
/* Sem servidor aberto (ou em amigos/conversa) a coluna dos membros não aparece, mesmo se estiver "aberta" */
.app.members-open.no-server { grid-template-columns: minmax(0, 1fr) 0px 252px; }


/* ===== 0.8: menus, respostas, reações, ajustes ===== */
.ctx-label { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; }
.ctx-hint { font-size: 11.5px; color: var(--subtle); font-weight: 400; }
.ctx-grid { display: grid; grid-template-columns: repeat(6, 34px); gap: 2px; padding: 4px; }
.ctx-emoji { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: none; font-size: 19px; }
.ctx-emoji:hover { background: rgba(159, 179, 255, .12); }
.ctx-emoji.on { background: var(--gold-soft); box-shadow: inset 0 0 0 1px rgba(184, 154, 78, .6); }
.offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }

.msg .body { font-size: var(--chat-font, 15px); }
.msg.mention { background: rgba(184, 154, 78, .07); box-shadow: inset 2px 0 0 var(--gold); }
.msg.flash { animation: skc-flash 1.6s ease-out; }
@keyframes skc-flash { 0%, 30% { background: rgba(159, 179, 255, .16); } 100% { background: transparent; } }
.mention-tag { color: var(--storm); background: var(--storm-soft); border-radius: 4px; padding: 0 2px; }
.mention-tag.to-me { color: var(--gold); background: var(--gold-soft); }
.reply-quote { display: flex; align-items: center; gap: 6px; max-width: 100%; margin: 0 0 2px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 12.5px; text-align: left; }
.reply-quote:hover { color: var(--ink); }
.rq-arrow { color: var(--subtle); }
.rq-author { font-weight: 600; flex: none; }
.rq-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rq-text.gone { font-style: italic; color: var(--subtle); }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.reaction { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); background: var(--raised); font-size: 13px; }
.reaction:hover { border-color: var(--line-strong); }
.reaction.mine { border-color: rgba(184, 154, 78, .7); background: var(--gold-soft); }
.reaction .rc { font-size: 12px; color: var(--muted); font-weight: 600; }
.reaction.mine .rc { color: var(--gold); }
.reply-bar { display: flex; align-items: center; gap: 6px; margin: 0 20px; padding: 6px 8px 6px 12px; border: 1px solid var(--line); border-bottom: 0;
  border-radius: 12px 12px 0 0; background: var(--raised); font-size: 13px; }
.reply-bar .rb-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); margin-left: 6px; }
.reply-bar:not(.hidden) + .composer textarea { border-top-left-radius: 0; border-top-right-radius: 0; }
.badge.mention { background: var(--danger); color: #fff; }
.member { cursor: pointer; }
.voice-user { cursor: default; }

/* Modo compacto */
.app.compact .msg { grid-template-columns: 1fr auto; padding-top: 2px; padding-bottom: 2px; }
.app.compact .msg > .avatar { display: none; }
.app.compact .msg.grouped { padding-top: 0; padding-bottom: 0; }

/* Acessibilidade */
:root.reduce-motion *, :root.reduce-motion *::before, :root.reduce-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
:root.high-contrast { --muted: #b8bcc5; --subtle: #959aa4; --line: rgba(236, 236, 238, .18); --line-strong: rgba(236, 236, 238, .3); }

/* Ajustes com menu lateral */
.settings-modal .modal-body { padding: 0; }
.settings { display: grid; grid-template-columns: 190px minmax(0, 1fr); min-height: min(560px, calc(100vh - 140px)); }
.set-nav { display: flex; flex-direction: column; gap: 2px; padding: 14px 10px; border-right: 1px solid var(--line); background: var(--bg); }
.set-nav-item { text-align: left; padding: 8px 12px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 14px; font-weight: 500; }
.set-nav-item:hover { background: var(--hover); color: var(--ink); }
.set-nav-item.sel { background: var(--raised); color: var(--ink); box-shadow: inset 2px 0 0 var(--gold); }
.set-pane { padding: 18px 24px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.set-title { margin: 0 0 8px; font-family: var(--display); font-size: 19px; font-weight: 700; }
.set-pane select, .set-pane input[type="range"] { width: 100%; }
.set-pane .row input[type="range"] { flex: 1; accent-color: var(--gold); }
.mic-test { align-items: center; gap: 12px; margin-top: 6px; }
.mic-meter { flex: 1; height: 8px; border-radius: 4px; background: var(--raised); border: 1px solid var(--line); overflow: hidden; }
.mic-level { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #3ee08a, #f0b232 75%, #ef5a6b); transition: width .06s linear; }
.sound-row { justify-content: space-between; align-items: center; }
.small-btn { padding: 4px 10px; font-size: 12.5px; }
@media (max-width: 640px) { .settings { grid-template-columns: 1fr; } .set-nav { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); } }

/* ===== Perfil: fotos, cartão e edição ===== */
.avatar.has-img { overflow: hidden; background: var(--raised) !important; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.msg .avatar, .msg .author, .member, .voice-user, .pf-ring { cursor: pointer; }
.msg .author:hover { text-decoration: underline; }

.pc-pop { position: fixed; z-index: 60; width: 300px; max-height: calc(100vh - 16px); overflow-y: auto; border-radius: 16px; border: 1px solid var(--line-strong);
  background: var(--panel); box-shadow: 0 22px 60px rgba(0, 0, 0, .65); }
.pc { position: relative; }
.pc-banner { height: 72px; border-radius: 15px 15px 0 0; }
.pc-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding: 0 14px; margin-top: -38px; }
.pc-ring { --neon: #5d626b; padding: 3px; border-radius: 50%; background: var(--panel); box-shadow: 0 0 0 3px var(--neon); flex: none; }
.pc-ring[data-status="online"] { --neon: #3ee08a; }
.pc-ring[data-status="playing"] { --neon: #5aa9ff; }
.pc-ring[data-status="idle"] { --neon: #f0b232; }
.pc-ring[data-status="dnd"] { --neon: #ef5a6b; }
.pc-avatar.avatar { width: 76px; height: 76px; border-radius: 50%; font-size: 24px; }
.pc-actions { display: flex; gap: 6px; align-items: center; padding-bottom: 4px; }
.pc-actions button { padding: 6px 12px; font-size: 13px; }
.pc-actions .icon-btn { padding: 4px 8px; }
.pc-body { padding: 10px 16px 16px; display: flex; flex-direction: column; gap: 2px; }
.pc-name { font-family: var(--display); font-weight: 700; font-size: 19px; overflow-wrap: anywhere; }
.pc-user { color: var(--muted); font-size: 13px; }
.pc-status { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.pc-dot { width: 8px; height: 8px; border-radius: 50%; background: #5d626b; }
.pc-status[data-status="online"] .pc-dot { background: #3ee08a; }
.pc-status[data-status="playing"] { color: #5aa9ff; }
.pc-status[data-status="playing"] .pc-dot { background: #5aa9ff; }
.pc-status[data-status="idle"] .pc-dot { background: #f0b232; }
.pc-status[data-status="dnd"] .pc-dot { background: #ef5a6b; }
.pc-section { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.pc-section h4 { margin: 0 0 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--subtle); }
.pc-bio { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.45; }
.pc-roles { display: flex; flex-wrap: wrap; gap: 4px; }
.pc-role { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--raised); border: 1px solid var(--line); color: var(--ink); }
.pc-role.link:hover { border-color: var(--gold); color: var(--gold); }
.pc-dates { display: flex; gap: 18px; font-size: 13px; }

.profile-edit { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.pe-preview { position: sticky; top: 0; }
.pe-preview h4 { margin: 0 0 6px; letter-spacing: .14em; }
.pc-preview { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); overflow: hidden; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; padding: 0; }
.swatch.sel { border-color: var(--ink); box-shadow: 0 0 0 2px var(--panel) inset; }
.set-pane input[type="color"] { width: 34px; height: 30px; padding: 0; border-radius: 8px; background: none; }
.set-pane textarea { width: 100%; resize: vertical; }
.crop { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.crop-frame { width: 240px; height: 240px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 2px var(--gold); background: var(--raised); }
.crop-canvas { display: block; cursor: grab; touch-action: none; }
.crop-canvas:active { cursor: grabbing; }
.crop input[type="range"] { width: 240px; accent-color: var(--gold); }
@media (max-width: 760px) { .profile-edit { grid-template-columns: 1fr; } }
.set-pane .row input[type="color"] { width: 34px; flex: 0 0 34px; padding: 0; border: 1px solid var(--line); }
.messages { overflow-x: hidden; }

/* ===== 0.8.1: servidor na direita, foto e banner ===== */
.server-header { height: auto; flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 0; gap: 0; border-bottom: 1px solid var(--line); }
.server-banner { height: 0; background: center / cover no-repeat var(--raised); }
.server-header.has-banner .server-banner { height: 92px; box-shadow: inset 0 -30px 30px -10px rgba(11, 12, 15, .85); }
.sh-row { display: flex; align-items: center; gap: 8px; min-height: 58px; padding: 6px 6px 6px 12px; }
.server-icon:empty { display: none; }
.server-icon .shield { width: 34px; height: 37px; cursor: default; }
.server-icon .shield .sh-label { font-size: 11px; }
.server-header.has-banner .server-icon { margin-top: -26px; }
.server-header.has-banner .server-icon .shield { width: 46px; height: 50px; }
.server-header.has-banner .server-icon .sh-shape path { stroke-width: 2; }
.server-name { flex: 1; min-width: 0; padding: 4px 6px; border: 0; border-radius: 8px; background: none; color: var(--ink); text-align: left;
  font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-name:hover { background: var(--hover); }
.sh-shape.has-img path { fill: transparent; }
.shield.active .sh-shape.has-img path { stroke: var(--gold); }

/* Salas: lista simples (sem cartões) */
.salas .channel { background: transparent; border: 0; border-radius: 6px; padding: 6px 8px; margin-bottom: 1px; box-shadow: none; }
.salas .channel:hover { background: var(--hover); color: var(--ink); border: 0; }
.salas .channel.active { background: var(--raised); color: var(--ink); box-shadow: inset 2px 0 0 var(--gold); border: 0; }
.salas .channel.active .glyph { color: var(--gold); }
.salas .voice-user { margin: 0 0 2px 26px; padding: 3px 6px; border-radius: 6px; }
.salas .voice-user:hover { background: var(--hover); }
.channel-list { padding: 8px 8px 12px; }

/* Janela de foto e banner do servidor */
.crop-frame.round { border-radius: 50%; }
.crop-frame { border-radius: 12px; }
.si-preview { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--panel); }
.si-banner { height: 92px; background: center / cover no-repeat var(--raised); }
.si-row { display: flex; align-items: center; gap: 10px; padding: 0 14px 12px; margin-top: -24px; }
.si-icon.shield { width: 46px; height: 50px; }
.si-row b { font-family: var(--display); font-size: 16px; margin-top: 22px; }
.server-name { white-space: normal; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
/* O próprio nome abre o menu: a setinha separada sai e o nome ganha espaço */
#btn-server-menu { display: none !important; }
.server-name { overflow-wrap: break-word; font-size: 15.5px; }

/* Descrição da sala no cabeçalho do chat */
.chat-header { justify-content: flex-start; gap: 10px; }
.chat-header #btn-toggle-members, .chat-header > :last-child:not(.channel-topic) { margin-left: auto; }
.channel-title { flex: none; }
.channel-topic { flex: 1; min-width: 0; padding: 4px 10px; border: 0; border-left: 1px solid var(--line-strong); border-radius: 0; background: none;
  color: var(--muted); font-size: 13px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-topic.editable { cursor: pointer; }
.channel-topic.editable:hover { color: var(--ink); }
.channel-topic.empty { color: var(--subtle); font-style: italic; }
.channel-topic:disabled { cursor: default; }
.channel-topic:focus, .channel-topic:focus-visible { outline: none; box-shadow: none; color: var(--ink); }

/* ===== Salas: tempo, status, ícone, novidade, sua sala ===== */
.salas .channel { position: relative; }
.channel .glyph { display: inline-grid; place-items: center; width: 18px; flex: none; }
.channel .glyph.emoji { font-size: 14px; }
.channel .ch-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel.unread::before { content: ""; position: absolute; left: -8px; top: 50%; width: 4px; height: 8px; margin-top: -4px; border-radius: 0 4px 4px 0; background: var(--ink); }
.channel .lock { display: inline-grid; color: var(--subtle); margin-left: auto; }
.channel.occupied .glyph { color: var(--ok); }
.vc-timer { margin-left: auto; font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--ok); }
.voice-room { border-radius: 10px; margin-bottom: 2px; }
/* A sala em que você está: o bloco inteiro ganha um brilho dourado que respira devagar. */
.voice-room.mine { position: relative; padding-bottom: 4px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--srv, #c9a24a) 14%, transparent), color-mix(in srgb, var(--srv, #c9a24a) 3%, transparent) 70%), var(--raised);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--srv, #c9a24a) 16%, transparent); }
/* O neon em L respira devagar */
@keyframes skc-room-glow { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
.voice-room.mine .channel .ch-name { color: var(--ink); font-weight: 600; }
.reduce-motion .voice-room.mine, .reduce-motion .voice-room.mine::before { animation: none; }
@media (prefers-reduced-motion: reduce) { .voice-room.mine, .voice-room.mine::before { animation: none; } }
/* Ícones de mic e fone antes da foto */
.vs-icons { display: inline-flex; gap: 2px; min-width: 0; }
.vs-icons:empty { display: none; }
/* Ao vivo: o nome brilha em vermelho, com uma luz passando, e um pontinho pulsando no fim */
.voice-user.is-live { cursor: pointer; }
.voice-user.is-live .name { font-weight: 600; color: #ff6b6b;
  background: linear-gradient(100deg, #ff4d5e 0%, #ff4d5e 40%, #ffd1d6 50%, #ff4d5e 60%, #ff4d5e 100%) 0 0 / 250% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: skc-live-shine 2.6s linear infinite; }
@keyframes skc-live-shine { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.voice-user.is-live:hover { background: rgba(255, 77, 94, .1); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: #ff4d5e; box-shadow: 0 0 0 0 rgba(255, 77, 94, .6); animation: skc-live-dot 1.6s ease-out infinite; }
@keyframes skc-live-dot { 0% { box-shadow: 0 0 0 0 rgba(255, 77, 94, .6); } 100% { box-shadow: 0 0 0 7px rgba(255, 77, 94, 0); } }
.reduce-motion .voice-user.is-live .name, .reduce-motion .live-dot { animation: none; }
@media (prefers-reduced-motion: reduce) { .voice-user.is-live .name, .live-dot { animation: none; } }
.voice-room.mine .channel { background: transparent; box-shadow: none; }
.room-status { display: flex; align-items: center; gap: 6px; width: calc(100% - 26px); margin: -2px 0 4px 26px; padding: 0; border: 0; background: none; color: var(--muted);
  font-size: 12px; text-align: left; cursor: default; }
.room-status span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-room.mine .room-status { cursor: pointer; }
.voice-room.mine .room-status:hover { color: var(--ink); }
.room-status.empty { color: var(--subtle); font-style: italic; }
.voice-user { display: flex; align-items: center; gap: 8px; }
.voice-user .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.vs-icon { display: inline-grid; place-items: center; color: var(--muted); }
.vs-icon.off { color: var(--danger); }

/* Palco sem transmissão: quadros grandes com as fotos */
.call-grid { flex: 1; min-height: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-content: center; }
.call-grid.n1 { grid-template-columns: minmax(0, 560px); justify-content: center; }
.call-grid.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.call-tile { position: relative; aspect-ratio: 16 / 10; border-radius: 14px; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; cursor: pointer;
  transition: border-color .15s, box-shadow .15s; }
.call-tile.speaking { border-color: var(--ok); box-shadow: 0 0 0 2px rgba(92, 201, 143, .55); }
.call-avatar.avatar { width: clamp(64px, 28%, 120px); height: auto; aspect-ratio: 1; border-radius: 50%; font-size: clamp(20px, 3vw, 36px); box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.call-tile.speaking .call-avatar { box-shadow: 0 0 0 3px var(--ok), 0 8px 24px rgba(0, 0, 0, .45); }
.call-name { position: absolute; left: 10px; bottom: 10px; display: flex; align-items: center; gap: 6px; max-width: calc(100% - 20px); padding: 3px 9px; border-radius: 8px;
  background: rgba(2, 2, 3, .62); font-size: 13px; font-weight: 600; }
.call-name span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-tile .vol { position: absolute; right: 10px; bottom: 12px; width: 90px; opacity: 0; transition: opacity .15s; accent-color: var(--gold); }
.call-tile:hover .vol { opacity: 1; }
.stage-hint { text-align: center; flex: none; }

/* Janela de convites */
.invite-opts { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; }
.invite-opts label { margin: 0; }
.invite-result:empty { display: none; }
.invite-result { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--chat); }
.copy-row { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.copy-row .code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-list { display: flex; flex-direction: column; gap: 4px; }
.invite-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 8px; }
.invite-row:hover { background: var(--hover); }
.vanity-row { align-items: center; gap: 6px; flex-wrap: wrap; }
.vanity-row input { flex: 1; min-width: 140px; }

/* Página pública do convite */
.invite-page { display: flex; min-height: 100%; padding: 16px; background: radial-gradient(80% 50% at 50% -10%, rgba(159, 179, 255, .1), transparent 70%), var(--bg); }
.invite-card { width: min(440px, 100%); margin: auto; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--panel); overflow: hidden; }
.inv-banner { height: 72px; background: linear-gradient(120deg, #1d2540, #4a3d1c 60%, #0b0c0f); background-size: cover; background-position: center; }
.inv-banner.has-img { height: 120px; }
.inv-body { padding: 0 24px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.inv-logo { width: 72px; height: 72px; margin-top: -36px; border-radius: 18px; background: var(--panel); border: 2px solid var(--gold); object-fit: cover; padding: 6px; }
.inv-kicker { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.inv-name { margin: 0; font-family: var(--display); font-size: 26px; letter-spacing: -.02em; }
.inv-steps { width: 100%; text-align: left; margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.inv-steps ol { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.inv-code-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.inv-download { display: block; text-align: center; text-decoration: none; }
.copy-row .code, .invite-row .code, .inv-code-row .code { font-size: 13px; padding: 6px 10px; letter-spacing: .02em; text-align: left; margin: 0; }

/* ===== Cartão de perfil v2: cor no cartão inteiro, foto à direita ===== */
.pc { --pc-accent: var(--gold); position: relative; display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 15px; overflow: hidden;
  background:
    radial-gradient(120% 70% at 100% 0%, color-mix(in srgb, var(--pc-accent) 70%, transparent), transparent 70%),
    linear-gradient(170deg, color-mix(in srgb, var(--pc-accent) 42%, var(--panel)) 0%, color-mix(in srgb, var(--pc-accent) 14%, var(--panel)) 55%, var(--panel) 100%); }
.pc::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pc-accent) 45%, transparent); pointer-events: none; }
.pc-banner, .pc-head { display: none; }
.pc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pc-id { min-width: 0; padding-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.pc-name { font-size: 20px; text-shadow: 0 1px 8px rgba(0, 0, 0, .35); }
.pc-user { color: color-mix(in srgb, var(--ink) 75%, transparent); }
.pc-status { margin-top: 6px; color: color-mix(in srgb, var(--ink) 80%, transparent); }
.pc-ring { background: transparent; box-shadow: 0 0 0 3px var(--neon), 0 10px 26px rgba(0, 0, 0, .45); }
.pc-avatar.avatar { width: 84px; height: 84px; }
.pc-section { margin: 0; padding: 10px 12px; border-top: 0; border-radius: 10px; background: rgba(2, 2, 3, .34); border: 1px solid rgba(255, 255, 255, .06); }
.pc > div:not(.pc-top):not(.pc-section):not(.pc-actions) { display: flex; flex-direction: column; gap: 10px; }
.pc-actions { display: flex; justify-content: flex-end; gap: 6px; padding: 0; }
.pc-preview { background: transparent; border: 0; }
.swatch.custom { position: relative; overflow: hidden; background: conic-gradient(#ef5a6b, #f0b232, #3ee08a, #38bdf8, #9fb3ff, #c084fc, #ef5a6b); }
.swatch.custom input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }

/* Logo transparente (cavaleiro branco, sem fundo) no login, na barra de título e na página do convite */
.login-logo { width: 96px; height: 96px; border-radius: 0; box-shadow: none; object-fit: contain; filter: drop-shadow(0 10px 28px rgba(159, 179, 255, .18)); }
.tb-logo { border-radius: 0; object-fit: contain; }
.inv-logo { border: 0; padding: 0; background: none; border-radius: 0; object-fit: contain; width: 84px; height: 84px; margin-top: -42px; filter: drop-shadow(0 8px 22px rgba(0, 0, 0, .55)); }
.inv-logo.server-pic { border: 2px solid var(--gold); border-radius: 18px; background: var(--panel); object-fit: cover; width: 72px; height: 72px; margin-top: -36px; filter: none; }
@media (max-height: 760px) { .login-logo { width: 64px; height: 64px; } }

/* ===== 0.8.6: diagnóstico da transmissão e sensibilidade do microfone ===== */
.screen .stats-btn { position: absolute; top: 10px; right: 52px; z-index: 3; background: rgba(2, 2, 3, .6); border-radius: 8px; padding: 4px 8px; font-size: 14px; }
.screen .stats-btn.on { box-shadow: inset 0 0 0 1px var(--gold); }
.stats-box { position: absolute; top: 46px; right: 10px; z-index: 3; width: 230px; padding: 10px 12px; border-radius: 12px; background: rgba(2, 2, 3, .82);
  border: 1px solid var(--line-strong); font-size: 12.5px; display: flex; flex-direction: column; gap: 3px; pointer-events: none; }
.st-title { font-weight: 700; margin-bottom: 4px; color: var(--gold); }
.st-line { display: flex; justify-content: space-between; gap: 10px; }
.st-verdict { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); line-height: 1.4; }
.mic-meter { position: relative; }
.mic-level { transition: width .05s linear; }
.mic-level.below { opacity: .35; }
.mic-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--gold); border-radius: 1px; }
.warn { margin: 2px 0 0; color: #f0b232; line-height: 1.4; }
.screen .stats-btn { right: 10px; }

/* ===== 0.8.7: fotos redondas e configurações do servidor ===== */
.avatar, .avatar img, .msg .avatar, .sf .avatar, .member .avatar, .voice-user .avatar, .pc-avatar.avatar { border-radius: 50% !important; }
.roles-split { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 16px; align-items: start; }
.role-list { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; }
.role-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 0; border-radius: 8px; background: none; color: var(--muted); text-align: left; font-size: 14px; }
.role-item span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-item:hover { background: var(--hover); color: var(--ink); }
.role-item.sel { background: var(--raised); color: var(--ink); box-shadow: inset 2px 0 0 var(--gold); }
.role-item.add { color: var(--gold); }
.role-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); flex: none; }
.role-editor { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.perm-group { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.perm-group h4 { margin: 0 0 4px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.perm-toggle { margin-top: 2px; }
.assign { display: flex; flex-direction: column; gap: 4px; }
.assign .avatar { width: 24px; height: 24px; font-size: 10px; }
.access-row { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--chat); display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.access-head { display: flex; align-items: center; gap: 8px; }
.access-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.access-head select { width: auto; }
.access-roles { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-left: 26px; }
.access-chip { margin: 0; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; }
.member-row:hover { background: var(--hover); }
.mr-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.audit-row { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.server-header #btn-server-settings { flex: none; }
@media (max-width: 760px) { .roles-split { grid-template-columns: 1fr; } }
.sh-row { gap: 4px; }
.sh-row .icon-btn { padding: 5px; }
.server-name { word-break: keep-all; overflow-wrap: normal; }

/* ===== 0.8.8: ícones próprios e acabamento ===== */
.ic { display: block; flex: none; }
.icon-btn { display: inline-grid; place-items: center; min-width: 30px; min-height: 30px; padding: 6px; border-radius: 9px; line-height: 0;
  transition: background .15s, color .15s, transform .08s; }
.icon-btn:active { transform: scale(.94); }
.icon-btn:focus-visible { outline: 2px solid rgba(184, 154, 78, .7); outline-offset: 1px; }

/* Painel de voz */
.voice-panel { margin: 8px; padding: 10px; gap: 10px; border-radius: 14px; background: linear-gradient(180deg, color-mix(in srgb, var(--ok) 7%, var(--chat)), var(--chat)); border: 1px solid color-mix(in srgb, var(--ok) 22%, var(--line)); }
.vp-head { align-items: center; gap: 8px; }
.vp-signal { color: var(--ok); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: color-mix(in srgb, var(--ok) 12%, transparent); }
.vp-info { flex: 1; }
.vp-where { max-width: 100%; display: block; }
.vp-actions { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.vbtn { display: grid; place-items: center; height: 38px; padding: 0; border-radius: 11px; border: 1px solid var(--line); background: var(--raised); color: var(--ink);
  transition: background .15s, border-color .15s, color .15s, transform .08s; }
.vbtn:hover { border-color: var(--line-strong); background: var(--hover); }
.vbtn:active { transform: scale(.95); }
.vbtn.off { color: #fff; background: color-mix(in srgb, var(--danger) 70%, var(--raised)); border-color: transparent; }
.vbtn.live { background: var(--gold); color: #0a0a0c; border-color: var(--gold); }
.vbtn.hangup { color: #fff; background: #c94152; border-color: transparent; }
.vbtn.hangup:hover { background: #d84b5d; }

/* Barra de ações da mensagem: pílula flutuante */
.msg .actions { gap: 0; padding: 2px; border-radius: 10px; box-shadow: 0 6px 18px rgba(0, 0, 0, .4); }
.msg .actions .icon-btn { min-width: 30px; min-height: 28px; padding: 5px; border-radius: 8px; }
.rq-arrow { display: inline-grid; color: var(--subtle); }

/* Coroa do dono */
.crown { display: inline-grid; color: var(--gold); margin-left: 5px; vertical-align: -2px; }
.member .name, .mr-who b { display: inline-flex; align-items: center; min-width: 0; }
.member .name > span:first-child, .mr-who b > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Menu de contexto */
.ctx-arrow, .ctx-check { display: inline-grid; place-items: center; }
.ctx-menu { border-radius: 12px; box-shadow: 0 18px 44px rgba(0, 0, 0, .55); }
.ctx-item { border-radius: 8px; }

/* Salas */
.channel .glyph { color: var(--subtle); }
.channel.active .glyph { color: var(--gold); }
.cat-add { display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border-radius: 6px; }
.vs-icon .ic { display: block; }

/* Campo de mensagem */
.composer textarea { border-radius: 14px; padding: 13px 16px; background: var(--panel); border: 1px solid var(--line-strong); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .02);
  transition: border-color .15s, box-shadow .15s; }
.composer textarea:focus { border-color: rgba(184, 154, 78, .6); box-shadow: 0 0 0 3px rgba(184, 154, 78, .12); }

/* Palco */
.screen .fs, .screen .stats-btn { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 10px; background: rgba(2, 2, 3, .62); color: var(--ink); backdrop-filter: blur(4px); }
.screen .fs:hover, .screen .stats-btn:hover { background: rgba(2, 2, 3, .82); }
.screen .stats-btn { right: 52px; top: auto; bottom: 10px; }
.stats-box { top: auto; bottom: 54px; }

/* Barras de rolagem discretas */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(236, 236, 238, .1); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(236, 236, 238, .2); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* Modal */
.modal { border-radius: 18px; }
.modal-close { min-width: 32px; min-height: 32px; }

/* ===== 0.9.0: cor do servidor e formato do escudo ===== */
.shield.active { --sh-line: var(--shield-accent, var(--gold)); --sh-ink: var(--shield-accent, var(--gold)); }
.shield.active .sh-shape.has-img path { stroke: var(--shield-accent, var(--gold)); }
.salas .channel.active { box-shadow: inset 2px 0 0 var(--srv, var(--gold)); }
.salas .channel.active .glyph, .channel.active .glyph { color: var(--srv, var(--gold)); }
.voice-room.mine { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--srv, var(--gold)) 35%, var(--line)); }
.server-header { background: linear-gradient(180deg, color-mix(in srgb, var(--srv, var(--gold)) 7%, transparent), transparent 70%); }
.category .cat-name { transition: color .15s; }
.category:hover .cat-name { color: color-mix(in srgb, var(--srv, var(--gold)) 70%, var(--ink)); }
.shape-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.shape-choice { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--chat); color: var(--muted); font-size: 12.5px; }
.shape-choice:hover { border-color: var(--line-strong); color: var(--ink); }
.shape-choice.sel { border-color: var(--shield-accent, var(--gold)); color: var(--ink); background: var(--raised); }
.shape-choice .shield { width: 38px; height: 42px; pointer-events: none; }
.set-pane .swatches .swatch { width: 28px; height: 28px; }
.shield .sh-label { color: inherit; text-transform: none; letter-spacing: .01em; }
/* Logo do login: tracinho embaixo do "g" e o CHAT um pouco à direita (sem encostar no g) */
.wordmark .wm-chat { gap: .6em; margin-right: -2.15em; }
.wordmark .wm-chat::before { width: 1.7em; }

/* ===== 0.9.2: leve para a placa de vídeo =====
   Nada de desfoque por cima do vídeo (era recalculado a cada quadro da transmissão)
   e o pulso do status anima só a opacidade de uma camada pronta (feito pela placa sem redesenhar). */
.screen .fs, .screen .stats-btn { backdrop-filter: none; background: rgba(2, 2, 3, .78); }
.profile[data-status="online"] .pf-ring, .profile[data-status="playing"] .pf-ring { animation: none; position: relative;
  box-shadow: 0 0 6px color-mix(in srgb, var(--neon) 45%, transparent); }
.profile[data-status="online"] .pf-ring::after, .profile[data-status="playing"] .pf-ring::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 16px color-mix(in srgb, var(--neon) 75%, transparent);
  opacity: 0; animation: skc-glow 2.6s ease-in-out infinite; will-change: opacity; }
@keyframes skc-glow { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
/* O vídeo da transmissão fica numa camada própria: o resto da página mexer não obriga a recompor a imagem. */
.screen video { will-change: transform; transform: translateZ(0); }

/* Faixa de atualização: aparece no topo, com brilho dourado */
.update-banner { position: fixed; top: 44px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 12px;
  max-width: min(640px, calc(100vw - 24px)); padding: 10px 10px 10px 14px; border-radius: 14px; background: var(--raised);
  border: 1px solid color-mix(in srgb, var(--gold) 60%, transparent); box-shadow: 0 14px 40px rgba(0, 0, 0, .55), 0 0 0 4px rgba(184, 154, 78, .08);
  animation: ub-in .35s cubic-bezier(.2, .8, .2, 1); }
.ub-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); flex: none; box-shadow: 0 0 10px var(--gold); animation: ub-blink 1.2s ease-in-out infinite; }
.ub-text { display: flex; flex-direction: column; min-width: 0; font-size: 13.5px; }
.ub-notes { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes ub-in { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes ub-blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* Painel de desempenho */
.perf-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.perf-cell { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--chat); border: 1px solid var(--line); }
.perf-cell b { font-size: 18px; font-variant-numeric: tabular-nums; }
.perf-hint { margin: 4px 0; }
@media (max-width: 760px) { .perf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Conversas recentes */
.dm-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 10px; background: none; color: var(--ink); text-align: left; }
.dm-row:hover, .dm-row.active { background: var(--hover); }
.dm-row .avatar { width: 32px; height: 32px; font-size: 11px; }
.dm-row.wide { padding: 10px 12px; border: 1px solid var(--line); background: var(--panel); margin-bottom: 6px; }
.dm-row.wide:hover { border-color: var(--line-strong); }
.dm-row.wide .avatar { width: 40px; height: 40px; }
.dm-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dm-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-last { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-row.unread .dm-name, .dm-row.unread .dm-last { color: var(--ink); }
.dm-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }

/* Janela flutuante da transmissão */
.mini-player { position: fixed; z-index: 40; width: 320px; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000;
  border: 1px solid var(--line-strong); box-shadow: 0 10px 30px rgba(0, 0, 0, .55); cursor: pointer; touch-action: none; user-select: none; }
.mini-player video { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.mini-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .75)); font-size: 12.5px; opacity: 0; transition: opacity .15s; }
.mini-player:hover .mini-bar { opacity: 1; }
.mini-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-bar .icon-btn { width: 24px; height: 24px; }

/* Caixa de texto: anexar, emotes, enviar e @menção */
.composer { position: relative; }
.composer-row { display: flex; align-items: flex-end; gap: 6px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 14px; padding: 4px 6px; }
.composer-row:focus-within { border-color: rgba(184, 154, 78, .6); box-shadow: 0 0 0 3px rgba(184, 154, 78, .12); }
.composer .composer-row textarea { flex: 1; border: 0; background: transparent; box-shadow: none; padding: 9px 4px; border-radius: 0; outline: none; }
.composer .composer-row textarea:focus { box-shadow: none; }
.cmp-btn { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px; background: none; color: var(--muted); }
.cmp-btn:hover { background: var(--hover); color: var(--ink); }
.cmp-btn.send { color: var(--gold); }
.composer.drop .composer-row { border-color: var(--gold); border-style: dashed; }
.attach-tray { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.att-chip { display: flex; align-items: center; gap: 8px; max-width: 260px; padding: 6px 6px 6px 8px; border-radius: 10px; background: var(--raised); border: 1px solid var(--line); }
.att-chip img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.att-chip .att-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.att-chip.loading { color: var(--muted); font-size: 13px; padding: 10px 14px; }
.att-ico { color: var(--muted); display: grid; }
.mention-pop { position: absolute; left: 20px; right: 20px; bottom: calc(100% - 14px); z-index: 30; display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: var(--raised); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.mention-opt { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 0; border-radius: 8px; background: none; text-align: left; }
.mention-opt.sel, .mention-opt:hover { background: var(--hover); }
.mention-opt .avatar { width: 26px; height: 26px; font-size: 11px; }
.mo-name { font-weight: 600; }

/* Markdown */
.body code.md-code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .88em; padding: 1px 5px; border-radius: 5px; background: var(--raised); border: 1px solid var(--line); }
.md-pre { position: relative; margin: 6px 0; border-radius: 10px; background: #0d0f14; border: 1px solid var(--line); max-width: 100%; }
.md-pre pre { margin: 0; padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; line-height: 1.5; }
.md-lang { position: absolute; top: 6px; right: 40px; font-size: 11px; color: var(--subtle); text-transform: lowercase; }
.md-copy { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; opacity: 0; }
.md-pre:hover .md-copy { opacity: 1; }
.tk-kw { color: #c792ea; } .tk-str { color: #c3e88d; } .tk-num { color: #f78c6c; } .tk-com { color: #6b7280; font-style: italic; }
.md-h { font-family: var(--display); font-weight: 700; margin: 4px 0 2px; }
.md-h1 { font-size: 1.7em; } .md-h2 { font-size: 1.45em; } .md-h3 { font-size: 1.25em; } .md-h4 { font-size: 1.1em; }
.md-quote { border-left: 3px solid var(--line-strong); padding-left: 10px; color: var(--muted); margin: 2px 0; }
.md-spoiler { background: var(--line-strong); color: transparent; border-radius: 4px; cursor: pointer; padding: 0 2px; }
.md-spoiler.show { background: var(--raised); color: inherit; cursor: auto; }
.md-spoiler:not(.show) > * { visibility: hidden; } /* link e emote têm cor própria */
.md-link { color: var(--storm); text-decoration: none; } .md-link:hover { text-decoration: underline; }
/* Anexos */
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.att-media { position: relative; margin: 0; max-width: min(420px, 100%); border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #000; cursor: zoom-in; }
.att-media img, .att-media video { display: block; max-width: 100%; max-height: 320px; }
.att-media video { cursor: auto; }
.att-actions { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.att-media:hover .att-actions, .att-file:hover .att-actions { opacity: 1; }
.att-actions .icon-btn { width: 28px; height: 28px; background: rgba(0, 0, 0, .65); border-radius: 8px; display: grid; place-items: center; color: #fff; }
.att-file { position: relative; display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 380px; padding: 10px 12px; border-radius: 10px; background: var(--raised); border: 1px solid var(--line); }
.att-file .att-actions { position: static; opacity: 1; margin-left: auto; }
.att-file .att-actions .icon-btn { background: none; color: var(--muted); }
.att-meta { display: flex; flex-direction: column; min-width: 0; } .att-meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 14px; }
.att-full { max-width: 100%; max-height: 75vh; display: block; margin: 0 auto; border-radius: 8px; }
/* Ignorado */
.ignored-veil { filter: blur(6px); opacity: .6; cursor: pointer; user-select: none; }
.ignored-veil.show { filter: none; opacity: 1; cursor: auto; user-select: auto; }
/* Volume da transmissão no player */
/* Janela flutuante: puxador de tamanho */
.mini-player { height: auto; }
.mini-grip { position: absolute; top: 0; left: 0; width: 18px; height: 18px; z-index: 2; cursor: nwse-resize;
  background: linear-gradient(135deg, rgba(255, 255, 255, .55) 0 2px, transparent 2px 5px, rgba(255, 255, 255, .55) 5px 7px, transparent 7px); opacity: 0; }
.mini-player:hover .mini-grip { opacity: 1; }

/* Sino e conversas */
#btn-bell, #btn-dms { position: relative; }
.bell-badge { position: absolute; top: 2px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; pointer-events: none; }
.bell-pop { width: 330px; }
.bell-tabs { display: flex; gap: 4px; margin-bottom: 6px; }
.bell-tabs .ptab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; }
.bell-body { display: flex; flex-direction: column; gap: 2px; }
.note-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 10px; background: none; text-align: left; color: var(--ink); }
.note-row:hover { background: var(--hover); }
.note-row .avatar { width: 32px; height: 32px; font-size: 11px; flex: none; }
.note-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.note-text b { font-weight: 600; font-size: 13.5px; } .note-text .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-empty { padding: 14px 8px; text-align: center; }
.note-update { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.note-update p { margin: 0; }
.slider-line { display: flex; align-items: center; gap: 10px; } .slider-line input { flex: 1; accent-color: var(--gold); }

/* Tema claro */
:root[data-theme="light"] {
  --bg: #eceef2; --panel: #ffffff; --chat: #f7f8fa; --raised: #f0f2f5; --hover: #e6e9ee;
  --line: rgba(17, 19, 24, .10); --line-strong: rgba(17, 19, 24, .20);
  --ink: #16181d; --muted: #59606b; --subtle: #8b919a;
  --gold: #94752a; --gold-soft: rgba(148, 117, 42, .14); --storm: #3d5bd9; --storm-soft: rgba(61, 91, 217, .1);
  color-scheme: light;
}
:root[data-theme="light"] .md-pre { background: #f4f5f8; }
:root[data-theme="light"] .tk-kw { color: #8a3ab9; } :root[data-theme="light"] .tk-str { color: #3d7a12; }
:root[data-theme="light"] .tk-num { color: #b5501c; } :root[data-theme="light"] .tk-com { color: #8b919a; }
:root[data-theme="light"] .mention-pop, :root[data-theme="light"] .srv-pop { box-shadow: 0 10px 30px rgba(17, 19, 24, .15); }
:root[data-theme="light"] .msg .body, :root[data-theme="light"] .md-pre pre { color: var(--ink); }
:root[data-theme="light"] .wordmark .knight { color: var(--ink); }
:root[data-theme="light"] .ctx-item.danger { color: #c62f40; }

/* Atualização obrigatória: cobre tudo, acima de modais e faixas */
.mandatory-update { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 16px;
  background: rgba(8, 8, 12, .92); backdrop-filter: blur(6px); }
.mu-card { width: min(420px, 100%); text-align: center; display: grid; gap: 12px; justify-items: center;
  padding: 28px 24px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.mu-card h2, .mu-card p { margin: 0; }
.mu-logo { width: 56px; height: 56px; }
.mu-notes { white-space: pre-wrap; font-size: 14px; }

/* Editar a mensagem ali mesmo */
.edit-box { display: grid; gap: 6px; margin-top: 2px; }
.edit-box textarea { width: 100%; resize: none; min-height: 38px; max-height: 300px; padding: 8px 10px; border-radius: 8px;
  font: inherit; line-height: 1.4; color: var(--ink); background: var(--raised); border: 1px solid var(--line-strong); }
.edit-box textarea:focus { outline: none; border-color: var(--gold); }
.edit-hint { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.edit-actions { display: flex; gap: 6px; }

/* Condecorações no perfil */
.honors { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.honors li { display: flex; align-items: center; gap: 10px; }
.honors li > .verified, .honors li > .knight-badge, .honors li > .ai-badge { margin: 0; }
.honor-text { display: grid; gap: 1px; font-size: 13px; }

/* Selo "IA": pílula com faísca, nas contas da Claude */
.ai-badge { display: inline-flex; align-items: center; gap: 2px; height: 15px; padding: 0 5px 0 3px; margin: 0 4px; border-radius: 4px;
  vertical-align: 1px; flex: none; font-size: 10px; font-weight: 700; letter-spacing: .04em; line-height: 1;
  color: #fff; background: linear-gradient(135deg, #d97757, #7c8cf0); }
.ai-badge svg { width: 10px; height: 10px; display: block; }
.ai-badge.big { height: 19px; font-size: 12px; padding: 0 6px 0 4px; margin-left: 6px; vertical-align: 2px; }
.ai-badge.big svg { width: 12px; height: 12px; }

/* Selo oficial: cavaleiro dourado com brilho passando de vez em quando */
.verified, .knight-badge { position: relative; display: inline-block; width: 17px; height: 17px; margin: 0 4px; vertical-align: -3px; flex: none; }
.verified { overflow: hidden; -webkit-mask: url(brand/knight-white.png) center / contain no-repeat; mask: url(brand/knight-white.png) center / contain no-repeat; }
.verified { background: linear-gradient(180deg, #f4dc8b, #c9a24a 55%, #8a6a24); }
.verified::after { content: ""; position: absolute; inset: -40% auto -40% -60%; width: 40%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .85), transparent); animation: skc-shine 4.5s ease-in-out infinite; }
@keyframes skc-shine { 0%, 70% { left: -60%; } 100% { left: 130%; } }
.reduce-motion .verified::after { animation: none; display: none; }
.verified.big, .knight-badge.big { width: 23px; height: 23px; vertical-align: -4px; margin-left: 6px; }
/* Knight: espada azul com um brilho suave */
.knight-badge svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 0 2px rgba(91, 156, 255, .55)); }

/* Botão de destacar a transmissão numa janela (fica ao lado do tela cheia) */
.screen .pop-btn { position: absolute; right: 10px; bottom: 10px; z-index: 3; display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border-radius: 10px; background: rgba(2, 2, 3, .62); color: var(--ink); backdrop-filter: blur(4px); }
.screen.big .pop-btn { right: 52px; }
.screen .pop-btn:hover { background: rgba(2, 2, 3, .85); color: var(--gold); }

/* Confirmação com o visual do app (no lugar do confirm() do sistema) */
.confirm-box { width: min(420px, calc(100vw - 32px)); }
.confirm-box .modal-body { gap: 18px; padding: 22px 22px 18px; }
.confirm-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; font-size: 14.5px; }
.danger.solid { background: #d9434f; border-color: #d9434f; color: #fff; font-weight: 600; }
.danger.solid:hover { background: #e5525e; }

/* Ausência (AFK) na sala de voz: etiqueta dourada com o tempo */
.afk-tag { display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 55%; padding: 1px 6px; border-radius: 6px; flex: none;
  font-size: 11px; color: var(--gold); background: var(--gold-soft); border: 1px solid rgba(201, 162, 74, .35); }
.afk-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.afk-timer { font-variant-numeric: tabular-nums; opacity: .8; white-space: nowrap; }

/* Busca rápida (Ctrl+K) */
.quick-search { width: min(620px, calc(100vw - 32px)); margin-top: 12vh; }
.qs-box { display: flex; flex-direction: column; max-height: min(560px, 70vh); }
.qs-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.qs-input input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--ink); font: inherit; font-size: 16px; }
.qs-results { overflow-y: auto; padding: 6px; }
.qs-group { padding: 10px 10px 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--subtle); }
.qs-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.qs-item.sel { background: var(--raised); box-shadow: inset 2px 0 0 var(--gold); }
.qs-lead { display: grid; place-items: center; width: 28px; color: var(--muted); flex: none; }
.qs-av { width: 28px !important; height: 28px !important; flex: none; }
.qs-main { display: grid; min-width: 0; gap: 1px; }
.qs-title, .qs-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-empty { padding: 14px 10px; margin: 0; }
.qs-hint { margin: 0; padding: 10px 16px; border-top: 1px solid var(--line); }

/* Submenu: abre pelo JS (classe .open), com uma ponte invisível cobrindo a folga até ele */
.has-sub.open > .ctx-menu { display: flex; }
.has-sub > .ctx-menu::before { content: ""; position: absolute; top: 0; bottom: 0; left: -10px; width: 10px; }
.ctx-menu.flip .has-sub > .ctx-menu::before { left: auto; right: -10px; }

/* Sala em que você está: neon em L (borda esquerda inteira e o topo até a metade), com brilho borrado */
/* Na cor do servidor (o vermelho do StormKnight), a mesma da marquinha do canal selecionado. */
.voice-room.mine { --neon: var(--srv, #ffd56a); }
.voice-room.mine::before { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 10px; pointer-events: none;
  background:
    linear-gradient(90deg, var(--neon), transparent 55%) top left / 100% 3px no-repeat,
    linear-gradient(180deg, var(--neon), color-mix(in srgb, var(--neon) 20%, transparent)) top left / 3px 100% no-repeat;
  animation: skc-room-glow 3.6s ease-in-out infinite;
  filter: drop-shadow(0 0 3px var(--neon)) drop-shadow(0 0 9px color-mix(in srgb, var(--neon) 55%, transparent)); }

/* Ainda não assistindo: cartão "Assistir" no lugar do vídeo */
.screen.watch-card { display: grid; place-items: center; cursor: pointer; aspect-ratio: 16 / 9;
  background: radial-gradient(circle at 50% 40%, rgba(255, 77, 94, .14), transparent 60%), #0b0b10; }
.watch-inner { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 12px; }
.watch-name { font-size: 16px; }
.screen.watch-card:not(.big) .watch-inner { gap: 6px; }
.screen.watch-card:not(.big) .watch-name { font-size: 13px; }
.screen.watch-card:hover { box-shadow: inset 0 0 0 1px rgba(255, 77, 94, .5); }
.screen .unwatch-btn { position: absolute; right: 94px; bottom: 10px; z-index: 3; display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border-radius: 10px; background: rgba(2, 2, 3, .62); color: var(--ink); backdrop-filter: blur(4px); }
.screen.big:not(:has(.pop-btn)) .unwatch-btn { right: 52px; }

/* Ausência: texto longo desliza */
.afk-label.slide { max-width: 92px; -webkit-mask: linear-gradient(90deg, transparent, #000 8px, #000 calc(100% - 8px), transparent); mask: linear-gradient(90deg, transparent, #000 8px, #000 calc(100% - 8px), transparent); }
.afk-track { display: inline-flex; gap: 24px; animation: skc-afk-slide 9s linear infinite; }
@keyframes skc-afk-slide { from { transform: translateX(0); } to { transform: translateX(calc(-50% - 12px)); } }
.afk-tag:hover .afk-track { animation-play-state: paused; }
.reduce-motion .afk-track { animation: none; }
@media (prefers-reduced-motion: reduce) { .afk-track { animation: none; } }

/* Mutado / som desligado na sala: um chip só, com o desenho inteiro */
.vs-chip { display: inline-grid; place-items: center; width: 18px; height: 18px; flex: none; border-radius: 6px;
  color: #ff7b86; background: rgba(229, 72, 89, .16); border: 1px solid rgba(229, 72, 89, .35); }
.vs-chip .ic { display: block; }

/* Sala em que você está: o L é uma borda só (esquerda + topo) que faz a curva no canto e some aos poucos,
   para a direita e para baixo. Sem a barrinha do canal selecionado por cima, que deixava um degrau. */
.voice-room.mine .channel, .salas .voice-room.mine .channel.active { box-shadow: none; background: transparent; }
.voice-room.mine::before { background: none; border-left: 3px solid var(--neon); border-top: 3px solid var(--neon); border-radius: 10px 0 0 0;
  -webkit-mask: linear-gradient(90deg, #000 30%, transparent 62%), linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .3) 100%);
  -webkit-mask-composite: source-in; mask: linear-gradient(90deg, #000 30%, transparent 62%), linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .3) 100%);
  mask-composite: intersect; }

/* Sala em que você está, mas com um chat aberto: sem neon nem fundo, só o ícone verde de conectado.
   O destaque forte fica para quando você está vendo a sala (.viewing). */
.voice-room.mine:not(.viewing) { background: transparent; box-shadow: none; animation: none; }
.voice-room.mine:not(.viewing)::before { display: none; }
.voice-room.mine:not(.viewing) .channel .ch-name { font-weight: 500; }
/* O cinza do hover de cada pessoa fica dentro da caixa da sala, sem cobrir o contorno. */
.voice-room { overflow: hidden; }
.salas .voice-room .voice-user { margin-right: 6px; }

/* Atalhos de teclado nas configurações */
.hk-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hk-btn { min-width: 180px; font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: .02em; }
.hk-btn.empty { color: var(--muted); font-weight: 500; }
.hk-btn.listening { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }

/* Atualização rápida (patch da interface) pronta, esperando a pessoa sair da call */
.update-banner.patch .ub-dot { background: var(--ok); box-shadow: 0 0 0 4px rgba(59, 201, 104, .2); }

/* ===== Patch p1 ===== */
/* Lateral direita (servidores e salas) um pouco mais larga: cabe mais informação */
.app { grid-template-columns: minmax(0, 1fr) 0px 284px; }
.app.members-open { grid-template-columns: minmax(0, 1fr) 240px 284px; }
.app.members-open.no-server { grid-template-columns: minmax(0, 1fr) 0px 284px; }
@media (max-width: 1100px) {
  .app { grid-template-columns: minmax(0, 1fr) 0px 256px; }
  .app.members-open { grid-template-columns: minmax(0, 1fr) 216px 256px; }
}
@media (max-width: 900px) { .app, .app.members-open { grid-template-columns: minmax(0, 1fr) 0px 220px; } }
@media (max-width: 640px) { .app, .app.members-open { grid-template-columns: minmax(0, 1fr) 0px 180px; } }

/* Na sala: o que muda fica à direita, cinza, sem empurrar foto e nome */
.voice-user .name { flex: 1; min-width: 0; }
.vs-end { display: inline-grid; place-items: center; flex: none; color: var(--muted); opacity: .85; }
.vs-end .ic { display: block; }
/* Falando: o anel verde acende e apaga na hora */
.voice-user .avatar { transition: box-shadow 60ms linear; }
.voice-user.speaking .name { color: var(--ink); }

/* Ao vivo (Neto): nome vermelho vivo num fundo levemente avermelhado, com um brilho branco
   varrendo da esquerda para a direita, como um letreiro "AO VIVO" */
.voice-user.is-live { background: linear-gradient(90deg, rgba(255, 60, 80, .14), rgba(255, 60, 80, .04)); border-radius: 6px; }
.voice-user.is-live .name {
  background: linear-gradient(100deg, #ff3b4f 0%, #ff3b4f 42%, #ffffff 50%, #ff3b4f 58%, #ff3b4f 100%) 0 0 / 250% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: skc-live-sweep 2.4s ease-in-out infinite; }
@keyframes skc-live-sweep { 0% { background-position: 100% 0; } 70%, 100% { background-position: -60% 0; } }
.reduce-motion .voice-user.is-live .name { animation: none; }
@media (prefers-reduced-motion: reduce) { .voice-user.is-live .name { animation: none; } }

/* Escudo próprio ("Só a imagem"): sem moldura; aberto, ganha um brilho na cor do servidor */
.shield .sh-shape.free { overflow: visible; }
.shield.active .sh-shape.free { filter: drop-shadow(0 0 3px color-mix(in srgb, var(--shield-accent, var(--gold)) 70%, transparent)); }
.shape-choices { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* ===== Tela de carregamento: preta, cavaleiro em fade, névoa (identidade do stormknight.com.br) ===== */
.splash { position: fixed; inset: 0; z-index: 10000; display: grid; place-content: center; justify-items: center; gap: 14px;
  background: #000; overflow: hidden; transition: opacity .7s ease; }
.splash.in { animation: sp-in .35s ease both; }
.splash.out { opacity: 0; pointer-events: none; }
.sp-knight { width: 112px; height: auto; opacity: 0; animation: sp-knight 2.4s ease-in-out .1s infinite; user-select: none; }
.sp-word { font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: .55em; margin-right: -.55em; color: #d9d9d9;
  opacity: 0; animation: sp-rise .9s ease .25s forwards; }
.sp-tag { font-size: 10px; letter-spacing: .5em; margin-right: -.5em; color: #6f6f6f; opacity: 0; animation: sp-rise .9s ease .45s forwards; }
@keyframes sp-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sp-knight { 0% { opacity: .15; transform: scale(.98); filter: drop-shadow(0 0 0 rgba(255,255,255,0)); }
  50% { opacity: 1; transform: scale(1); filter: drop-shadow(0 0 18px rgba(255,255,255,.25)); }
  100% { opacity: .15; transform: scale(.98); filter: drop-shadow(0 0 0 rgba(255,255,255,0)); } }
@keyframes sp-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.reduce-motion .sp-knight, .reduce-motion .sp-word, .reduce-motion .sp-tag { animation: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .sp-knight, .sp-word, .sp-tag { animation: none; opacity: 1; } }

/* Novidades no sino: o que cada atualização trouxe */
.bell-pop .bell-body { max-height: min(70vh, 520px); overflow-y: auto; }
.novidades { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.novidades h4 { margin: 0 4px 6px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--subtle); }
.nov-item { padding: 8px 6px; border-radius: 8px; }
.nov-item.top { background: var(--hover); }
.nov-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.nov-item ul { margin: 4px 0 0; padding-left: 16px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.nov-item li + li { margin-top: 2px; }

/* Novidades dentro dos ajustes: sem a linha de cima do sino */
.set-pane .novidades { margin-top: 4px; padding-top: 0; border-top: 0; }
.set-pane .nov-item { padding: 10px 12px; border: 1px solid var(--line); margin-bottom: 8px; }
.set-pane .nov-item ul { font-size: 13.5px; }

.vbtn.live { margin-left: 0; padding: 0; border-radius: 11px; font-size: inherit; letter-spacing: normal; }

/* Mensagem de voz: botão gravando, contador e player no chat */
.cmp-btn.recording { color: #fff; background: #c94152; border-radius: 10px; animation: rec-pulse 1.2s ease-in-out infinite; }
@keyframes rec-pulse { 50% { box-shadow: 0 0 0 4px rgba(201, 65, 82, .25); } }
.rec-label { align-self: center; font-size: 12px; font-weight: 600; color: #ff6b6b; font-variant-numeric: tabular-nums; white-space: nowrap; }
.att-voice { display: flex; align-items: center; gap: 8px; max-width: min(420px, 100%); padding: 6px 8px 6px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.att-voice .av-ico { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--gold); color: #0a0a0c; }
.att-voice audio { flex: 1; min-width: 0; height: 34px; }
.att-voice .att-actions { position: static; opacity: 1; display: flex; gap: 2px; }
.reduce-motion .cmp-btn.recording { animation: none; }

/* Seletor com várias telas: marcadas ganham borda e o número da ordem */
.pick { position: relative; }
.pick.sel { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft, rgba(184,154,78,.25)); }
.pick-n { position: absolute; top: 8px; left: 8px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--gold); color: #0a0a0c; font-weight: 700; font-size: 13px; }

/* ===== Privado encaixado no vão dos membros ===== */
.dm-dock { display: none; }
.app.dock-open .members-col > .col-head, .app.dock-open .members-col > .members { display: none; }
.app.dock-open .members-col > .dm-dock { display: flex; flex-direction: column; height: 100%; min-height: 0; opacity: 1; }
.app.members-open.dock-open, .app.members-open.dock-open.no-server { grid-template-columns: minmax(0, 1fr) 300px 284px; }
@media (max-width: 1100px) { .app.members-open.dock-open { grid-template-columns: minmax(0, 1fr) 270px 256px; } }
.dd-head { gap: 6px; padding: 0 6px 0 12px; }
.dd-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dd-who .avatar { width: 26px; height: 26px; flex: none; }
.dd-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-actions { display: flex; gap: 2px; flex: none; }
.dd-list { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.dd-msg { display: flex; flex-direction: column; gap: 2px; max-width: 100%; }
.dd-meta { display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; }
.dd-msg.mine .dd-meta b { color: var(--gold); }
.dd-body { font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.dd-msg .att-media, .dd-msg .att-voice, .dd-msg .att-file { max-width: 100%; }
.dd-empty { margin: auto; text-align: center; }
/* Mesmas mensagens do meio, só mais justas para caber ao lado e na janelinha */
.dd-list.messages { padding: 8px 0; gap: 0; }
.dd-list .msg { grid-template-columns: 32px minmax(0, 1fr) auto; gap: 0 9px; padding: 4px 10px; }
.dd-list .msg-side .avatar, .dd-list .msg > .avatar { width: 32px; height: 32px; font-size: 12px; }
.dd-list .msg .body { font-size: 13.5px; overflow-wrap: anywhere; }
.dd-list .history-note { font-size: 11.5px; padding: 4px 10px 10px; }
.dd-composer .cmp-btn { width: 30px; height: 34px; flex: none; }
.dd-composer { display: flex; align-items: flex-end; gap: 4px; margin: 8px; padding: 4px 6px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--panel); }
.dd-composer:focus-within { border-color: rgba(184, 154, 78, .6); }
.dd-drop { outline: 2px dashed var(--gold); outline-offset: -4px; }
.dd-composer textarea { flex: 1; min-height: 34px; max-height: 120px; resize: none; border: 0; background: transparent; box-shadow: none; padding: 7px 4px; outline: none; color: var(--ink); font: inherit; font-size: 13.5px; }
.dock-btn { position: relative; }
.dock-btn.on { color: var(--gold); }
.dock-btn .badge { position: absolute; top: -4px; right: -6px; height: 15px; min-width: 15px; font-size: 9.5px; padding: 0 4px; }

/* Seis formatos de escudo: grade de 3 por linha */
.shape-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Várias telas: ⚙ e ✕ no lugar do botão de transmitir, lista de telas e duas telas grandes lado a lado */
.vbtn-split { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.vbtn-split .vbtn { min-width: 0; }
.scr-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.scr-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--chat); }
.scr-row .pick-n { position: static; flex: none; }
.scr-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screen .side-btn, .screen .unfocus-btn { position: absolute; top: 6px; right: 6px; z-index: 2; background: rgba(0, 0, 0, .55); color: #fff; opacity: 0; transition: opacity .15s; }
.screen:hover .side-btn, .screen:hover .unfocus-btn { opacity: 1; }
.screen .unfocus-btn { right: auto; left: 6px; }
.thumbs .screen-label span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ⚙ e ✕ do painel de voz: uma peça só, dividida ao meio. Engrenagem amarela, X vermelho;
   a metade com o mouse em cima cresce e a outra encolhe. */
.vbtn-split { display: flex; gap: 0; height: 38px; border-radius: 11px; overflow: hidden; }
.vbtn-split .vbtn, .vbtn-split .vbtn.live { flex: 1 1 0; min-width: 0; height: 100%; border: 0; border-radius: 0; transition: flex-grow .2s ease, filter .15s; }
.vbtn-split .vbtn:first-child { background: #e0b43a; color: #1a1408; }
.vbtn-split .vbtn:last-child { background: #e0303f; color: #fff; box-shadow: inset 1px 0 0 rgba(0, 0, 0, .35); }
.vbtn-split .vbtn:hover { flex-grow: 2.2; filter: brightness(1.08); }
.vbtn-split .vbtn .ic { transition: transform .2s ease; }
.vbtn-split .vbtn:hover .ic { transform: scale(1.15); }
.vbtn-split .vbtn:active { transform: none; filter: brightness(.95); }
.reduce-motion .vbtn-split .vbtn, .reduce-motion .vbtn-split .vbtn .ic { transition: none; }

/* Tela de atualização: a mesma da de carregamento, com a barra dourada de progresso */
.update-screen { z-index: 10001; }
.update-screen .sp-knight { animation-duration: 1.8s; }
.us-bar { width: min(320px, 70vw); height: 4px; margin-top: 18px; border-radius: 4px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.us-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #8a7238, #e0c070); box-shadow: 0 0 10px rgba(224, 192, 112, .5); transition: width .25s ease; }
.us-back { margin-top: 16px; }
.us-text { font-size: 12px; letter-spacing: .08em; color: #8a8a8a; font-variant-numeric: tabular-nums; }

/* "Sem escudo": sem contorno e sem a cor do servidor (iniciais em cinza; foto como é, sem brilho) */
.shield:has(.sh-shape.none), .shield.active:has(.sh-shape.none) { --sh-ink: var(--muted); color: var(--muted); }
.shield:has(.sh-shape.none):hover { --sh-ink: var(--ink); color: var(--ink); }
.shape-choices { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.shield.active .sh-shape.plain { filter: none; }

/* Arrastar salas: a que está sendo levada fica apagada; a linha dourada mostra onde vai cair */
.channel[draggable="true"], .category[draggable="true"] { -webkit-user-drag: element; }
.dragging { opacity: .45; }
.drop-before { box-shadow: inset 0 2px 0 var(--gold) !important; }
.drop-after { box-shadow: inset 0 -2px 0 var(--gold) !important; }
.drop-into { outline: 1px dashed var(--gold); outline-offset: -1px; border-radius: 6px; }
/* Ajustes › Aplicativo: versão em dia ou não */
.ver-check.ok { color: var(--ok); }
.ver-check.bad { color: #ff8a65; }

/* Condecorações embaixo da foto, na coluna da esquerda da mensagem */
.msg-side { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 38px; }
.msg-honors { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; }
.msg-honors:empty { display: none; }
.msg-honors > * { margin: 0 !important; transform: scale(.9); }

/* Volume em barra dentro do menu do botão direito */
.ctx-slider { padding: 6px 10px 8px; min-width: 200px; }
.ctx-slider-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 4px; }
.ctx-slider-val { color: var(--muted); font-variant-numeric: tabular-nums; }
.ctx-slider input[type="range"] { width: 100%; }
.ctx-slider-name { display: inline-flex; align-items: center; gap: 10px; }
.ctx-menu .ctx-slider.is-voice .ctx-ic { color: #4c8dff; }
.ctx-menu .ctx-slider.is-stream .ctx-ic { color: var(--gold); }

/* Interface invertida: servidor e salas à esquerda, chat à direita (a ordem das colunas vira) */
.app.mirrored { direction: rtl; }
.app.mirrored > * { direction: ltr; }
.app.mirrored .sidebar.salas { border-left: 0; border-right: 1px solid var(--line); }
.app.mirrored .members-col { border-left: 0; border-right: 1px solid var(--line); }
.mirror-btn { opacity: .45; width: 24px; height: 24px; }
.mirror-btn:hover, .app.mirrored .mirror-btn { opacity: 1; }
.crop .small-btn { margin-top: 6px; }

/* Webcam: botão no painel (5 botões agora) e o vídeo no lugar da foto, no palco */
.vp-actions { grid-template-columns: repeat(5, 1fr); }
.vbtn.cam-on { background: var(--ok); color: #06140b; border-color: transparent; }
.call-tile.has-cam { padding: 0; overflow: hidden; }
.cam-face { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; background: #000; }
.cam-face video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-face video.self-cam { transform: scaleX(-1); }
.cam-face.screen-face video { object-fit: contain; }
.call-tile.on-screen { border-color: rgba(237, 66, 69, .55); }
.call-tile.on-screen.speaking { border-color: var(--ok); }
.call-name .tile-rec + span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-rec { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #ed4245; box-shadow: 0 0 6px rgba(237, 66, 69, .8); }
.call-tile.has-cam .call-name { position: absolute; left: 10px; bottom: 10px; z-index: 1; background: rgba(0, 0, 0, .55); padding: 3px 8px; border-radius: 8px; }
.call-tile.has-cam.speaking .cam-face { box-shadow: inset 0 0 0 3px var(--ok); }
.cam-face.small { position: relative; width: 88px; height: 88px; border-radius: 50%; }
.person.speaking .cam-face.small { box-shadow: 0 0 0 3px var(--ok); }

/* ===== Clãs (casinha): a interface dá lugar à página de servidores ===== */
.app.hub-open > :not(.topbar):not(#hub) { display: none !important; }
.hub { grid-column: 1 / -1; grid-row: 2; overflow-y: auto; background: var(--chat); }
.hub.hidden { display: none; }
.hub-inner { max-width: 1100px; margin: 0 auto; padding: 24px 28px 48px; }
.hub-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.hub-head h2 { margin: 0 0 4px; font-family: var(--display); font-size: 28px; letter-spacing: .02em; }
.hub-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hub-actions .badge { margin-left: 6px; }
.hub-decks { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 10px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.hub-decks-label { text-transform: uppercase; letter-spacing: .14em; margin-right: 4px; }
.hub-chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--muted); font-size: 13px; }
.hub-chip:hover { color: var(--ink); border-color: var(--muted); }
.hub-chip.on { background: var(--gold); border-color: var(--gold); color: #0a0a0c; font-weight: 600; }
.hub-deck-hint { margin: 0 0 6px; }
.hub-folder { margin-top: 18px; }
.hub-folder-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.hub-folder-head h3 { margin: 0; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--subtle); }
.hub-fold { display: grid; place-items: center; width: 22px; height: 22px; border: 0; background: none; color: var(--muted); border-radius: 6px; transition: transform .15s; }
.hub-fold.closed { transform: rotate(-90deg); }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.hub-card { position: relative; display: flex; flex-direction: column; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--ink); text-align: left; overflow: hidden; transition: transform .15s, border-color .15s; }
.hub-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.hub-card.current { border-color: var(--gold); }
.hc-banner { height: 76px; background-size: cover; background-position: center; }
.hc-body { display: flex; align-items: center; gap: 10px; padding: 0 12px 12px; margin-top: -20px; }
.hc-body .shield { width: 40px; height: 44px; flex: none; }
.hc-text { display: flex; flex-direction: column; min-width: 0; flex: 1; padding-top: 18px; }
.hc-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-body .badge { align-self: flex-end; }
/* Selo de servidor oficial (cartão do clã e banner do servidor) */
.srv-official { position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 5px; border-radius: 999px;
  background: linear-gradient(135deg, #f3d77a, #b8902e); color: #1a1408; font-size: 10px; font-weight: 800; letter-spacing: .12em; box-shadow: 0 2px 10px rgba(0, 0, 0, .45); }
.srv-official .so-knight { width: 14px; height: 14px; background: #1a1408; -webkit-mask: url(/brand/knight-white.png) center / contain no-repeat; mask: url(/brand/knight-white.png) center / contain no-repeat; }
.server-banner { position: relative; }
.srv-official.big { top: 8px; right: 8px; }
/* Casinha vira setinha de voltar */
.home-btn .home-back { position: absolute; inset: 0; margin: auto; opacity: 0; transform: rotate(-90deg) scale(.6); transition: opacity .2s, transform .2s; }
.home-btn > svg:first-child { transition: opacity .2s, transform .2s; }
.home-btn.back > svg:first-child { opacity: 0; transform: scale(.4) rotate(45deg); }
.home-btn.back .home-back { opacity: 1; transform: none; }
.home-btn { position: relative; }

/* Setinha de inverter: uma abinha discreta no meio da borda interna da coluna de salas */
.salas .mirror-btn { position: absolute; top: 50%; left: 0; z-index: 3; width: 16px; height: 44px; margin-top: -22px; padding: 0;
  border-radius: 0 8px 8px 0; background: var(--panel); border: 1px solid var(--line); border-left: 0; opacity: .35; }
.salas .mirror-btn:hover { opacity: 1; }
.app.mirrored .salas .mirror-btn { left: auto; right: 0; border-radius: 8px 0 0 8px; border-left: 1px solid var(--line); border-right: 0; opacity: .6; }

/* Salas de voz ao contrário das de texto: nome e ícone à direita, tempo à esquerda (e as pessoas também) */
.salas .voice-room > .channel { flex-direction: row-reverse; }
.salas .voice-room > .channel .ch-name { text-align: right; }
.salas .voice-room > .channel .vc-timer { margin-left: 0; margin-right: auto; }
.salas .voice-room .voice-user { flex-direction: row-reverse; margin: 0 26px 2px 6px; }
.salas .voice-room .voice-user .name { text-align: right; }
.salas .voice-room .room-status { display: flex; justify-content: flex-end; text-align: right; }
/* Interface invertida: tudo vira, para o lado certo (texto à direita, voz à esquerda) */
.app.mirrored .salas .channel { flex-direction: row-reverse; }
.app.mirrored .salas .channel .ch-name { text-align: right; }
.app.mirrored .salas .voice-room > .channel { flex-direction: row; }
.app.mirrored .salas .voice-room > .channel .ch-name { text-align: left; }
.app.mirrored .salas .voice-room > .channel .vc-timer { margin-right: 0; margin-left: auto; }
.app.mirrored .salas .voice-room .voice-user { flex-direction: row; margin: 0 6px 2px 26px; }
.app.mirrored .salas .voice-room .voice-user .name { text-align: left; }
.app.mirrored .salas .voice-room .room-status { justify-content: flex-start; text-align: left; }

/* ===== Modo claro mais suave: cinza claro em vez de branco estourado ===== */
:root[data-theme="light"] {
  --bg: #d9dce2; --panel: #e6e8ec; --chat: #eceef1; --raised: #dfe2e7; --hover: #d3d7de;
  --line: rgba(17, 19, 24, .12); --line-strong: rgba(17, 19, 24, .22);
  --ink: #1b1d22; --muted: #555b65; --subtle: #7d838d;
}
:root[data-theme="light"] .md-pre { background: #e1e4e9; }
/* Cavaleiro do logo: branco no escuro, escuro no claro (a tela de carregamento é sempre preta) */
:root[data-theme="light"] .tb-logo, :root[data-theme="light"] .login-logo, :root[data-theme="light"] .mu-logo { filter: invert(1) brightness(.25); }
/* Emote :cavaleiro: (pega a cor do texto) */
.emo { display: inline-block; width: 1.3em; height: 1.3em; vertical-align: -.28em; background: currentColor; }
.emo-knight { -webkit-mask: url(/brand/knight-white.png) center / contain no-repeat; mask: url(/brand/knight-white.png) center / contain no-repeat; }
.ctx-emoji .emo { width: 22px; height: 22px; vertical-align: middle; color: var(--ink); }
/* No claro o fundo desses botões é escuro (cor do texto): o texto deles fica claro */
:root[data-theme="light"] .primary, :root[data-theme="light"] .ptab.sel, :root[data-theme="light"] .rail-btn.active { color: #f3f4f6; }

/* ===== A cara do StormKnight (material do site) ===== */
/* Login: vídeo do cavaleiro bem apagado, névoa correndo e o lema */
.login { position: relative; isolation: isolate; }
.login-motto { margin: 6px 0 0; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
/* Clãs: cabeçalho com cena */
.hub-head { position: relative; isolation: isolate; padding: 36px 24px 20px; margin: -24px -28px 14px; overflow: hidden; border-radius: 0 0 18px 18px; align-items: flex-end; }
.hub-kicker { display: block; font-size: 10.5px; letter-spacing: .3em; color: var(--gold); margin-bottom: 4px; }
.hub-title h2 { text-shadow: 0 2px 12px rgba(0, 0, 0, .5); }
/* Sobre a StormKnight */
.about-sk { display: block; }
.about-sk p { margin: 0 0 8px; line-height: 1.5; }
.about-sk-motto { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }

/* Servidor oficial: cavaleiro no escudo (cor do tema) e brilho deslizando, como o selo do dono */
.shield .sh-knight { position: relative; width: 62%; height: 62%; margin-top: -3px; overflow: hidden; background: var(--ink);
  -webkit-mask: url(/brand/knight-white.png) center / contain no-repeat; mask: url(/brand/knight-white.png) center / contain no-repeat; }
.shield.active .sh-knight { background: linear-gradient(180deg, #f4dc8b, #c9a24a 55%, #8a6a24); }
.shield .sh-knight::after, .srv-official::after { content: ""; position: absolute; inset: -40% auto -40% -60%; width: 40%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .85), transparent); animation: skc-shine 4.5s ease-in-out infinite; }
.srv-official { overflow: hidden; }
.reduce-motion .shield .sh-knight::after, .reduce-motion .srv-official::after { animation: none; display: none; }

/* ===== Modo claro: sombras para dar relevo (antes ficava tudo chapado) ===== */
:root[data-theme="light"] .topbar { box-shadow: 0 1px 0 var(--line), 0 4px 14px rgba(20, 24, 32, .06); position: relative; z-index: 2; }
:root[data-theme="light"] .salas, :root[data-theme="light"] .members-col { box-shadow: -6px 0 18px rgba(20, 24, 32, .06); }
:root[data-theme="light"] .app.mirrored .salas { box-shadow: 6px 0 18px rgba(20, 24, 32, .06); }
:root[data-theme="light"] .salas .channel.active, :root[data-theme="light"] .voice-room.viewing { box-shadow: 0 1px 3px rgba(20, 24, 32, .12), inset 2px 0 0 var(--gold); }
:root[data-theme="light"] .composer-row { box-shadow: 0 2px 10px rgba(20, 24, 32, .08); }
:root[data-theme="light"] .msg:hover { background: rgba(20, 24, 32, .035); }
:root[data-theme="light"] .hub-card, :root[data-theme="light"] .call-tile, :root[data-theme="light"] .screen, :root[data-theme="light"] .set-section,
:root[data-theme="light"] .vbtn, :root[data-theme="light"] .att-file, :root[data-theme="light"] .att-voice { box-shadow: 0 1px 2px rgba(20, 24, 32, .08), 0 4px 14px rgba(20, 24, 32, .06); }
:root[data-theme="light"] .hub-card:hover { box-shadow: 0 6px 22px rgba(20, 24, 32, .14); }
:root[data-theme="light"] .modal, :root[data-theme="light"] .ctx-menu, :root[data-theme="light"] .pc-pop, :root[data-theme="light"] .bell-pop { box-shadow: 0 18px 50px rgba(20, 24, 32, .22); }
:root[data-theme="light"] .ctx-menu { background: #eef0f3; }
:root[data-theme="light"] input, :root[data-theme="light"] textarea, :root[data-theme="light"] select { box-shadow: inset 0 1px 2px rgba(20, 24, 32, .08); }

/* Janelas respeitam o zoom da interface (--uiz): nada de encostar no topo e no fim da tela */
.modal { width: min(660px, calc(100vw / var(--uiz, 1) - 32px)); max-height: calc(100vh / var(--uiz, 1) - 48px); }
.modal.wide { width: min(980px, calc(100vw / var(--uiz, 1) - 32px)); }
.modal-inner { max-height: calc(100vh / var(--uiz, 1) - 48px); }
.srv-pop { max-height: min(460px, calc(100vh / var(--uiz, 1) - 90px)); }
.pc-pop { max-height: calc(100vh / var(--uiz, 1) - 16px); }
.confirm-box { width: min(420px, calc(100vw / var(--uiz, 1) - 32px)); }
.quick-search { width: min(620px, calc(100vw / var(--uiz, 1) - 32px)); }
/* Configurações: altura fixa dentro da tela; a lista da esquerda e o conteúdo rolam cada um por si (pedido do Mello) */
.settings { height: min(640px, calc(100vh / var(--uiz, 1) - 150px)); min-height: 0; }
.set-nav, .set-pane { min-height: 0; overflow-y: auto; }
/* Imagem aberta: clique amplia 2x onde clicou (cursor de lupa), mexer o mouse passeia */
.att-zoom { overflow: hidden; display: grid; place-items: center; border-radius: 10px; background: #000; cursor: zoom-in;
  max-height: calc(100vh / var(--uiz, 1) - 190px); }
.att-zoom .att-full { max-width: 100%; max-height: calc(100vh / var(--uiz, 1) - 190px); object-fit: contain; transition: transform .2s ease; user-select: none; }
.att-zoom.zoomed { cursor: zoom-out; }
.att-zoom.zoomed .att-full { transform: scale(2); }
.att-full-actions { margin-top: 10px; gap: 8px; align-items: center; }
.att-full-actions .muted { margin-right: auto; }
.att-full-actions .small-btn { display: inline-flex; align-items: center; gap: 6px; }
.reduce-motion .att-zoom .att-full { transition: none; }

/* Links de convite: abrem dentro do app */
.md-invite { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.md-invite svg { flex: none; }
.invite-open-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 12px; }
.invite-open-head .shield { width: 52px; height: 58px; flex: none; cursor: default; }
.invite-open-name { font-size: 17px; }
.invite-open-head p { margin: 2px 0 0; }

/* Mensagem de voz: caixinha "Permitir baixar" no anexo antes de enviar */
.att-dl-opt { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap; margin: 0; text-transform: none; letter-spacing: 0; font-weight: 500; }
.att-dl-opt input { margin: 0; width: auto; }

/* Arrastar arquivo: a barra de envio cresce e avisa onde soltar */
.composer-row { transition: min-height .18s ease, background-color .18s ease, border-color .18s ease; }
.composer.drop .composer-row { min-height: 112px; align-items: center; background: color-mix(in srgb, var(--gold) 9%, var(--panel)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 14%, transparent); }
.composer.drop .composer-row > * { opacity: .2; pointer-events: none; }
.composer.drop::after { content: 'Solte para anexar'; position: absolute; left: 20px; right: 20px; bottom: 20px; height: 112px; display: grid; place-items: center;
  color: var(--gold); font-weight: 600; font-size: 15px; letter-spacing: .02em; pointer-events: none; }
/* Música no chat */
.att-music { display: flex; align-items: center; gap: 10px; width: min(420px, 100%); padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); position: relative; }
.att-music .am-ico { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 10px; background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); }
.att-music .am-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.att-music .am-name { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-music audio { width: 100%; height: 32px; }
.att-music .att-actions { position: static; opacity: 1; display: flex; gap: 2px; align-self: flex-start; }
.att-chip:has(.att-dl-opt) { max-width: 380px; }
.att-chip .muted.small { white-space: nowrap; }

/* Logo StormKnight Chat no lugar do nome do servidor oficial */
.sn-wm { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1; font-family: var(--display); padding: 2px 0; }
.sn-wm .storm { font-weight: 600; font-size: 8.5px; letter-spacing: .55em; color: var(--muted); text-transform: uppercase; margin-left: 2px; }
.sn-wm .knight { font-weight: 700; font-size: 24px; letter-spacing: -.045em; margin: 2px 0 1px; color: var(--ink); }
.sn-wm .wm-chat { align-self: flex-end; display: flex; align-items: center; gap: .6em; margin-right: -.55em; font-weight: 600; font-size: 8.5px; letter-spacing: .55em; color: var(--gold); text-transform: uppercase; }
.sn-wm .wm-chat::before { content: ""; width: 18px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }

/* ===== Fontes do nome do servidor (todas livres, licença OFL; ficam no app, nada vem de fora) ===== */
@font-face { font-family: "Cinzel"; font-weight: 700; font-display: swap; src: url(/fonts/cinzel-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Orbitron"; font-weight: 700; font-display: swap; src: url(/fonts/orbitron-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Bebas Neue"; font-weight: 400; font-display: swap; src: url(/fonts/bebas-neue-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Oxanium"; font-weight: 700; font-display: swap; src: url(/fonts/oxanium-latin-700-normal.woff2) format("woff2"); }
.server-name.nf-espacada { text-transform: uppercase; font-weight: 600; font-size: 12.5px; letter-spacing: .18em; }
.server-name.nf-cinzel { font-family: "Cinzel", serif; font-weight: 700; font-size: 16px; letter-spacing: .03em; }
.server-name.nf-orbitron { font-family: "Orbitron", sans-serif; font-weight: 700; font-size: 13.5px; letter-spacing: .06em; }
.server-name.nf-bebas { font-family: "Bebas Neue", sans-serif; font-weight: 400; font-size: 21px; letter-spacing: .05em; }
.server-name.nf-oxanium { font-family: "Oxanium", sans-serif; font-weight: 700; font-size: 16px; }
.sn-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Escolha da fonte nas configurações */
.font-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.font-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); text-align: left; cursor: pointer; min-width: 0; }
.font-choice:hover { border-color: var(--line-strong); }
.font-choice.sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.font-choice .fc-sample { padding: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: none; }
.font-choice .fc-label { font-size: 11.5px; color: var(--muted); }
/* Servidor oficial: o brilho sai do cavaleiro e desliza pelas letras só quando o mouse entra */
.sh-row.sk-official .server-icon .sh-knight::after { animation: none; left: -60%; }
.sh-row.sk-official:hover .server-icon .sh-knight::after { animation: skc-hover-shine .55s ease-out 1 forwards; }
@keyframes skc-hover-shine { from { left: -60%; } to { left: 130%; } }
.sh-row.sk-official .sn-text, .sh-row.sk-official .sn-wm > span {
  background: linear-gradient(100deg, currentColor 0 42%, #fff3c9 50%, currentColor 58% 100%); background-size: 260% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.sh-row.sk-official:hover .sn-text, .sh-row.sk-official:hover .sn-wm > span { background-position: 0 0; transition: background-position .75s ease-out .25s; }
:root[data-theme="light"] .sh-row.sk-official .sn-text, :root[data-theme="light"] .sh-row.sk-official .sn-wm > span { background-image: linear-gradient(100deg, currentColor 0 42%, #c9a24a 50%, currentColor 58% 100%); }
.reduce-motion .sh-row.sk-official:hover .server-icon .sh-knight::after { animation: none; }
.reduce-motion .sh-row.sk-official:hover .sn-text, .reduce-motion .sh-row.sk-official:hover .sn-wm > span { transition: none; background-position: 100% 0; }

/* Topo com banner: o banner desce até o fim e o escudo e o nome ficam na linha de baixo dele (sem faixa separada) */
.server-header.has-banner .server-banner { height: 104px; box-shadow: none; }
.server-header.has-banner .sh-row { position: relative; margin-top: -48px; min-height: 0; padding: 0 6px 8px 12px; align-items: flex-end;
  background: linear-gradient(180deg, transparent 0, color-mix(in srgb, var(--panel) 72%, transparent) 46%, var(--panel) 100%); }
.server-header.has-banner .server-icon { margin-top: 0; }
.server-header.has-banner .server-icon .shield { width: 40px; height: 44px; }
.server-header.has-banner .server-name { padding-bottom: 5px; }
.server-header.has-banner .sh-row .icon-btn { margin-bottom: 4px; }

/* ===== Layout do topo do servidor (aba Personalização) ===== */
/* Banner até a metade do ícone: o banner termina e o escudo fica metade em cima dele, com o nome ao lado */
.server-header.has-banner[data-banner="meio"] .server-banner { height: 92px; box-shadow: inset 0 -30px 30px -10px rgba(11, 12, 15, .85); }
.server-header.has-banner:is([data-banner="meio"], [data-banner="nome"], [data-banner="logo"]) .sh-row { margin-top: 0; background: none; padding: 0 6px 6px 12px; align-items: flex-start; }
.server-header.has-banner[data-banner="meio"] .server-icon { margin-top: -24px; }
.server-header.has-banner:is([data-banner="meio"], [data-banner="nome"], [data-banner="logo"]) .server-icon .shield { width: 46px; height: 50px; }
.server-header.has-banner:is([data-banner="meio"], [data-banner="nome"], [data-banner="logo"]) .server-name { padding: 7px 6px 4px; }
.server-header.has-banner:is([data-banner="meio"], [data-banner="nome"], [data-banner="logo"]) .sh-row .icon-btn { margin: 5px 0 0; }
/* Escudo no centro: o escudo no meio e o nome embaixo, centralizado; os botões vão para o canto */
.server-header[data-icon="centro"] .sh-row { position: relative; flex-direction: column; align-items: center; gap: 2px; padding: 8px 8px 8px; }
.server-header.has-banner[data-icon="centro"] .sh-row { padding-top: 0; }
.server-header[data-icon="centro"] .server-name { width: 100%; text-align: center; padding: 2px 4px 0; }
.server-header[data-icon="centro"] .sn-wm { align-items: center; }
.server-header[data-icon="centro"] .sh-row > .icon-btn { position: absolute; top: 4px; right: 6px; margin: 0; }
.server-header[data-icon="centro"] .sh-row > .icon-btn + .icon-btn { right: 34px; }
.server-header[data-icon="centro"] .sh-row > .icon-btn + .icon-btn + .icon-btn { right: 62px; }
.server-header.has-banner[data-icon="centro"][data-banner="cheio"] .sh-row { margin-top: -62px; }
.server-header.has-banner[data-icon="centro"][data-banner="cheio"] .sh-row > .icon-btn { top: 6px; }
.server-header.has-banner[data-icon="centro"][data-banner="meio"] .sh-row > .icon-btn { top: 6px; }
.server-header.has-banner[data-icon="centro"][data-banner="meio"] .server-icon { margin-top: -26px; }
/* Miniatura */
.hp-stage { position: relative; width: 256px; max-width: 100%; margin: 6px 0 14px; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; background: var(--panel); user-select: none; }
.hp-header { border-bottom: 0; pointer-events: auto; }
.hp-header .server-name { cursor: default; }
.hp-header .server-name:hover { background: none; }
.hp-btn { pointer-events: none; opacity: .8; }
.hp-drag { cursor: grab; position: relative; z-index: 2; touch-action: none; }
.hp-drag:active { cursor: grabbing; }
.dragging-icon .hp-drag { opacity: .85; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .5)); transition: none; }
.hp-slots { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .15s; }
.dragging-icon .hp-slots { opacity: 1; }
.hp-slot { position: absolute; width: 46px; height: 50px; border: 2px dashed color-mix(in srgb, var(--gold) 55%, transparent); border-radius: 10px; }
.hp-slot.lado { left: 8px; bottom: 6px; }
.hp-slot.centro { left: calc(50% - 23px); bottom: 26px; }
.hp-slot.direita { right: 8px; bottom: 6px; }
.hp-slot.sup-esq { left: 8px; top: 8px; }
.hp-slot.sup-dir { right: 8px; top: 8px; }
.hp-slots[data-hot="lado"] .hp-slot.lado, .hp-slots[data-hot="centro"] .hp-slot.centro, .hp-slots[data-hot="direita"] .hp-slot.direita, .hp-slots[data-hot="sup-esq"] .hp-slot.sup-esq, .hp-slots[data-hot="sup-dir"] .hp-slot.sup-dir { border-style: solid; border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, transparent); }
.hp-edge { position: absolute; left: 0; right: 0; top: 0; height: 100%; pointer-events: none; }
.hp-edge span { position: absolute; left: 0; right: 0; height: 10px; cursor: ns-resize; pointer-events: auto; touch-action: none; }
.hp-edge span::before { content: ''; position: absolute; left: 32%; right: 32%; top: 4px; height: 2px; border-radius: 2px; background: var(--gold); opacity: .55; transition: opacity .15s, left .15s, right .15s; }
.hp-edge span:hover::before, .hp-edge span:active::before { opacity: 1; left: 8%; right: 8%; }
.hp-header[data-banner='cheio'] ~ .hp-edge span { bottom: 0; }
.hp-header[data-banner='meio'] ~ .hp-edge span { top: 87px; }
.hp-header[data-banner='nome'] ~ .hp-edge span { top: 69px; }
.hp-header[data-banner='logo'] ~ .hp-edge span { top: 51px; }
.hp-stage { width: 264px; }
.hp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.hp-chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--muted); font-size: 12.5px; cursor: pointer; }
.hp-chip:hover { color: var(--ink); }
.hp-chip.sel { border-color: var(--gold); color: var(--ink); box-shadow: 0 0 0 1px var(--gold) inset; }
/* Escudo no centro vale também com o banner até a metade (esta regra vem depois para ganhar da de cima) */
.server-header.has-banner[data-icon="centro"] .sh-row { align-items: center; flex-direction: column; }
.server-header.has-banner[data-icon="centro"][data-banner="meio"] .server-name { padding-top: 2px; }

/* Banner acima do nome: o logo fica todo sobre o banner e o nome logo abaixo dele */
.server-header.has-banner[data-banner="nome"] .server-banner { height: 74px; box-shadow: inset 0 -30px 30px -10px rgba(11, 12, 15, .85); }
.server-header.has-banner[data-banner="nome"] .server-icon { margin-top: -44px; }
.server-header.has-banner[data-icon="centro"][data-banner="nome"] .server-icon { margin-top: -44px; }
.server-header.has-banner[data-icon="centro"][data-banner="nome"] .server-name { padding-top: 2px; }
/* Banner acima do logo: uma faixa no alto, com logo e nome inteiros embaixo */
.server-header.has-banner[data-banner="logo"] .server-banner { height: 56px; box-shadow: none; }
.server-header.has-banner[data-banner="logo"] .server-icon { margin-top: 6px; }
.server-header.has-banner[data-icon="centro"][data-banner="logo"] .server-name { padding-top: 2px; }
/* Logo à direita: o espelho do layout da esquerda */
.server-header[data-icon="direita"] .sh-row { flex-direction: row-reverse; }
.server-header.has-banner[data-icon="direita"] .sh-row { flex-direction: row-reverse; padding-left: 6px; padding-right: 12px; }
.server-header[data-icon="direita"] .server-name { text-align: right; }
.server-header[data-icon="direita"] .sn-wm { align-items: flex-end; }

/* Logo nos cantos de cima: sai da linha do nome e fica sobre o banner (o topo é medido a partir da linha) */
.server-header.has-banner[data-icon^="sup"] .server-icon { position: absolute; z-index: 2; margin-top: 0; }
.server-header.has-banner[data-icon="sup-esq"] .server-icon { left: 12px; }
.server-header.has-banner[data-icon="sup-dir"] .server-icon { right: 12px; }
.server-header.has-banner[data-icon^="sup"][data-banner="cheio"] .server-icon { top: -48px; }
.server-header.has-banner[data-icon^="sup"][data-banner="meio"] .server-icon { top: -84px; }
.server-header.has-banner[data-icon^="sup"][data-banner="nome"] .server-icon { top: -66px; }
.server-header.has-banner[data-icon^="sup"][data-banner="logo"] .server-icon { top: -53px; }
.server-header[data-icon="sup-dir"] .srv-official.big { right: auto; left: 8px; }
.server-header[data-icon="sup-dir"]:not(.has-banner) .sh-row { flex-direction: row-reverse; }

/* Nome preenchendo a barra: o tamanho vem do fitServerName */
.server-name.name-fill { display: block; overflow: hidden; white-space: nowrap; line-height: 1.2; -webkit-line-clamp: none; }
.server-name.name-fill .sn-text { display: inline-block; overflow: visible; text-overflow: clip; vertical-align: bottom; }

/* Logo do servidor em branco; o dourado fica para a interface */
.server-icon .shield.active .sh-knight { background: linear-gradient(180deg, #fff, #eceef1 60%, #bcc1c9); }
:root[data-theme="light"] .server-header:not(.has-banner) .server-icon .shield.active .sh-knight { background: var(--ink); }

/* Corte dourado: sempre embaixo do topo do servidor, e embaixo da barra rápida quando ela está aberta */
.server-header, .admin-bar { --cut: linear-gradient(90deg, transparent, color-mix(in srgb, var(--srv, var(--gold)) 65%, transparent) 18%, color-mix(in srgb, var(--srv, var(--gold)) 65%, transparent) 82%, transparent); }
.server-header { position: relative; border-bottom-color: transparent; }
.server-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; z-index: 3; height: 1px; background: var(--cut); pointer-events: none; }
.admin-bar::before { display: none; }
.admin-bar:not(.shut)::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--cut); pointer-events: none; }

/* Sala em que você está: dourado mais discreto */
.voice-room.mine { --neon: color-mix(in srgb, var(--srv, #ffd56a) 55%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--srv, #c9a24a) 7%, transparent), color-mix(in srgb, var(--srv, #c9a24a) 2%, transparent) 70%), var(--raised);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--srv, #c9a24a) 10%, transparent); }
.voice-room.mine::before { border-left-width: 2px; border-top-width: 2px; filter: drop-shadow(0 0 2px var(--neon)); }

/* Régua do tamanho do nome */
.hp-size { display: flex; align-items: center; gap: 10px; max-width: 320px; margin-bottom: 8px; }
.hp-size input { flex: 1; min-width: 0; padding: 0; accent-color: var(--gold); }

/* Rolagem dentro da categoria */
.cat-body { max-height: 40vh; overflow-y: auto; overflow-x: hidden; overscroll-behavior: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.channel-list.by-type { display: flex; flex-direction: column; overflow: hidden; }
.channel-list.by-type > * { flex: none; }
.channel-list.by-type > .cat-body { flex: 0 1 auto; min-height: 48px; max-height: none; }

/* Aviso de alfa no menu superior */
.tb-alfa { align-self: center; padding: 1px 6px; border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); border-radius: 4px; color: var(--gold); font-family: var(--display); font-size: 9px; font-weight: 700; letter-spacing: .16em; line-height: 1.5; cursor: default; }

/* Microfone + fone: com o som desligado os dois botões se fundem num só, metade cada um */
.vbtn-pair { grid-column: span 2; display: flex; gap: 6px; }
.vbtn-pair > .vbtn { flex: 1 1 0; min-width: 0; }
.vbtn-pair.fused { gap: 0; animation: vb-fuse .32s cubic-bezier(.3, .7, .2, 1); }
.vbtn-pair.fused > .vbtn { background: color-mix(in srgb, var(--danger) 72%, var(--raised)); color: #fff; border-color: transparent; }
.vbtn-pair.fused > .vbtn:first-child { border-radius: 11px 0 0 11px; animation: vb-fuse-l .32s cubic-bezier(.3, .7, .2, 1); }
.vbtn-pair.fused > .vbtn:last-child { border-radius: 0 11px 11px 0; position: relative; animation: vb-fuse-r .32s cubic-bezier(.3, .7, .2, 1); }
.vbtn-pair.fused > .vbtn:last-child::before { content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 1px; background: rgba(255, 255, 255, .45); }
.vbtn-pair.unfusing { animation: vb-unfuse .28s ease-out; }
@keyframes vb-fuse { from { gap: 6px; } to { gap: 0; } }
@keyframes vb-fuse-l { from { border-radius: 11px; } to { border-radius: 11px 0 0 11px; } }
@keyframes vb-fuse-r { from { border-radius: 11px; } to { border-radius: 0 11px 11px 0; } }
@keyframes vb-unfuse { from { gap: 0; } to { gap: 6px; } }
.reduce-motion .vbtn-pair, .reduce-motion .vbtn-pair > .vbtn { animation: none !important; }
/* Câmera ligada na lista da sala */
.voice-user .vs-cam { color: var(--gold); }

/* ===== Salas: tipo sempre visível, emoji, separador; modo editor ===== */
.channel .glyph.type-text, .channel .glyph.type-voice { width: 14px; opacity: .7; }
.channel .ch-emoji { flex: none; font-size: 14px; line-height: 1; }
.channel .ch-sep { flex: none; color: var(--subtle); opacity: .8; font-weight: 600; margin: 0 -1px; }
.channel .ch-edit { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 6px; color: var(--muted); cursor: pointer; }
.channel .ch-edit:hover { background: var(--hover); color: var(--ink); }
.channel-list.editing .channel .ch-name { cursor: text; border-bottom: 1px dashed transparent; }
.channel-list.editing .channel .ch-name:hover { border-bottom-color: var(--subtle); }
.ch-rename { flex: 1; min-width: 0; height: 24px; padding: 2px 6px; font: inherit; border-radius: 6px; border: 1px solid var(--gold); background: var(--bg); color: var(--ink); }
.editor-bar { display: grid; gap: 6px; margin: 4px 4px 10px; padding: 10px; border-radius: 10px; border: 1px dashed color-mix(in srgb, var(--gold) 55%, transparent); background: color-mix(in srgb, var(--gold) 6%, var(--panel)); direction: ltr; }
.editor-bar .eb-head { display: flex; align-items: center; justify-content: space-between; }
.editor-bar .eb-title { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.editor-bar .eb-done { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--gold); background: var(--gold); color: #0a0a0c; font-size: 12px; font-weight: 600; cursor: pointer; }
.editor-bar .eb-hint { margin: 0; font-size: 11.5px; color: var(--muted); }
.editor-bar select { width: 100%; height: auto; min-height: 30px; padding: 5px 8px; line-height: 1.3; font-size: 12.5px; }
.set-sub { margin: 18px 0 6px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
/* Todas as salas à esquerda (com a interface invertida, à direita) */
.salas .vs-left .voice-room > .channel { flex-direction: row; }
.salas .vs-left .voice-room > .channel .ch-name { text-align: left; }
.salas .vs-left .voice-room > .channel .vc-timer { margin-right: 0; margin-left: auto; }
.salas .vs-left .voice-room .voice-user { flex-direction: row; margin: 0 6px 2px 26px; }
.salas .vs-left .voice-room .voice-user .name { text-align: left; }
.salas .vs-left .voice-room .room-status { justify-content: flex-start; text-align: left; }
.app.mirrored .salas .vs-left .voice-room > .channel { flex-direction: row-reverse; }
.app.mirrored .salas .vs-left .voice-room > .channel .ch-name { text-align: right; }
.app.mirrored .salas .vs-left .voice-room > .channel .vc-timer { margin-left: 0; margin-right: auto; }
.app.mirrored .salas .vs-left .voice-room .voice-user { flex-direction: row-reverse; margin: 0 26px 2px 6px; }
.app.mirrored .salas .vs-left .voice-room .voice-user .name { text-align: right; }
.app.mirrored .salas .vs-left .voice-room .room-status { justify-content: flex-end; text-align: right; }
/* emoji, separador e nome bem juntinhos */
.channel .ch-emoji { margin-right: -4px; }
.channel .ch-sep { margin: 0 -4px 0 -1px; }
/* Licenças de terceiros */
.licenses-modal { width: min(760px, calc(92vw / var(--uiz, 1))); max-width: none; }
.licenses-modal .modal-inner { width: 100%; }
.licenses { margin: 0; max-height: calc(100vh / var(--uiz, 1) - 220px); overflow: auto; white-space: pre-wrap; word-break: break-word;
  font: 11.5px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }

/* Todas as salas à direita (com a interface invertida, à esquerda) */
.salas .vs-right .channel { flex-direction: row-reverse; }
.salas .vs-right .channel .ch-name { text-align: right; }
.salas .vs-right .channel.active { box-shadow: inset -2px 0 0 var(--srv, var(--gold)); }
.salas .vs-right .category, .salas .vs-right .cat-toggle { flex-direction: row-reverse; }
.salas .vs-right .category { margin-left: 0; margin-right: 8px; padding-right: 0; padding-left: 6px; }
.app.mirrored .salas .vs-right .channel { flex-direction: row; }
.app.mirrored .salas .vs-right .channel .ch-name { text-align: left; }
.app.mirrored .salas .vs-right .channel.active { box-shadow: inset 2px 0 0 var(--srv, var(--gold)); }
.app.mirrored .salas .vs-right .category, .app.mirrored .salas .vs-right .cat-toggle { flex-direction: row; }
.app.mirrored .salas .vs-right .category { margin-left: 8px; margin-right: 0; padding-left: 0; padding-right: 6px; }

/* Ícone do tipo da sala no cabeçalho do chat */
.channel-title { display: inline-flex; align-items: center; gap: 7px; }
.ct-glyph { display: inline-grid; place-items: center; color: var(--muted); }

/* Botões do topo do servidor */
.sh-btns { display: flex; align-items: center; gap: 4px; flex: none; }
.server-header[data-icon="centro"] .sh-btns { position: absolute; top: 4px; right: 6px; }
.server-header.has-banner[data-icon="centro"] .sh-btns { top: 6px; }
.server-header[data-icon="centro"] .sh-btns .icon-btn { margin: 0; }

/* Barra rápida do administrador: faixa logo abaixo do nome, com um corte dourado separando */
.admin-bar { position: relative; display: flex; align-items: center; justify-content: flex-end; gap: 4px; padding: 4px 6px; background: var(--panel); }
.admin-bar.hidden { display: none; }
.admin-bar::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--srv, var(--gold)) 65%, transparent) 18%, color-mix(in srgb, var(--srv, var(--gold)) 65%, transparent) 82%, transparent); }
.admin-bar.shut { padding: 0 6px; background: none; }
.admin-bar.shut::before { display: none; }
.ab-list { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 1px; }
.ab-tools { flex: none; display: flex; align-items: center; }
.admin-bar .ab-btn { width: 24px; height: 24px; min-width: 0; min-height: 0; padding: 0; display: inline-grid; place-items: center; color: var(--muted); }
.admin-bar .ab-btn:hover { color: var(--ink); }
.admin-bar .ab-btn.on { color: var(--srv, var(--gold)); background: var(--raised); }
.admin-bar .ab-tool { width: 20px; height: 20px; min-width: 0; min-height: 0; padding: 0; display: inline-grid; place-items: center; color: var(--subtle); }
.admin-bar .ab-tool:hover { color: var(--ink); }
.app.mirrored .admin-bar { flex-direction: row-reverse; }
.app.mirrored .ab-list { justify-content: flex-end; }
.ab-edit { display: grid; gap: 2px; min-width: 280px; }
.ab-edit-row { display: flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: 8px; }
.ab-edit-row:hover { background: var(--hover); }
.ab-edit-row label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; color: var(--ink); font-size: 14px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.ab-edit-row .icon-btn:disabled { opacity: .3; cursor: default; }
/* Sem banner, o selo do servidor oficial cairia em cima dos botões do topo */
.server-header:not(.has-banner) .srv-official.big { display: none; }

/* ===== Navegador: apresentação à esquerda, cartão de login à direita, cavaleiro discreto no canto ===== */
.web-hero, .web-knight { display: none; }
body.web .login { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, 400px); align-items: center;
  gap: 7vw; padding: 6vh 9vw; background: #000; }
body.web .login.hidden { display: none; }
body.web .login-card { margin: 0; background: rgba(11, 12, 15, .72); border: 1px solid var(--line); border-radius: 16px; padding: 26px;
  backdrop-filter: blur(6px); position: relative; z-index: 1; }
body.web .login-card .brand { margin-bottom: 8px; }
body.web .login-card .login-logo { display: none; }
body.web .login-card .wordmark { transform: scale(.72); transform-origin: center top; margin-bottom: -18px; }
body.web .web-hero { display: flex; flex-direction: column; gap: 10px; max-width: 620px; position: relative; z-index: 1; }
.wh-word { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(22px, 3.4vw, 44px); letter-spacing: .55em;
  color: #d9d9d9; opacity: 0; animation: wh-rise .9s ease .15s forwards; }
.wh-tag { margin: 0; font-size: clamp(10px, .9vw, 12px); letter-spacing: .5em; color: #6f6f6f; opacity: 0; animation: wh-rise .9s ease .3s forwards; }
.wh-title { margin: 34px 0 0; font-family: var(--display); font-weight: 600; font-size: clamp(26px, 2.6vw, 36px); letter-spacing: -.02em;
  color: var(--ink); opacity: 0; animation: wh-rise .9s ease .45s forwards; }
.wh-lead { margin: 0; color: var(--muted); font-size: 15.5px; max-width: 520px; opacity: 0; animation: wh-rise .9s ease .55s forwards; }
.wh-list { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px;
  opacity: 0; animation: wh-rise .9s ease .7s forwards; }
.wh-list li { display: flex; flex-direction: column; gap: 3px; padding-left: 14px; position: relative; }
.wh-list li::before { content: ''; position: absolute; left: 0; top: 7px; width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 8px rgba(184, 154, 78, .6); }
.wh-list b { font-size: 14px; font-weight: 600; }
.wh-list span { font-size: 13px; color: var(--muted); }
.wh-note { margin: 22px 0 0; font-size: 12px; letter-spacing: .06em; color: var(--subtle); opacity: 0; animation: wh-rise .9s ease .85s forwards; }
/* Cavaleiro: quase apagado, com uma acendida leve de vez em quando. */
body.web .web-knight { display: block; position: fixed; right: 4vw; bottom: 4vh; width: clamp(84px, 11vw, 160px); height: auto; z-index: 0;
  opacity: .07; animation: knight-breathe 7s ease-in-out infinite; pointer-events: none; user-select: none; }
@keyframes knight-breathe { 0%, 100% { opacity: .07; } 50% { opacity: .12; } }
@keyframes wh-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) {
  body.web .login { grid-template-columns: 1fr; gap: 28px; padding: 32px 20px; align-content: start; overflow-y: auto; }
  .wh-list { grid-template-columns: 1fr; }
  .wh-title { margin-top: 18px; }
}
@media (prefers-reduced-motion: reduce) { .wh-word, .wh-tag, .wh-title, .wh-lead, .wh-list, .wh-note { animation: none; opacity: 1; }
  body.web .web-knight { animation: none; } }

/* Selo do servidor oficial: bolinha com o cavaleiro cintilando; o nome abre ao passar o mouse */
.srv-official { gap: 0; padding: 4px; cursor: default; transition: padding .22s ease, gap .22s ease; }
.srv-official > span:last-child { max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap; transition: max-width .22s ease, opacity .18s ease; }
.srv-official:hover { gap: 5px; padding: 3px 8px 3px 5px; }
.srv-official:hover > span:last-child { max-width: 70px; opacity: 1; }
.reduce-motion .srv-official, .reduce-motion .srv-official > span:last-child { transition: none; }
/* Telemetria: o que o app enviou e a saúde das calls (só o dono) */
.tele-modal { width: min(1100px, calc(94vw / var(--uiz, 1))); max-width: none; }
.tele-modal .modal-inner { width: 100%; }
.tele-wrap { overflow: auto; max-height: calc(100vh / var(--uiz, 1) - 300px); border: 1px solid var(--line); border-radius: 10px; }
.tele-table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tele-table th { position: sticky; top: 0; background: var(--panel); color: var(--muted); font-weight: 600; text-align: left; }
.tele-table th, .tele-table td { padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tele-table tr.bad td { color: var(--danger); }
.tele-modal h3 { margin: 6px 0 0; font-size: 14px; }

/* Avisos dentro do app (mensagem privada, menção, amizade): cartões no canto de baixo, à direita. */
.notice-stack { position: fixed; right: 16px; bottom: 16px; z-index: 120; display: flex; flex-direction: column; gap: 8px; width: 340px; max-width: calc(100vw - 32px); pointer-events: none; }
.notice-stack .card { pointer-events: auto; position: relative; display: grid; grid-template-columns: 38px 1fr; gap: 10px; padding: 11px 32px 11px 11px; background: var(--raised);
  border: 1px solid var(--line-strong); border-left: 3px solid var(--gold); border-radius: var(--radius); box-shadow: 0 12px 30px rgba(0, 0, 0, .5); cursor: pointer; animation: notice-in .18s ease-out; }
.notice-stack .card.k-friend { border-left-color: var(--ok); }
.notice-stack .card.k-mention { border-left-color: var(--storm); }
.notice-stack .card:hover { background: var(--hover); }
@keyframes notice-in { from { opacity: 0; transform: translateX(16px); } }
.notice-stack .av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 16px; background: var(--gold-soft); color: var(--gold); }
.notice-stack .k-friend .av { background: rgba(92, 201, 143, .15); color: var(--ok); }
.notice-stack .k-mention .av { background: var(--storm-soft); color: var(--storm); }
.notice-stack .txt { min-width: 0; }
.notice-stack .kind { font-size: 11px; color: var(--muted); }
.notice-stack .title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notice-stack .body { color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.notice-stack .acts { display: flex; gap: 6px; margin-top: 8px; }
.notice-stack .acts button { font-size: 13px; padding: 5px 12px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); cursor: pointer; }
.notice-stack .acts button:first-child { background: var(--gold); border-color: var(--gold); color: #141109; font-weight: 600; }
.notice-stack .k-friend .acts button:first-child { background: var(--ok); border-color: var(--ok); color: #08130d; }
.notice-stack .x { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 16px; cursor: pointer; }
.notice-stack .x:hover { background: var(--hover); color: var(--ink); }
.alpha-link { display: flex; flex-direction: column; gap: 8px; }
.alpha-link .code { white-space: normal; overflow-wrap: anywhere; max-width: none; padding: 8px 10px; }
.vu-slot { flex: none; width: 19px; display: inline-grid; place-items: center; }
.screen-label { opacity: 0; transition: opacity .15s; }
.screen:hover .screen-label, .screen:focus-within .screen-label { opacity: 1; }
.scope-nums { display: flex; gap: 7px; padding: 5px 5px 0 0; }
.scope-item { position: relative; flex: none; display: flex; }
.scope-add { position: absolute; top: -5px; right: -5px; z-index: 1; display: grid; place-items: center; width: 14px; height: 14px; padding: 0; border: 0; border-radius: 50%; background: var(--line-strong); color: var(--ink); cursor: pointer; opacity: .85; }
.scope-add:hover, .scope-add:focus-visible { background: #e5484d; color: #fff; opacity: 1; }
.scope-car { display: flex; align-items: center; gap: 2px; min-width: 0; }
.scope-nums.carousel { max-width: 153px; overflow-x: auto; scrollbar-width: none; cursor: grab; }
.scope-nums.carousel::-webkit-scrollbar { display: none; }
.scope-slide { width: 18px; height: 22px; }
.scope-num { width: 30px; height: 26px; padding: 0; border: 1px solid var(--line-strong); border-radius: 6px; background: transparent; color: var(--ink); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.scope-num:hover { border-color: #e5484d; }
.scope-num.sel { background: #e5484d; border-color: #e5484d; color: #fff; }
.screen.in-focus { display: grid; place-items: center; background: transparent; border-style: dashed; cursor: default; }
.tile-num { position: absolute; left: 6px; top: 6px; z-index: 3; min-width: 20px; padding: 0 5px; border-radius: 5px; background: rgba(2, 2, 3, .75); color: var(--ink); font-size: 12px; font-weight: 700; text-align: center; }
@keyframes screen-alert { 0%, 100% { box-shadow: 0 0 0 2px #e5484d, inset 0 0 0 999px rgba(229, 72, 77, .32); } 50% { box-shadow: 0 0 0 2px rgba(229, 72, 77, .35), inset 0 0 0 999px rgba(229, 72, 77, 0); } }
.screen.alerting, .scope-num.alerting { animation: screen-alert .7s ease-in-out infinite; border-color: #e5484d; }
@media (prefers-reduced-motion: reduce) { .screen.alerting, .scope-num.alerting { animation: none; box-shadow: 0 0 0 2px #e5484d, inset 0 0 0 999px rgba(229, 72, 77, .32); } }
.reduce-motion .screen.alerting, .reduce-motion .scope-num.alerting { animation: none; box-shadow: 0 0 0 2px #e5484d, inset 0 0 0 999px rgba(229, 72, 77, .32); }
/* Iniciais: a fonte deixa as maiúsculas um pouco acima do centro; o ajuste é proporcional ao tamanho da letra. */
.avatar:not(.has-img) { box-sizing: border-box; padding-top: .08em; }
.cat-toggle { min-height: 24px; }
.me-status { min-height: 24px; }
.room-style { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(0, 1.4fr) minmax(0, 1.2fr); gap: 8px; align-items: center; font-size: 13.5px; }
.messages[data-font="cinzel"] { font-family: "Cinzel", serif; }
.messages[data-font="oxanium"] { font-family: "Oxanium", sans-serif; }
.messages[data-font="orbitron"] { font-family: "Orbitron", sans-serif; }
.messages[data-font="bebas"] { font-family: "Bebas Neue", sans-serif; letter-spacing: .02em; }
.messages[data-font="serif"] { font-family: Georgia, "Times New Roman", serif; }
.messages[data-font="mono"] { font-family: Consolas, "Cascadia Mono", monospace; }
.messages[data-space="compacto"] .msg { margin-top: 2px; line-height: 1.3; }
.messages[data-space="amplo"] .msg { margin-top: 18px; line-height: 1.85; }
.verify-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 10px 16px 0; padding: 10px 12px; border: 1px solid rgba(184, 154, 78, .5); border-radius: 10px; color: var(--ink); font-size: 13.5px; }

/* Mosaico: telas soltas no palco, com bordas invisíveis para redimensionar */
.mosaic { position: relative; flex: 1; min-height: 240px; }
.mosaic > .screen.big { position: absolute; flex: none; border-radius: 6px; min-height: 0; min-width: 0; aspect-ratio: auto; cursor: move; touch-action: none; user-select: none;
  transition: left .18s ease, top .18s ease, width .18s ease, height .18s ease; }
.mosaic > .screen.big:hover, .mosaic > .screen.big.moving { border-color: #e5484d; }
.mosaic.mz-live > .screen.big { transition: none; }
.mosaic .unfocus-btn { top: 10px; left: 10px; z-index: 5; }
.mz { position: absolute; z-index: 4; }
.mz-n, .mz-s { left: 16px; right: 16px; height: 8px; cursor: ns-resize; }
.mz-e, .mz-w { top: 16px; bottom: 16px; width: 8px; cursor: ew-resize; }
.mz-n { top: 0; } .mz-s { bottom: 0; } .mz-e { right: 0; } .mz-w { left: 0; }
.mz-ne, .mz-nw, .mz-se, .mz-sw { width: 16px; height: 16px; }
.mosaic > .screen .fs, .mosaic > .screen .stats-btn, .mosaic > .screen .pop-btn, .mosaic > .screen .unwatch-btn { bottom: 18px; }
.mz-ne { top: 0; right: 0; cursor: nesw-resize; } .mz-sw { bottom: 0; left: 0; cursor: nesw-resize; }
.mz-nw { top: 0; left: 0; cursor: nwse-resize; } .mz-se { bottom: 0; right: 0; cursor: nwse-resize; }
.mz-se::after { content: ''; position: absolute; right: 3px; bottom: 3px; width: 8px; height: 8px; border-right: 2px solid #e5484d; border-bottom: 2px solid #e5484d; opacity: 0; transition: opacity .15s; }
.mosaic > .screen:hover .mz-se::after { opacity: 1; }
/* Carrossel das telas e das pessoas */
.carousel { position: relative; flex: none; min-width: 0; max-width: 100%; }
.carousel > .people { flex-wrap: nowrap; overflow-x: auto; scroll-behavior: smooth; scroll-snap-type: x proximity; scrollbar-width: none; }
.carousel > .people::-webkit-scrollbar { display: none; }
.carousel > .people > * { flex: none; scroll-snap-align: start; animation: car-in .22s ease both; }
.car-btn { position: absolute; top: 10px; z-index: 6; width: 28px; height: 28px; background: rgba(2, 2, 3, .82); color: var(--ink); border-radius: 50%; }
.car-btn:hover { color: #e5484d; }
.car-prev { left: 2px; } .car-next { right: 2px; }
@keyframes car-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.reduce-motion .carousel > * > *, .reduce-motion .mosaic > .screen.big { animation: none; transition: none; }
.reduce-motion .carousel > .people { scroll-behavior: auto; }
@media (prefers-reduced-motion: reduce) { .carousel > * > *, .mosaic > .screen.big { animation: none; transition: none; } .carousel > .people { scroll-behavior: auto; } }
/* Doca: telas e pessoas embaixo; minimiza num cantinho para sobrar palco */
.stage { position: relative; }
.tela-dock { position: relative; display: flex; flex-direction: column; gap: 8px; flex: none; min-width: 0; }
.tela-bar { display: flex; justify-content: flex-end; align-items: center; gap: 6px; min-height: 26px; }
.tela-btn { display: inline-flex; align-items: center; gap: 5px; background: none; border: 1px solid var(--line-strong); border-radius: 8px; padding: 3px 10px; min-height: 26px; color: var(--muted); font-size: 12.5px; }
.tela-btn:hover { color: var(--ink); border-color: #e5484d; }
.tela-min { width: 26px; height: 26px; }
.tela-mini { position: absolute; left: 22px; bottom: 22px; z-index: 20; display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; min-height: 28px; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(2, 2, 3, .85); color: var(--ink); font-size: 12.5px; font-weight: 600; }
.tela-mini:hover { border-color: #e5484d; }
.tela-mini.alerting { border-color: #e5484d; animation: screen-alert .7s ease-in-out infinite; }
/* Volumes no cartão da pessoa: azul é a voz, amarelo é a transmissão */
.person-vol { display: flex; align-items: center; gap: 5px; width: 100%; }
.person-vol svg { flex: none; }
.person-vol.is-voice svg { color: #4c8dff; }
.person-vol.is-stream svg { color: var(--gold); }
.vol.is-voice, .call-tile .vol.is-voice { accent-color: #4c8dff; }
.vol.is-stream { accent-color: var(--gold); }
/* Telas dentro do card da pessoa: foto e nome sobem, telas acima dos volumes */
.person.has-screens { width: auto; min-width: 168px; padding-top: 8px; gap: 5px; }
.person.has-screens .avatar.big, .person.has-screens .cam-face { width: 44px; height: 44px; font-size: 16px; }
.person.alerting { border-color: #e5484d; }
.person-screens { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; }
.person-screens.open { align-items: flex-start; }
.person-screens .thumbs { height: 76px; gap: 6px; overflow-x: auto; }
.person-screens .thumbs .screen { width: 132px; }
.ps-arrow { flex: none; width: 24px; height: 24px; }
/* Câmera com + no card, e a câmera como peça da lousa */
.person { position: relative; }
.cam-add { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; }
.cam-add:hover { color: #e5484d; }
.cam-add.on { color: #e5484d; }
/* Tela grande: comandos no alto, na cor do servidor, e só com o mouse em cima. Número da tela no alto à
   esquerda, nome embaixo (abre os comandos da lousa). Zoom pela rodinha. */
.screen.big { --ctl: var(--srv, var(--gold)); }
.screen.big .fs { top: 10px; bottom: auto; right: 10px; }
.screen.big .stats-btn { top: 10px; bottom: auto; right: 52px; }
.screen.big .pop-btn { top: 10px; bottom: auto; right: 94px; }
.screen.big .unwatch-btn { top: 10px; bottom: auto; right: 136px; }
.screen.big:not(:has(.pop-btn)) .unwatch-btn { right: 94px; }
.screen.big :is(.fs, .stats-btn, .pop-btn, .unwatch-btn, .unfocus-btn) { color: var(--ctl); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ctl) 30%, transparent); }
.screen.big :is(.fs, .stats-btn, .pop-btn, .unwatch-btn, .unfocus-btn):hover { color: var(--ctl); box-shadow: inset 0 0 0 1px var(--ctl); }
.screen.big .stats-btn.on { box-shadow: inset 0 0 0 1px var(--ctl); background: color-mix(in srgb, var(--ctl) 22%, rgba(2, 2, 3, .7)); }
.screen.big :is(.fs, .stats-btn, .pop-btn, .unwatch-btn, .screen-num, .screen-label) { opacity: 0; transition: opacity .15s; }
.screen.big:hover :is(.fs, .stats-btn, .pop-btn, .unwatch-btn, .screen-num, .screen-label),
.screen.big:focus-within :is(.fs, .stats-btn, .pop-btn, .unwatch-btn, .screen-num, .screen-label) { opacity: 1; }
.screen-num { position: absolute; top: 10px; left: 10px; z-index: 5; display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px;
  border-radius: 8px; background: rgba(2, 2, 3, .72); color: var(--ctl); font-weight: 700; font-size: 13.5px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ctl) 30%, transparent); pointer-events: none; }
.mosaic .unfocus-btn { left: 46px; }
button.screen-label { z-index: 5; border: 0; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
button.screen-label svg { color: var(--ctl); }
button.screen-label:hover { color: var(--ctl); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ctl) 45%, transparent); }
.mosaic > .screen.big.zoomed { cursor: grab; }
.mosaic > .screen.big.panning { cursor: grabbing; }
.screen.big video { transition: none; }
/* Bonequinhos (mostrar os usuários) no canto direito, na cor do servidor; somem sem o mouse no palco */
.tela-mini { left: auto; right: 22px; color: var(--srv, var(--gold)); border-color: color-mix(in srgb, var(--srv, var(--gold)) 40%, var(--line-strong)); transition: opacity .15s; }
.tela-mini:hover { border-color: var(--srv, var(--gold)); }
.stage:not(:hover) .tela-mini:not(.alerting):not(:focus-visible) { opacity: 0; }
/* Alfa: resolução e quadros por tela no seletor */
.alfa-cfg { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.audio-from { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 8px; }
.audio-from:empty { display: none; }
.audio-from select { width: 100%; }
.alfa-row { display: grid; grid-template-columns: auto minmax(70px, 1fr) auto auto; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; }
.alfa-row select { min-width: 0; }
.alfa-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alfa-note { grid-column: 2 / -1; }
.alfa-row .pick-n { position: static; }

/* ===== Colunas que mudam de lugar (dobrinha no canto) e barra de conversas embaixo ===== */
/* As larguras viram variáveis: assim a mesma regra serve para qualquer ordem das colunas.
   O #app ganha das regras antigas de .app (mais fracas), que ficam só como histórico. */
#app { --ws: 0px; --wr: 284px; grid-template-columns: minmax(0, 1fr) var(--ws) var(--wr);
  grid-template-rows: 60px minmax(0, 1fr) auto; grid-template-areas: "top top top" "chat side salas" "bar bar bar"; }
#app.members-open { --ws: 240px; }
#app.members-open.no-server { --ws: 0px; }
#app.members-open.dock-open { --ws: 300px; }
/* Membros do outro lado do chat: a coluna deles vai para a ponta (com o espelho, para a outra ponta) */
#app.members-far { grid-template-columns: var(--ws) minmax(0, 1fr) var(--wr); grid-template-areas: "top top top" "side chat salas" "bar bar bar"; }
@media (max-width: 1100px) {
  #app { --wr: 256px; }
  #app.members-open { --ws: 216px; }
  #app.members-open.no-server { --ws: 0px; }
  #app.members-open.dock-open { --ws: 270px; }
}
@media (max-width: 900px) {
  #app, #app.members-open, #app.members-open.dock-open { --ws: 0px; --wr: 220px; }
  /* Por cima do chat: abre para o lado de dentro, seja qual for a ponta */
  #app.members-far:not(.mirrored).members-open .members-col, #app.mirrored:not(.members-far).members-open .members-col { right: auto; left: 0; box-shadow: 12px 0 30px rgba(0, 0, 0, .45); }
}
@media (max-width: 640px) { #app, #app.members-open, #app.members-open.dock-open { --wr: 180px; } }

/* Borda sempre do lado do chat */
.members-col { position: relative; }
#app.members-far:not(.mirrored) .members-col, #app.mirrored:not(.members-far) .members-col { border-left: 0; border-right: 1px solid var(--line); }
#app.members-far.mirrored .members-col { border-right: 0; border-left: 1px solid var(--line); }
#app:not(.members-open) .members-col, #app.no-server .members-col { border-color: transparent; }
/* Fechada, a coluna (que ainda tem uns pixels de enchimento) não pode pegar clique por cima das salas */
#app:not(.members-open) .members-col, #app.no-server .members-col { pointer-events: none; padding: 0; border-width: 0; }
#app:not(.members-open) .members-col > .fold, #app.no-server .members-col > .fold { display: none; }

/* A dobrinha: canto de folha dobrada, no alto da coluna, do lado do chat. Arrastar muda de lado; clicar também. */
.fold { position: absolute; top: 0; left: 0; z-index: 6; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 0 0 5px 0;
  background: linear-gradient(135deg, var(--chat) 0 50%, var(--line-strong) 50% 100%); box-shadow: 1px 1px 3px rgba(0, 0, 0, .35);
  opacity: .5; cursor: grab; touch-action: none; transition: opacity .15s, width .15s, height .15s; }
.members-col > .fold, .members-col > .col-grip { min-width: 0; } /* sem isto a alça herdava 240 px e cobria a conversa ao lado */
.fold:hover, .fold:focus-visible { opacity: 1; width: 26px; height: 26px; background: linear-gradient(135deg, var(--chat) 0 50%, var(--gold) 50% 100%); }
.fold.right { left: auto; right: 0; border-radius: 0 0 0 5px; background: linear-gradient(225deg, var(--chat) 0 50%, var(--line-strong) 50% 100%); box-shadow: -1px 1px 3px rgba(0, 0, 0, .35); }
.fold.right:hover, .fold.right:focus-visible { background: linear-gradient(225deg, var(--chat) 0 50%, var(--gold) 50% 100%); }
#app.lay-snap { transition: none; }
body.lay-dragging, body.lay-dragging * { cursor: grabbing !important; user-select: none; }
/* Enquanto arrasta: os lugares possíveis aparecem e o de baixo do mouse acende */
.lay-drop { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.lay-zone { position: fixed; border: 2px dashed color-mix(in srgb, var(--gold) 55%, transparent); border-radius: 12px;
  background: color-mix(in srgb, var(--gold) 6%, transparent); transition: background .12s, border-color .12s; }
.lay-zone.on { border-style: solid; border-color: var(--gold); background: color-mix(in srgb, var(--gold) 18%, transparent); }
.lay-zone span { position: absolute; top: 50%; left: 0; right: 0; text-align: center; color: var(--gold); font-weight: 700; font-size: 13px; }

/* O espelho antigo virou a dobrinha: a abinha do meio sai */
.salas .mirror-btn { display: none; }

/* Barra de conversas: embaixo, uma aba por conversa; clicar abre a janelinha em cima dela */
.dm-bar { grid-area: bar; position: relative; z-index: 30; display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px;
  background: var(--panel); border-top: 1px solid var(--line); min-width: 0; }
.dm-bar.empty { display: none; }
.dm-bar.target { box-shadow: inset 0 0 0 2px var(--gold); background: color-mix(in srgb, var(--gold) 10%, var(--panel)); }
.dm-bar.show { display: flex; }
.dm-bar.show.empty::after { content: "Solte aqui"; color: var(--gold); font-size: 13px; font-weight: 700; margin: auto; }
.db-tabs { display: flex; align-items: center; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.db-chip { display: inline-flex; align-items: center; gap: 7px; flex: none; max-width: 190px; height: 30px; padding: 0 4px 0 4px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--chat); color: var(--ink); font-size: 13px; cursor: pointer; position: relative; }
.db-chip:hover { border-color: var(--line-strong); }
.db-chip.open { border-color: color-mix(in srgb, var(--gold) 60%, transparent); background: color-mix(in srgb, var(--gold) 10%, var(--chat)); }
.db-chip .avatar { width: 22px; height: 22px; flex: none; font-size: 10px; }
.db-chip .db-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-chip .badge { position: static; margin-left: 2px; }
.db-chip .db-x { width: 20px; height: 20px; padding: 0; display: grid; place-items: center; opacity: 0; }
.db-chip:hover .db-x, .db-chip.open .db-x { opacity: .7; }
.db-chip .db-x:hover { opacity: 1; }
.db-chip.unread { border-color: var(--gold); }
/* A janelinha: presa em cima da aba, ou solta onde a pessoa largar */
.dm-pop { position: absolute; bottom: calc(100% + 6px); width: 320px; height: 420px; max-height: calc(100vh - 140px); display: flex; flex-direction: column;
  background: var(--chat); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); overflow: hidden; z-index: 31; }
.dm-pop.floating { position: fixed; bottom: auto; z-index: 60; }
.dm-pop.dragging { opacity: .92; box-shadow: 0 22px 50px rgba(0, 0, 0, .6); }
.dm-pop .dd-head { cursor: grab; touch-action: none; user-select: none; }
.dm-pop .dd-head .dd-actions { cursor: default; }
.dm-dock .dd-head { cursor: grab; touch-action: none; }
:root[data-theme="light"] .dm-pop { box-shadow: 0 16px 40px rgba(20, 24, 32, .18); }

/* Convite do alfa: no meio da barra de título (no navegador, no meio da barra do topo) */
.titlebar { position: relative; }
.titlebar > .alpha-btn { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 3px 12px; font-size: 12px; gap: 6px; }
.titlebar > .alpha-btn svg { width: 14px; height: 14px; }
.topbar { position: relative; }
.topbar > .alpha-btn { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }

/* ---- Biblioteca: livrinhos do Início no alto das salas, estante e página de leitura ---- */
.book-row { margin: 4px 0 8px; }
.book-row-head { margin: 4px 0 6px 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--subtle); }
.book-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px 2px; padding: 0 4px; }
.bt-cell { display: flex; justify-content: center; min-height: 62px; border-radius: 12px; }
.book-row.editing .bt-cell.empty { outline: 1px dashed color-mix(in srgb, var(--line) 80%, transparent); outline-offset: -4px; }
.bt-cell.drop { outline: 2px dashed var(--srv, var(--gold)) !important; outline-offset: -3px; }
.bt-new { width: 100%; height: 100%; display: grid; place-items: center; border: 0; background: none; color: var(--subtle); opacity: 0; transition: opacity .15s; cursor: pointer; }
.bt-cell:hover .bt-new, .bt-new:focus-visible { opacity: 1; }
.book-row-head { display: flex; align-items: center; justify-content: space-between; padding-right: 8px; }
.bt-lib { position: relative; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--subtle); cursor: pointer; }
.bt-lib:hover, .bt-lib.active { color: var(--ink); background: var(--raised); }
.bt-lib.fresh::after { content: ""; position: absolute; top: 1px; right: 1px; width: 7px; height: 7px; border-radius: 50%; background: var(--srv, var(--gold)); }
/* Aba de aplicativos: quadrado com o desenho e o nome embaixo */
.book-tile { position: relative; width: 100%; max-width: 64px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0;
  background: none; border: 0; color: var(--muted); cursor: pointer; }
.book-tile .bt-box { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px;
  background: linear-gradient(160deg, var(--raised), color-mix(in srgb, var(--srv, var(--gold)) 8%, var(--panel)));
  border: 1px solid color-mix(in srgb, var(--srv, var(--gold)) 30%, var(--line)); color: color-mix(in srgb, var(--srv, var(--gold)) 75%, var(--ink));
  transition: border-color .15s, transform .15s, color .15s, box-shadow .15s; }
.book-tile .bt-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: color-mix(in srgb, var(--srv, var(--gold)) 65%, var(--muted)); }
.book-tile:hover .bt-box { border-color: var(--srv, var(--gold)); transform: translateY(-1px); color: var(--ink); }
.book-tile:hover .bt-name { color: var(--ink); }
.book-tile.active .bt-box { border-color: var(--srv, var(--gold)); background: color-mix(in srgb, var(--srv, var(--gold)) 18%, var(--raised)); color: var(--ink);
  box-shadow: 0 0 0 1px var(--srv, var(--gold)); }
.book-tile.lib .bt-box { background: transparent; border-color: var(--line); color: var(--muted); }
.book-tile.add .bt-box { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.book-tile.add .bt-name, .book-tile.lib .bt-name { color: var(--subtle); }
.book-tile.fresh::after { content: ""; position: absolute; top: -2px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--srv, var(--gold)); box-shadow: 0 0 0 2px var(--panel); }
.book-tile.dragging { opacity: .4; }
.book-tile.drop .bt-box { border-style: dashed; border-color: var(--srv, var(--gold)); }
.salas .vs-right .book-row-head { text-align: right; margin: 4px 8px 6px 0; }
.salas .vs-right .book-tiles { justify-content: flex-end; }
.book-set-row .bsr-tools { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.book-set-row .bsr-tools .on { border-color: var(--gold); }
.shelf-starters button { display: inline-flex; align-items: center; gap: 6px; }
.book-view { flex: 1; min-height: 0; overflow-y: auto; }
.shelf-view { max-width: 860px; margin: 0 auto; padding: 22px 24px 40px; display: flex; flex-direction: column; gap: 18px; }
.shelf-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.shelf-head h2 { margin: 0 0 4px; font-size: 20px; }
.shelf-head p { margin: 0; }
.shelf-head button { flex-shrink: 0; white-space: nowrap; }
.shelf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.shelf-book { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 150px; padding: 16px 14px 12px 18px;
  background: linear-gradient(170deg, var(--raised), var(--panel)); border: 1px solid var(--line); border-radius: 6px 12px 12px 6px; text-align: left; color: var(--ink);
  box-shadow: inset 6px 0 0 color-mix(in srgb, var(--srv, var(--gold)) 50%, transparent), 0 6px 16px rgba(0, 0, 0, .25); transition: transform .15s, border-color .15s; }
.shelf-book:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--srv, var(--gold)) 45%, var(--line)); }
.shelf-book .sb-icon { display: grid; color: color-mix(in srgb, var(--srv, var(--gold)) 70%, var(--ink)); }
.shelf-book .sb-name { font-weight: 700; font-size: 14.5px; line-height: 1.25; }
.shelf-book .sb-meta { margin-top: auto; }
.shelf-book.fresh::after { content: attr(data-tag); position: absolute; top: 10px; right: 10px; font-size: 10px; font-weight: 700; color: var(--srv, var(--gold)); }
.shelf-starters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.book { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: 100%; }
.book-index { display: flex; flex-direction: column; gap: 2px; padding: 16px 10px; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 70%, transparent); }
.book-index button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 9px; border: 0; border-radius: 7px; background: none; color: var(--muted); text-align: left; font-size: 13px; }
.book-index button:hover { background: var(--hover); color: var(--ink); }
.book-index .bk-page.active { background: var(--raised); color: var(--ink); box-shadow: inset 2px 0 0 var(--srv, var(--gold)); }
.book-index .bk-back { margin-bottom: 8px; font-size: 12px; }
.book-index .bk-add { margin-top: 8px; color: var(--gold); font-size: 12.5px; }
.bk-num { min-width: 16px; font-variant-numeric: tabular-nums; color: var(--subtle); font-size: 11.5px; }
.bk-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-new { font-size: 10px; font-weight: 700; color: var(--srv, var(--gold)); }
.book-page { max-width: 760px; width: 100%; padding: 26px 34px 40px; display: flex; flex-direction: column; gap: 10px; }
.bp-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.bp-title { margin: 0; font-size: 24px; line-height: 1.2; }
.bp-tools { display: flex; gap: 6px; flex-shrink: 0; }
.bp-text { font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.bp-text .md-h1 { font-size: 19px; margin: 14px 0 4px; }
.bp-text .md-h2 { font-size: 16.5px; margin: 12px 0 2px; }
.bp-meta { margin-top: 10px; }
.book-page.editing label { font-size: 12px; color: var(--muted); }
.book-page.editing .pe-title { font-size: 16px; font-weight: 600; }
.book-page.editing .pe-text { min-height: 340px; resize: vertical; font-size: 14px; line-height: 1.6; }
.pe-actions { flex-wrap: wrap; gap: 8px; align-items: center; }
.pe-actions .grow { flex: 1; }
.quiz-box { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 22px; padding: 14px 16px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--srv, var(--gold)) 40%, var(--line)); background: color-mix(in srgb, var(--srv, var(--gold)) 8%, var(--raised)); }
.quiz-box p { margin: 3px 0 0; }
.quiz-box button { flex-shrink: 0; white-space: nowrap; }
.quiz-box.done { color: var(--ok); justify-content: flex-start; }
.quiz-box.editor { border-style: dashed; }
.quiz-list, .quiz-edit { display: flex; flex-direction: column; gap: 12px; max-height: 58vh; overflow-y: auto; padding-right: 4px; }
.quiz-q { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.quiz-q legend { padding: 0 4px; font-weight: 600; }
.quiz-q .row { align-items: center; gap: 8px; }
.quiz-q .row input { flex: 1; }
.quiz-opt, .modal .quiz-opt { display: flex; align-items: center; gap: 8px; font-size: 13.5px; text-transform: none; letter-spacing: normal; font-weight: 400; color: var(--ink); cursor: pointer; }
.quiz-opt input[type="text"], .quiz-opt input:not([type]) { flex: 1; }
.book-icons { display: flex; flex-wrap: wrap; gap: 4px; }
.book-icons .bi { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border-radius: 8px; border: 1px solid var(--line); background: var(--raised); color: var(--ink); }
.book-icons .bi.on { border-color: var(--gold); background: var(--gold-soft); }
@media (max-width: 900px) {
  .book { grid-template-columns: 1fr; }
  .book-index { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .book-index button { width: auto; }
  .book-page { padding: 18px 16px 32px; }
}
.modal .nb-card { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: normal; font-size: 13px; color: var(--ink); cursor: pointer; }
.modal .nb-card input { width: auto; margin: 0; }

/* ---- Largura das colunas: alça na borda do lado do chat ---- */
@media (min-width: 901px) {
  #app.w-rooms { --wr: var(--wr-user); }
  #app.members-open.w-members:not(.no-server) { --ws: var(--ws-user); }
}
#app.col-resizing { transition: none; cursor: col-resize; user-select: none; }
#app.col-resizing * { transition: none !important; }
.col-grip { position: absolute; top: 0; bottom: 0; width: 8px; z-index: 6; cursor: col-resize; touch-action: none; }
.col-grip[data-side="left"] { left: -4px; }
.col-grip[data-side="right"] { right: -4px; }
.col-grip::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; border-radius: 2px; background: transparent; transition: background .15s; }
.col-grip:hover::after, #app.col-resizing .col-grip::after { background: color-mix(in srgb, var(--srv, var(--gold)) 60%, transparent); }
#app:not(.members-open) .members-col .col-grip, #app.no-server .members-col .col-grip { display: none; }
@media (max-width: 900px) { .col-grip { display: none; } }

/* ---- Sala de voz: área de clique maior (nome, status e o vão em volta entram na sala) ---- */
.voice-room { cursor: pointer; padding-bottom: 3px; }
.voice-room .voice-user { cursor: default; }
.voice-room .room-status { min-height: 18px; }
.voice-room .room-status .rs-edit { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.voice-room .room-status .rs-edit:hover { color: var(--ink); }
.voice-room .room-status .rs-edit span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Notas de versão ---- */
.nov-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.nov-title b { font-size: 13.5px; color: var(--ink); }
.nov-ver { font-size: 11px; color: var(--subtle); font-variant-numeric: tabular-nums; }
.nov-group { margin-top: 6px; }
.nov-group ul { margin-top: 2px; }
.nov-tag { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid currentColor; }
.nov-novo .nov-tag { color: var(--gold); }
.nov-melhoria .nov-tag { color: #6aa8ff; }
.nov-correcao .nov-tag { color: #5cc98a; }
.nov-seguranca .nov-tag { color: #e07a6a; }

/* ---- Chamada de voz no privado ---- */
.call-btn { color: var(--ok); }
.call-btn:hover { color: var(--ok); background: rgba(92, 201, 143, .12); }
.ct-call { margin-left: 4px; }
.dd-call { display: flex; align-items: center; gap: 8px; padding: 7px 10px 7px 12px; border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(92, 201, 143, .12), rgba(92, 201, 143, .03)); font-size: 12.5px; flex: none; }
.dd-call.ringing { background: linear-gradient(90deg, rgba(215, 170, 80, .16), rgba(215, 170, 80, .03)); }
.dd-call-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.dd-call.ringing .dd-call-dot { background: #d7aa50; animation: dd-call-pulse 1.1s ease-in-out infinite; }
@keyframes dd-call-pulse { 50% { opacity: .25; transform: scale(.7); } }
.dd-call-text { font-weight: 600; }
.dd-call-time { color: var(--muted, #9a9aa2); font-variant-numeric: tabular-nums; }
.dd-call-btns { margin-left: auto; display: flex; gap: 4px; }
.dd-call-btn { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: var(--raised); color: var(--ink); }
.dd-call-btn:hover { border-color: var(--line-strong); }
.dd-call-btn.accept { background: var(--ok); border-color: transparent; color: #0a0a0c; }
.dd-call-btn.hangup { background: var(--danger); border-color: transparent; color: #fff; }
.dd-call-btn.off { color: var(--danger); border-color: rgba(229, 96, 111, .35); }
#dm-call-strip { border-radius: 0; }
.call-ring { position: fixed; top: 44px; left: 50%; transform: translateX(-50%); z-index: 9000; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 10px 10px; min-width: 300px; border-radius: 16px; background: var(--panel); border: 1px solid rgba(215, 170, 80, .45);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .55), 0 0 0 4px rgba(215, 170, 80, .08); animation: call-ring-in .25s ease-out; }
@keyframes call-ring-in { from { opacity: 0; transform: translate(-50%, -10px); } }
.cr-face .avatar { width: 40px; height: 40px; box-shadow: 0 0 0 2px #d7aa50; animation: dd-call-pulse 1.4s ease-in-out infinite; }
.cr-text { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: 13px; }
.cr-text b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-text span { color: var(--muted, #9a9aa2); }
.cr-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: none; color: #0a0a0c; }
.cr-btn.accept { background: var(--ok); }
.cr-btn.decline { background: var(--danger); color: #fff; }
.cr-btn:hover { filter: brightness(1.1); }
@media (prefers-reduced-motion: reduce) { .dd-call.ringing .dd-call-dot, .cr-face .avatar, .call-ring { animation: none; } }

/* ---- Conversa na barra de baixo: abas com status, janelinha com balões ---- */
.pf { position: relative; display: inline-flex; flex: none; }
.pf-dot { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); border: 2px solid var(--panel); }
.pf-on .pf-dot { background: var(--ok); }
.pf-idle .pf-dot { background: #d7aa50; }
.pf-dnd .pf-dot { background: var(--danger); }
.pf-off .pf-dot { display: none; }
.dd-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.dd-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-name small { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-name small:empty { display: none; }
.dm-bar { height: 52px; }
.dm-bar.right { justify-content: flex-end; }
.db-chip { height: 42px; max-width: 230px; padding: 0 6px 0 5px; border-radius: 12px; gap: 9px; touch-action: none; user-select: none; }
.db-chip .avatar { width: 30px; height: 30px; font-size: 11px; }
.db-chip .pf-dot { border-color: var(--chat); }
.db-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.db-text .db-name { font-weight: 600; }
.db-status { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-status:empty { display: none; }
.db-chip.dragging { z-index: 5; opacity: .9; box-shadow: 0 8px 22px rgba(0, 0, 0, .45); border-color: var(--gold); cursor: grabbing; }
/* Arrastando uma aba: as duas pontas da barra mostram onde dá para soltar */
.dm-bar.choosing::before, .dm-bar.choosing::after { content: ""; position: absolute; top: 4px; bottom: 4px; width: 25%; border-radius: 10px;
  border: 1px dashed color-mix(in srgb, var(--gold) 45%, transparent); pointer-events: none; }
.dm-bar.choosing::before { left: 4px; }
.dm-bar.choosing::after { right: 4px; }
.dm-bar.choosing[data-drop="left"]::before, .dm-bar.choosing[data-drop="right"]::after { background: var(--gold-soft); border-style: solid; border-color: var(--gold); }
.dm-pop { width: 340px; height: 470px; border-radius: 14px; }
.dm-pop .dd-head { height: 56px; padding: 0 6px 0 12px; border-bottom: 1px solid var(--line); }
.dm-pop .dd-who .avatar { width: 34px; height: 34px; }
.dm-pop .dd-actions .icon-btn { color: var(--gold); }
.dm-pop .dd-actions .icon-btn:hover { background: var(--gold-soft); }
.dm-pop .dd-actions .call-btn { color: var(--ok); }
.dm-pop .dd-list { gap: 6px; }
.dm-pop .dd-msg { max-width: 82%; align-self: flex-start; }
.dm-pop .dd-msg .dd-body { background: var(--raised); border: 1px solid var(--line); padding: 7px 11px; border-radius: 16px 16px 16px 5px; }
.dm-pop .dd-msg.mine { align-self: flex-end; align-items: flex-end; }
.dm-pop .dd-msg.mine .dd-body { background: color-mix(in srgb, var(--gold) 22%, var(--raised)); border-color: color-mix(in srgb, var(--gold) 35%, transparent); border-radius: 16px 16px 5px 16px; }
.dm-pop .dd-msg.mine .dd-meta b { display: none; }
.dm-pop .dd-meta { font-size: 11px; padding: 0 6px; }
.dm-pop .dd-composer { border-radius: 22px; padding: 2px 4px 2px 12px; }
.dm-pop .dd-composer .cmp-btn.send { color: var(--gold); }

/* ---- Alinhamentos (07/11) ---- */
/* Foto do perfil no alto: centrada de verdade dentro do anel (com zoom de 125% o arredondamento empurrava a foto
   para um canto) e com a folga escura menor, para a imagem encostar no verde. */
.pf-ring { display: grid; place-items: center; padding: 1px; box-sizing: content-box; }
.profile .pf-ring .avatar { width: 36px; height: 36px; margin: 0; }
/* Palco: numa fileira em que alguém transmite, todos os cards usam a foto do mesmo tamanho (senão o nome de
   quem não transmite descia e as fotos ficavam desencontradas). */
.people:has(.person.has-screens) .person .avatar.big,
.people:has(.person.has-screens) .person .cam-face { width: 44px; height: 44px; font-size: 16px; }
.people:has(.person.has-screens) .person { padding-top: 8px; gap: 5px; }
/* Anel de fala por dentro do card sem mudar o tamanho da foto, e a foto inteira dentro do anel */
.person .avatar.has-img, .voice-user .avatar.has-img { background-clip: padding-box; }
/* Nome dos livros do Início: até duas linhas, centrado, em vez de cortar ("BOAS...", "REGR..."). */
.book-tile .bt-name { white-space: normal; text-align: center; letter-spacing: .03em; line-height: 1.15;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: normal; word-break: normal; hyphens: none;
  font-size: var(--bt-size, 10px); }
/* Palavra que não cabe nem na menor letra (fitBookNames): uma linha só com "…", nunca cortada no meio. */
.book-tile .bt-name.bt-cut { display: block; white-space: nowrap; text-overflow: ellipsis; }
/* Ajustes › Sons: o "Ouvir" fica sempre na mesma linha, à direita, e o texto quebra do lado. */
.sound-row { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 12px; }
.sound-row .toggle { flex: 1; min-width: 0; }
.sound-row .small-btn { flex: none; }
/* Escolhas lado a lado: título sempre na mesma altura, mesmo quando uma descrição ocupa duas linhas. */
.choice { display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; text-align: left; }
/* Mover x mudar a largura (07/11): o canto de cima é só da dobrinha (mover a coluna); a alça de largura fica só
   na lateral, abaixo dela. Antes a alça cobria o canto e pegava o arraste de quem queria mover. */
.col-grip { top: 34px; }
.fold { z-index: 8; }
/* App Biblioteca: primeira casa do Início, com o desenho na cor do servidor */
.bt-library .bt-box { color: var(--srv, var(--gold)); }
/* Biblioteca segue o mesmo ajuste dos outros nomes (antes passava por cima da casa do lado). */
.bt-library .bt-name { letter-spacing: 0; }

/* Condecorações Pioneiro (estandarte) e Alfa (escudo de prata): mesmo tamanho do Knight, brilho na cor de cada uma */
.pioneer-badge svg { filter: drop-shadow(0 0 2px rgba(232, 110, 80, .5)); }
.alfa-badge svg { filter: drop-shadow(0 0 2px rgba(210, 222, 235, .55)); }

/* Ping da voz no painel: ícone em espectro (barrinhas subindo e descendo) na cor da conexão; mouse em cima mostra o ping */
.vp-signal { position: relative; --pc: var(--ok); color: var(--pc); background: color-mix(in srgb, var(--pc) 12%, transparent); cursor: default; outline: none; }
.vp-signal[data-level="mid"] { --pc: #e9b949; }
.vp-signal[data-level="bad"] { --pc: var(--danger, #e5534b); }
.vp-signal[data-level="wait"] { --pc: var(--subtle); }
.vp-spec { display: flex; align-items: center; gap: 2px; height: 16px; }
.vp-spec i { display: block; width: 3px; height: 100%; border-radius: 2px; background: var(--pc); transform-origin: center; animation: skc-spec 1.1s ease-in-out infinite; }
.vp-spec .s1 { animation-delay: -.2s; } .vp-spec .s2 { animation-delay: -.65s; } .vp-spec .s3 { animation-delay: -.4s; }
.vp-spec .s4 { animation-delay: -.9s; } .vp-spec .s5 { animation-delay: -.1s; }
@keyframes skc-spec { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.vp-signal[data-level="bad"] .vp-spec i { animation-duration: 1.8s; }
.reduce-motion .vp-spec i { animation: none; transform: scaleY(.6); }
@media (prefers-reduced-motion: reduce) { .vp-spec i { animation: none; transform: scaleY(.6); } }
.vp-tip { position: absolute; bottom: calc(100% + 10px); left: -4px; z-index: 60; display: none; min-width: 170px; flex-direction: column; gap: 3px;
  padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line-strong, var(--line)); background: #111216; color: var(--ink);
  font-size: 12px; line-height: 1.3; text-align: left; white-space: nowrap; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); pointer-events: none; }
.vp-signal:hover .vp-tip, .vp-signal:focus-visible .vp-tip { display: flex; }
.vp-tip .mp-row { display: flex; justify-content: space-between; gap: 14px; }
.vp-tip .mp-row b { color: var(--pc); }

/* Olho da barra rápida escondida: mora na linha do nome do servidor, ao lado de Membros */
#server-header .sh-eye { color: var(--subtle); }
#server-header .sh-eye:hover { color: var(--ink); }
/* Ícone da voz: só o espectro, sem caixinha atrás; 5 pauzinhos, os acesos mostram a conexão */
.vp-signal { background: none; width: 26px; }
.vp-spec[data-level="mid"] .s4, .vp-spec[data-level="mid"] .s5,
.vp-spec[data-level="bad"] .s3, .vp-spec[data-level="bad"] .s4, .vp-spec[data-level="bad"] .s5,
.vp-signal[data-level="mid"] .s4, .vp-signal[data-level="mid"] .s5,
.vp-signal[data-level="bad"] .s3, .vp-signal[data-level="bad"] .s4, .vp-signal[data-level="bad"] .s5 { animation: none; transform: scaleY(.3); opacity: .35; }
.vp-spec[data-level="mid"] { --pc: #e9b949; }
.vp-spec[data-level="bad"] { --pc: var(--danger, #e5534b); }
/* Na lista de salas: o mesmo espectro, menor, no lugar do ícone da sala em que você está */
.channel.connected .glyph .vp-spec { --pc: var(--ok); height: 12px; gap: 1.5px; }
.channel.connected .glyph .vp-spec i { width: 2px; }
/* Salas do lado esquerdo: o painel de voz se espelha, o espectro e a caixinha do ping vão para o canto oposto */
.app.mirrored .vp-head { flex-direction: row-reverse; }
.app.mirrored .vp-info { text-align: right; }
.app.mirrored .vp-where { margin-left: auto; }
.app.mirrored .vp-tip { left: auto; right: -4px; }

/* Cartão de perfil: condecorações só ao lado do nome, numa linha; clicar mostra o que é logo embaixo */
.pc-name { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 0; }
.pc-name-text { min-width: 0; overflow-wrap: anywhere; margin-right: 4px; }
.pc-honors { display: inline-flex; align-items: center; flex-wrap: nowrap; gap: 2px; }
.pc-honor { display: inline-grid; place-items: center; padding: 2px; border: 0; border-radius: 7px; background: none; cursor: pointer; }
.pc-honor > * { margin: 0 !important; }
.pc-honor:hover, .pc-honor.on { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.pc-honor-info { display: flex; align-items: center; gap: 10px; margin: 0; padding: 8px 10px; border-radius: 10px;
  background: rgba(0, 0, 0, .28); border: 1px solid var(--line); font-family: var(--body, inherit); font-size: 13px; }
.pc-honor-info.hidden { display: none; }
.pc-honor-info > :first-child { margin: 0; flex: none; }
.pc-honor-info .honor-text { display: flex; flex-direction: column; gap: 1px; }
/* Condecorações na linha do @usuário, num fundinho escuro; +N quando passa de 4 */
.pc-user:has(.pc-honors) { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; }
.pc-user > .pc-honors { padding: 1px 3px; border-radius: 8px; background: rgba(0, 0, 0, .28); }
.pc-user .pc-honor .knight-badge.big, .pc-user .pc-honor .verified.big, .pc-user .pc-honor .ai-badge.big { width: 19px; height: 19px; }
.pc-more { padding: 0 5px; height: 22px; font-size: 11.5px; font-weight: 700; color: var(--muted); }

/* Botões do cartão de perfil: Mensagem com ícone, quadradinhos (chamada ou adicionar, ⋯) do mesmo tamanho */
.pc-actions .pc-btn-ic { display: inline-flex; align-items: center; gap: 6px; }
.pc-actions .pc-square { width: 32px; height: 32px; padding: 0; display: inline-grid; place-items: center; border-radius: 9px;
  background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.pc-actions .pc-square:hover { background: color-mix(in srgb, var(--ink) 16%, transparent); }
.pc-actions .pc-square.sent { color: var(--ok); cursor: default; }
/* Botãozinho i do cartão: abre os dados da conta (criação e tempo no servidor aberto) */
.pc-actions .pc-info { margin-right: auto; font-family: Georgia, serif; font-style: italic; font-weight: 700; font-size: 15px; }
.pc-actions .pc-info.on { color: var(--gold); background: color-mix(in srgb, var(--gold) 16%, transparent); }
.pc-dates.hidden { display: none; }

/* Menus: ícone à esquerda, itens mais compactos e destaque na cor do servidor */
.ctx-menu { padding: 5px; min-width: 210px; }
.ctx-item { justify-content: flex-start; gap: 10px; padding: 7px 10px; font-size: 13.5px; }
.ctx-item .ctx-label { flex: 1; }
.ctx-item:hover, .ctx-item:focus-visible, .ctx-item.has-sub.open { background: color-mix(in srgb, var(--srv, var(--gold)) 16%, transparent); }
.ctx-item.danger:hover { background: rgba(255, 90, 90, .14); }
.ctx-ic { flex: none; display: inline-grid; place-items: center; width: 16px; color: var(--muted); }
.ctx-item:hover .ctx-ic, .ctx-item.open .ctx-ic { color: var(--ink); }
.ctx-item.danger .ctx-ic { color: #ff8a8a; }
.ctx-menu.with-icons > .ctx-item:not(:has(> .ctx-ic)) { padding-left: 36px; }
.ctx-sep { margin: 4px 8px; }

/* Modo parado (app em segundo plano ou 90 s sem mexer): nenhuma animação roda */
.skc-idle *, .skc-idle *::before, .skc-idle *::after { animation-play-state: paused !important; }
/* Animação de entrada roda até o fim: parada no começo, o que estava entrando ficava invisível (opacidade 0) */
.skc-idle :is(.carousel > * > *, .mosaic > .screen.big, .call-ring, .update-banner, .splash, .sp-word, .sp-tag, .wh-word, .wh-tag, .wh-title, .wh-lead, .wh-list, .wh-note, .notice-stack .card, .msg.flash) { animation-play-state: running !important; }
/* A setinha da atualização gira mesmo parado: é justo quando a pessoa espera que ela precisa mostrar que está andando (ícone pequeno, custo mínimo) */
.skc-idle :is(.me-update.updating .arrows, .me-update.waiting .arrows) { animation-play-state: running !important; }
/* Brilho dos selos e do escudo oficial: anda por transform (só a placa compõe), não por "left" (redesenhava tudo) */
.verified::after, .shield .sh-knight::after, .srv-official::after { left: -60%; animation-name: skc-shine2; }
@keyframes skc-shine2 { 0%, 70% { transform: translateX(0) skewX(-20deg); } 100% { transform: translateX(475%) skewX(-20deg); } }
/* Início fixo no alto da lista: só as salas embaixo rolam */
.channel-list > .book-row { position: sticky; top: -8px; z-index: 4; margin: -8px -8px 6px; padding: 12px 8px 6px; background: var(--panel);
  box-shadow: 0 6px 8px -6px rgba(0, 0, 0, .55); }
/* Linha na cor do servidor embaixo dos apps, mais fraca que a do cabeçalho */
.channel-list > .book-row::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--srv, var(--gold)) 30%, transparent) 18%, color-mix(in srgb, var(--srv, var(--gold)) 30%, transparent) 82%, transparent); }

/* Tela ou lousa numa janela própria: o alfinete fica aceso (clicar desafixa) */
.pop-btn.on, .tela-btn.on { color: var(--srv, var(--gold)); background: color-mix(in srgb, var(--srv, var(--gold)) 16%, transparent); }


/* Cartão de perfil: uma fileira só de botões do mesmo tamanho, a sala numa faixa própria e seções mais leves */
.pc-actions { gap: 6px; align-items: stretch; }
.pc-actions > .primary, .pc-actions > .secondary { flex: 1; min-width: 0; height: 36px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 10px; white-space: nowrap; }
.pc-actions .pc-square { flex: none; width: 36px; height: 36px; border-radius: 10px; }
.pc-actions .pc-info { margin-right: 0; font: inherit; }
.pc-room { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border-radius: 10px;
  background: color-mix(in srgb, var(--ok) 12%, rgba(2, 2, 3, .34)); border: 1px solid color-mix(in srgb, var(--ok) 28%, transparent); }
.pc-room-ic { flex: none; display: inline-grid; place-items: center; color: var(--ok); }
.pc-room-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.pc-room-text small { font-size: 11px; color: var(--muted); }
.pc-room-text b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-room-go { flex: none; height: 30px; padding: 0 12px; border: 0; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: #06140c; background: var(--ok); cursor: pointer; }
.pc-room-go:hover { filter: brightness(1.1); }
.pc-section { padding: 9px 11px; }
.pc-section h4 { margin-bottom: 6px; font-size: 10px; letter-spacing: .1em; }
.pc-roles { gap: 5px; }
.pc-role { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; font-size: 12px; line-height: 1.3; background: color-mix(in srgb, var(--ink) 8%, transparent); border-color: transparent; }
.pc-role-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--subtle); }


/* Selo na lista da call: sempre do lado da foto que aponta para o lado da coluna. Só "salas à esquerda" inverte a linha sem inverter o selo */
.salas .vs-left .voice-room .voice-user > .avatar { order: -2; }
.salas .vs-left .voice-room .voice-user > .vu-slot { order: -1; }
/* Escolha do selo nos ajustes */
.badge-picks { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.badge-pick { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 8px; border-radius: 10px; font-size: 13px; color: var(--muted);
  background: color-mix(in srgb, var(--ink) 6%, transparent); border: 1px solid transparent; cursor: pointer; }
.badge-pick > :first-child { margin: 0; }
.badge-pick:hover { color: var(--ink); }
.badge-pick.on { color: var(--ink); border-color: var(--srv, var(--gold)); background: color-mix(in srgb, var(--srv, var(--gold)) 14%, transparent); }


/* Fontes livres para o nome: o navegador só baixa as que aparecem na tela */
@font-face { font-family: "Dancing Script"; font-weight: 400; font-display: swap; src: url(/fonts/dancing-script-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Pacifico"; font-weight: 400; font-display: swap; src: url(/fonts/pacifico-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Great Vibes"; font-weight: 400; font-display: swap; src: url(/fonts/great-vibes-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Caveat"; font-weight: 400; font-display: swap; src: url(/fonts/caveat-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "UnifrakturCook"; font-weight: 700; font-display: swap; src: url(/fonts/unifrakturcook-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Pirata One"; font-weight: 400; font-display: swap; src: url(/fonts/pirata-one-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "MedievalSharp"; font-weight: 400; font-display: swap; src: url(/fonts/medievalsharp-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Uncial Antiqua"; font-weight: 400; font-display: swap; src: url(/fonts/uncial-antiqua-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Almendra"; font-weight: 400; font-display: swap; src: url(/fonts/almendra-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Space Mono"; font-weight: 400; font-display: swap; src: url(/fonts/space-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "VT323"; font-weight: 400; font-display: swap; src: url(/fonts/vt323-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Press Start 2P"; font-weight: 400; font-display: swap; src: url(/fonts/press-start-2p-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Bungee"; font-weight: 400; font-display: swap; src: url(/fonts/bungee-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Bungee Outline"; font-weight: 400; font-display: swap; src: url(/fonts/bungee-outline-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Righteous"; font-weight: 400; font-display: swap; src: url(/fonts/righteous-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Lobster"; font-weight: 400; font-display: swap; src: url(/fonts/lobster-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Permanent Marker"; font-weight: 400; font-display: swap; src: url(/fonts/permanent-marker-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Creepster"; font-weight: 400; font-display: swap; src: url(/fonts/creepster-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Monoton"; font-weight: 400; font-display: swap; src: url(/fonts/monoton-latin-400-normal.woff2) format("woff2"); }
.font-picker { display: grid; gap: 6px; }
.fp-top { display: flex; align-items: center; gap: 4px; }
.fp-show { flex: 1; min-width: 0; height: 40px; line-height: 40px; padding: 0 12px; font-size: 18px; border-radius: 10px; color: var(--ink);
  background: color-mix(in srgb, var(--ink) 6%, transparent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-arrow { flex: none; width: 34px; height: 40px; }
.fp-list { max-height: 168px; overflow-y: auto; padding: 4px; border-radius: 10px; border: 1px solid var(--line); outline: none; }
.fp-list:focus-visible { border-color: var(--srv, var(--gold)); }
.fp-row { padding: 5px 10px; border-radius: 7px; font-size: 15px; line-height: 1.35; color: var(--muted); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-row:hover { background: var(--hover); color: var(--ink); }
.fp-row.on { color: var(--ink); background: color-mix(in srgb, var(--srv, var(--gold)) 16%, transparent); }
/* Foto ampliada do cartão de perfil */
.pc-zoom { cursor: zoom-in; }
.avatar-zoom { padding: 0; border: 0; background: transparent; max-width: none; max-height: none; cursor: zoom-out; outline: none; overflow: hidden; }
.avatar-zoom::backdrop { background: rgba(2, 2, 3, .78); }
.avatar-zoom img { display: block; width: min(70vh, 80vw, 384px); height: min(70vh, 80vw, 384px); object-fit: cover; border-radius: 18px; }

/* Perto do limite de caracteres: contador; passou: enviar como arquivo */
.char-bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 2px 6px 4px; font-size: 12px; color: var(--muted); }
.char-count { font-variant-numeric: tabular-nums; }
.char-note { flex: 1; min-width: 0; color: var(--ink); }
.char-bar.over .char-count { color: var(--danger); font-weight: 600; }
.char-bar .small-btn { flex: none; }


/* Horário que se ajusta a cada pessoa */
.md-time { padding: 0 4px; border-radius: 4px; background: color-mix(in srgb, var(--ink) 9%, transparent); cursor: help; }
/* Ações que só aparecem segurando Shift */
.msg .actions .act-shift { display: none; }
.skc-shift .msg .actions .act-shift { display: inline-flex; }


/* Anexo com spoiler */
.att-spoiler { position: relative; width: fit-content; min-width: 140px; min-height: 72px; max-width: 100%; overflow: hidden; border-radius: 10px; }
.att-spoiler > :first-child { filter: blur(28px) brightness(.6); pointer-events: none; user-select: none; }
.att-spoiler-tag { position: absolute; inset: 0; margin: auto; width: fit-content; height: 32px; padding: 0 14px; border: 0; border-radius: 16px; font-size: 13px; font-weight: 600; color: #fff; background: rgba(2, 2, 3, .72); cursor: pointer; }
.att-spoiler-tag:hover { background: rgba(2, 2, 3, .9); }
.att-spoil.on { color: var(--ink); border-color: var(--srv, var(--gold)); }


/* Formatar o texto e ver a prévia antes de enviar */
.md-big { font-size: 1.3em; line-height: 1.25; }
.md-small { font-size: .82em; }
.md-preview { max-height: 180px; overflow-y: auto; margin: 0 6px 6px; padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--line); font-size: 14px;
  white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; color: var(--ink); pointer-events: none; }
.md-preview .md-pre { margin: 2px 0; }
.fmt-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; margin: 0 6px 6px; padding: 3px; width: fit-content; max-width: 100%; border-radius: 9px; background: var(--raised); border: 1px solid var(--line); }
.fmt-btn { min-width: 28px; height: 26px; padding: 0 6px; border: 0; border-radius: 6px; font-size: 12.5px; color: var(--muted); background: transparent; cursor: pointer; }
.fmt-btn:hover { color: var(--ink); background: var(--hover); }
.fmt-btn.b { font-weight: 800; } .fmt-btn.i { font-style: italic; } .fmt-btn.s { text-decoration: line-through; } .fmt-btn.c { font-family: ui-monospace, Consolas, monospace; font-size: 11px; }
.fmt-sep { width: 1px; height: 16px; margin: 0 3px; background: var(--line); }
.fmt-palette { position: relative; display: inline-grid; place-items: center; }
.fmt-palette input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; } /* o seletor abre junto do botão */

/* Lista no Markdown */
.md-li { position: relative; padding-left: 16px; margin: 1px 0; }
.md-li::before { content: ''; position: absolute; left: 4px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--muted); }
/* Seletor de emojis */
.emoji-pop { box-sizing: border-box; position: fixed; z-index: 60; display: flex; flex-direction: column; gap: 8px; width: 340px; max-width: calc(100vw - 16px); height: 380px; max-height: calc(100vh - 90px); padding: 10px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line); box-shadow: 0 12px 34px rgba(0, 0, 0, .4); }
.ep-search { width: 100%; }
.ep-nav { display: flex; align-items: center; gap: 2px; flex: none; }
.ep-arrow { flex: none; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; color: var(--muted); background: transparent; cursor: pointer; }
.ep-arrow:hover { color: var(--ink); background: var(--hover); }
.ep-tabs { display: flex; gap: 4px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; cursor: grab; touch-action: pan-y; }
.ep-tabs:active { cursor: grabbing; }
.ep-tab { flex: none; padding: 3px 9px; border: 0; border-radius: 12px; font-size: 12px; color: var(--muted); background: transparent; cursor: pointer; }
.ep-tab:hover { color: var(--ink); background: var(--hover); }
.ep-tab.on { color: var(--ink); background: var(--hover); font-weight: 600; }
.ep-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(8, 1fr); grid-auto-rows: 38px; gap: 2px; }
.ep-cell { display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px; font-size: 22px; line-height: 1; background: transparent; cursor: pointer; }
.ep-cell:hover { background: var(--hover); }
.ep-none { grid-column: 1 / -1; text-align: center; }
.ep-hint { flex: none; min-height: 18px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mo-emoji { display: grid; place-items: center; width: 28px; height: 28px; font-size: 20px; line-height: 1; }

/* GIFs */
.ep-body { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; }
.ep-mode { display: flex; gap: 4px; flex: none; }
.ep-mode-btn { flex: 1; height: 28px; border: 0; border-radius: 7px; font-size: 13px; color: var(--muted); background: transparent; cursor: pointer; }
.ep-mode-btn:hover { background: var(--hover); }
.ep-mode-btn.on { color: var(--ink); background: var(--hover); font-weight: 600; }
.gif-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 110px; gap: 4px; }
.gif-cell { padding: 0; border: 0; border-radius: 7px; overflow: hidden; background: var(--hover); cursor: pointer; }
.gif-cell img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gif-by { text-align: right; }
.md-gif { display: block; max-width: min(320px, 100%); max-height: 300px; margin: 4px 0; border-radius: 8px; cursor: zoom-in; }


/* Editar canal */
.ce-field { gap: 6px; margin-bottom: 12px; }
.ce-icons { display: grid; grid-template-columns: repeat(auto-fill, 34px); gap: 2px; max-height: 112px; overflow-y: auto; }

/* Frase dourada com a coroinha pousada em cima; ao chegar, a coroa desce e o dourado passa um brilho */
.king-phrase { position: relative; display: inline-block; padding-top: 15px; margin-top: 2px; font-weight: 700;
  background: linear-gradient(100deg, #b8862a 0%, #f3d27a 35%, #fff1c1 50%, #f3d27a 65%, #b8862a 100%); background-size: 220% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 6px rgba(212, 167, 44, .35)); }
.king-mini { position: absolute; left: 50%; top: 0; transform: translateX(-50%); color: #e8c25a; line-height: 0; pointer-events: none; filter: drop-shadow(0 0 4px rgba(212, 167, 44, .8)); }
.king-phrase.king-new { animation: king-shine 1.8s ease-in-out .5s 1 both; }
.king-phrase.king-new .king-mini { animation: king-land .9s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes king-land { 0% { transform: translate(-50%, -46px) rotate(-14deg) scale(1.6); opacity: 0; } 55% { opacity: 1; } 100% { transform: translateX(-50%); opacity: 1; } }
@keyframes king-shine { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.msg.king-glow { animation: king-glow 3s ease-in-out; }
@keyframes king-glow { 0%, 100% { background: transparent; } 25%, 70% { background: rgba(212, 167, 44, .14); box-shadow: inset 3px 0 0 #d4a72c; } }

/* Citação do perfil */
.pc-quote { margin: 0; padding: 2px 0 2px 10px; border-left: 3px solid var(--pc-accent, var(--gold)); }
.pc-quote p { margin: 0; font-style: italic; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.pc-quote cite { display: block; margin-top: 4px; font-style: normal; font-size: 12px; color: var(--muted); }
.pc-quote cite::before { content: '— '; }

/* A dobrinha virou setinha (07/11): no meio da borda da coluna, do lado do chat, para não cobrir o ícone do servidor
   no alto. Mesmo comportamento: arrastar ou clicar muda a coluna de lado. */
.fold, .fold.right { top: 50%; width: 9px; height: 30px; margin-top: -15px; border-radius: 0; box-shadow: none;
  background: var(--line-strong); clip-path: polygon(100% 0, 0 50%, 100% 100%); opacity: .55; }
.fold.right { clip-path: polygon(0 0, 100% 50%, 0 100%); }
.fold:hover, .fold:focus-visible, .fold.right:hover, .fold.right:focus-visible { width: 13px; height: 38px; margin-top: -19px; opacity: 1; background: var(--gold); }

/* App Biblioteca opcional: escondido aparece apagado só para o dono no modo editor; o x tira do Início */
.bt-cell.lib { position: relative; }
.bt-cell.lib.off .book-tile { opacity: .35; filter: grayscale(1); }
.bt-hide { position: absolute; top: 0; right: 4px; display: grid; place-items: center; width: 16px; height: 16px; padding: 0; border: 0; border-radius: 50%; background: var(--line-strong); color: var(--ink); cursor: pointer; }
.bt-hide:hover, .bt-hide:focus-visible { background: #e5484d; color: #fff; }
.book-row { padding-top: 6px; }

/* Legacy (ametista) e selos de verificado (roseta dourada / azul) */
.legacy-badge svg { filter: drop-shadow(0 0 2px rgba(164, 107, 224, .55)); }
.seal-badge svg { filter: drop-shadow(0 0 2px rgba(224, 176, 74, .45)); }

/* Entrar sozinho nas transmissões: botão do canto (aceso quando ligado) */
.screen .auto-watch-btn { position: absolute; top: 10px; right: 10px; z-index: 4; display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
  border-radius: 9px; background: rgba(2, 2, 3, .62); color: var(--muted); opacity: 0; transition: opacity .15s; }
.screen:hover .auto-watch-btn, .screen .auto-watch-btn:focus-visible, .screen .auto-watch-btn.on { opacity: 1; }
.screen .auto-watch-btn:hover { color: var(--ink); background: rgba(2, 2, 3, .85); }
.screen .auto-watch-btn.on { color: var(--gold); box-shadow: inset 0 0 0 1px rgba(224, 176, 74, .55); }
.screen.watch-card { position: relative; }

/* Moderação de voz: ícone de silenciado pelo servidor, motivo no aviso e motivos prontos no diálogo. */
.vs-end.mod-muted { color: var(--danger); opacity: 1; }
.mod-reason { margin: 8px 0; padding: 8px 10px; border-left: 3px solid var(--danger); border-radius: 6px; background: color-mix(in srgb, var(--danger) 10%, transparent); }
.mod-muted-note { color: var(--danger); font-weight: 600; }
.mod-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.mod-chips .chip { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: inherit; font-size: 12px; cursor: pointer; }
.mod-chips .chip:hover { border-color: var(--danger); }

/* Quem está na sala, na lista de salas: um pouco maior (foto 22 -> 25 px, nome 13,5 -> 14,5 px, linha mais alta). */
.salas .voice-room .voice-user { padding-top: 4px; padding-bottom: 4px; gap: 9px; }
.salas .voice-room .voice-user > .avatar.small { width: 25px; height: 25px; font-size: 10px; }
.salas .voice-room .voice-user .name { font-size: 14.5px; }
.salas .voice-room .voice-user .vs-end .ic { width: 16px; height: 16px; }

/* Perfil: condecorações numa linha própria embaixo do @usuário. */
.pc-honor-line { display: flex; margin-top: 5px; }
.pc-honor-line > .pc-honors { padding: 2px 4px; border-radius: 8px; background: rgba(0, 0, 0, .28); }
/* O que fica guardado no (i): uma coluna de seções (.pc-more já é o botão +N das condecorações). */
.pc-extra { display: flex; flex-direction: column; gap: 10px; }
.pc-extra.hidden { display: none; }
.pc-info-ic { position: relative; display: inline-grid; place-items: center; }
.pc-info-mod { position: absolute; right: -6px; bottom: -5px; display: grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: var(--gold, #d4af37); color: #14110a; }
/* Visão de moderador. */
.pc-mod { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px 12px; border-radius: 10px; background: rgba(2, 2, 3, .34); border: 1px solid color-mix(in srgb, var(--gold, #d4af37) 35%, transparent); }
.pc-mod-head { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--gold, #d4af37); }
.pc-mod-tools { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-radius: 9px; overflow: hidden; border: 1px solid var(--line-strong); }
.pc-mod-tool { display: grid; place-items: center; height: 34px; border: 0; border-right: 1px solid var(--line-strong); border-radius: 0; background: rgba(255, 255, 255, .03); color: var(--ink); cursor: pointer; }
.pc-mod-tool:last-child { border-right: 0; }
.pc-mod-tool:hover { background: rgba(255, 255, 255, .09); }
.pc-mod-tool.danger:hover { background: color-mix(in srgb, var(--danger) 22%, transparent); color: var(--danger); }
.pc-mod-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-mod-flag { padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }
.pc-mod-flag.soft { color: var(--gold, #d4af37); background: color-mix(in srgb, var(--gold, #d4af37) 14%, transparent); }
.pc-mod-group h4 { margin: 0 0 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--subtle); }
.pc-mod-group { display: flex; flex-direction: column; }
.pc-mod-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 2px; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; font: inherit; font-size: 13px; text-align: left; }
.pc-mod-row:last-child { border-bottom: 0; }
.pc-mod-row > .ic { flex: none; color: var(--muted); }
.pc-mod-label { flex: 1; min-width: 0; }
.pc-mod-row b { font-weight: 600; }
.pc-mod-row b.ok { color: var(--ok); }
.pc-mod-row.link { cursor: pointer; border-radius: 6px; }
.pc-mod-row.link:hover { background: rgba(255, 255, 255, .05); }
.pc-mod-invite { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.pc-mod-invite small { color: var(--muted); font-size: 11px; }
.pc-mod-code { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 6px; background: rgba(255, 255, 255, .06); font-family: ui-monospace, monospace; font-size: 12px; }
/* Lado invertido: os botões da voz também trocam de ponta (desligar fica do lado de fora, microfone perto do chat).
   Dentro dos pares (microfone e fone; ⚙ e ✕) a ordem continua a mesma. */
.app.mirrored .vp-actions { direction: rtl; }
.app.mirrored .vp-actions > * { direction: ltr; }
/* O cartão cresce com o (i) aberto e a janelinha rola: nada encolhe por cima dos botões. */
.pc > *, .pc > div > *, .pc-extra > *, .pc-mod > * { flex-shrink: 0; }

/* Início com a coluna estreita (08/11, print do Felipe): os quadradinhos nunca encostam. Cada um cabe na própria
   casa com 3 px de folga de cada lado (8 px entre vizinhos, contando o gap), diminuindo junto com o ícone. */
.bt-cell { container-type: inline-size; min-width: 0; }
.book-tile .bt-box { width: min(44px, 100cqi - 6px); height: min(44px, 100cqi - 6px); border-radius: min(12px, 27cqi); }
.book-tile .bt-box svg { width: min(22px, 50cqi); height: min(22px, 50cqi); }

/* Imagem própria do livro: no quadradinho do Início preenche a caixa; nas listas fica do tamanho do ícone. */
.bk-img { display: block; object-fit: cover; border-radius: 4px; flex: none; }
.book-tile .bt-box:has(> .bk-img) { overflow: hidden; padding: 0; }
.book-tile .bt-box > .bk-img { width: 100%; height: 100%; border-radius: inherit; }
.book-img-row { gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ===== Cartão de perfil v3 (08/11, Felipe: "nem tudo dentro dessas caixinhas", cara própria) =====
   Seções soltas no próprio cartão, separadas por um fio na cor da pessoa; citação com aspas grandes;
   status como bolinha encaixada no anel da foto, com o texto embaixo da foto. */
.pc-pop { width: 340px; }
.pc { gap: 0; padding: 18px 18px 14px; }
.pc-top { align-items: flex-start; margin-bottom: 4px; }
.pc-side { flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pc-avatar.avatar { width: 92px; height: 92px; }
.pc-ring { position: relative; }
.pc-ring::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  right: calc(14.6% - 9px); bottom: calc(14.6% - 9px); background: var(--neon);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc-accent) 18%, var(--panel)), 0 0 10px color-mix(in srgb, var(--neon) 70%, transparent); }
.pc-status { margin: 0; justify-content: center; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: color-mix(in srgb, var(--ink) 82%, transparent); }
.pc-status[data-status="online"] { color: #3ee08a; }
.pc-status[data-status="idle"] { color: #f0b232; }
.pc-status[data-status="dnd"] { color: #ef5a6b; }
.pc-status .pc-dot { display: none; }
.pc-honor-line { margin-top: 8px; }
.pc-section { margin: 0; padding: 12px 2px 2px; border: 0; border-radius: 0; background: none; position: relative; }
.pc-section::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--pc-accent) 60%, transparent), color-mix(in srgb, var(--ink) 10%, transparent) 60%, transparent); }
.pc > .pc-section, .pc > div:not(.pc-top):not(.pc-actions) > .pc-section { margin-top: 12px; }
.pc-section h4 { color: color-mix(in srgb, var(--pc-accent) 55%, var(--muted)); }
.pc-quote-sec { padding-top: 14px; }
.pc-quote { position: relative; margin: 0; padding: 0 4px 0 30px; border: 0; }
.pc-quote-mark { position: absolute; left: -2px; top: -12px; font-family: Georgia, 'Times New Roman', serif; font-size: 54px; line-height: 1;
  color: color-mix(in srgb, var(--pc-accent) 75%, var(--gold)); opacity: .9; }
.pc-quote p { font-family: Georgia, 'Times New Roman', serif; font-style: italic; font-size: 16px; line-height: 1.4; color: var(--ink); }
.pc-quote cite { margin-top: 6px; font-size: 12px; letter-spacing: .03em; color: color-mix(in srgb, var(--ink) 65%, transparent); }
.pc-roles { gap: 6px; }
.pc-role { background: color-mix(in srgb, var(--ink) 7%, transparent); border-color: transparent; }
.pc-actions { margin-top: 14px; }

/* Topo do app: a bolinha do status também fica encaixada no anel da foto (no lugar da bolinha ao lado do texto). */
.pf-ring { position: relative; }
.pf-ring::before { content: ""; position: absolute; width: 11px; height: 11px; border-radius: 50%; z-index: 1;
  right: calc(14.6% - 5.5px); bottom: calc(14.6% - 5.5px); background: var(--neon); box-shadow: 0 0 0 2px var(--panel); }
.me-status .conn { display: none; }

/* Botões do canto da transmissão (08/11, Felipe: "um por cima do outro" e "cor diferente"): uma fileira só,
   todos 34 px, mesma família de cor (--ctl, a cor do servidor); ligado = preenchido. Aparecem ao passar o mouse. */
.screen.big .screen-tools { position: absolute; top: 10px; right: 10px; z-index: 4; display: flex; gap: 6px; align-items: center;
  opacity: 0; transition: opacity .15s; }
.screen.big:hover .screen-tools, .screen.big .screen-tools:focus-within { opacity: 1; }
.screen.big .screen-tools > .icon-btn { position: static; inset: auto; opacity: 1; display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border-radius: 10px; background: rgba(2, 2, 3, .72); color: var(--ctl); backdrop-filter: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ctl) 30%, transparent); transition: box-shadow .15s, background .15s; }
.screen.big .screen-tools > .icon-btn:hover { background: rgba(2, 2, 3, .86); box-shadow: inset 0 0 0 1px var(--ctl); }
.screen.big .screen-tools > .icon-btn.on { background: color-mix(in srgb, var(--ctl) 22%, rgba(2, 2, 3, .72)); box-shadow: inset 0 0 0 1px var(--ctl); }
.screen.big .stats-box { top: 54px; bottom: auto; right: 10px; }

/* ---- Arrumar o Início: nomes opcionais e painel pela esquerda ---- */
.book-row.names-livros .bt-library .bt-name, .book-row.names-nenhum .bt-name { display: none; }
.book-row.names-nenhum .bt-cell { min-height: 50px; }
.book-row.names-nenhum .book-tiles { row-gap: 6px; }
.book-row { position: relative; }
.home-gear { position: absolute; top: 2px; right: 4px; z-index: 2; display: grid; place-items: center; width: 20px; height: 20px; padding: 0;
  border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .15s; }
.book-row:hover .home-gear, .home-gear:focus-visible { opacity: 1; }
.home-gear:hover { color: var(--ink); border-color: var(--srv, var(--gold)); }
.home-shade { position: fixed; inset: 0; z-index: 900; background: rgba(0, 0, 0, .35); animation: hp-fade .15s ease-out; }
.home-panel { position: fixed; top: 0; bottom: 0; left: 0; z-index: 901; width: min(320px, calc(100vw - 32px)); display: flex; flex-direction: column;
  background: var(--panel); border-right: 1px solid var(--line); box-shadow: 8px 0 32px rgba(0, 0, 0, .45); animation: hp-in .18s ease-out; }
@keyframes hp-in { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes hp-fade { from { opacity: 0; } }
.hp-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 4px; }
.hp-title { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--ink); }
.hp-title svg { color: var(--srv, var(--gold)); }
.hp-close { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.hp-close:hover { background: var(--raised); color: var(--ink); }
.hp-hint { margin: 0 16px 8px; font-size: 12px; color: var(--subtle); }
.hp-body { flex: 1; overflow-y: auto; padding: 0 16px 20px; }
.hp-sec { position: relative; padding: 16px 0 4px; }
.hp-sec::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--srv, var(--gold)) 55%, transparent), transparent); }
.hp-sec h3 { margin: 0 0 10px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--subtle); }
.hp-segs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 3px; border-radius: 10px; background: var(--raised); }
.hp-seg { padding: 7px 4px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.hp-seg:hover { color: var(--ink); }
.hp-seg.on { background: color-mix(in srgb, var(--srv, var(--gold)) 22%, var(--panel)); color: var(--ink); box-shadow: inset 0 0 0 1px var(--srv, var(--gold)); }
.hp-note { margin: 8px 0 0; font-size: 12px; color: var(--subtle); }
.hp-label { margin: 14px 0 6px; font-size: 12px; color: var(--muted); }
.hp-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 6px 0; font-size: 13px; font-weight: 500; letter-spacing: normal; text-transform: none; color: var(--ink); cursor: pointer; }
.hp-toggle.disabled { opacity: .5; cursor: default; }
.home-panel input.switch { appearance: none; position: relative; flex: none; width: 34px; height: 20px; margin: 0; border-radius: 10px; background: var(--line-strong); cursor: pointer; transition: background .15s; }
.home-panel input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.home-panel input.switch:checked { background: var(--srv, var(--gold)); }
.home-panel input.switch:checked::after { transform: translateX(14px); }
.home-panel input.switch:disabled { cursor: default; }
.hp-map { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 10px; border-radius: 12px; background: var(--raised); }
.hp-map.off { opacity: .45; }
.hp-cell { aspect-ratio: 1; display: grid; place-items: center; padding: 0; border: 1px dashed var(--line); border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.hp-cell.book { border-style: solid; background: var(--panel); }
.hp-cell .bk-img { width: 12px; height: 12px; border-radius: 3px; object-fit: cover; }
.hp-cell:not(.lib):hover { border-color: var(--srv, var(--gold)); color: var(--ink); }
.hp-cell.lib { border: 1px solid var(--srv, var(--gold)); background: color-mix(in srgb, var(--srv, var(--gold)) 25%, var(--panel)); color: var(--ink); cursor: default; }
.hp-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.hp-quick button, .hp-wide { padding: 7px 10px; font-size: 12px; }
.hp-wide { display: block; width: 100%; margin-top: 8px; }

/* ID público no (i) do cartão */
.pc-dates { flex-wrap: wrap; row-gap: 10px; }
.pc-pid { flex-basis: 100%; }
.pc-pid-btn { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: transparent; color: var(--ink);
  font: 600 12.5px/1.4 ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: .04em; cursor: pointer; }
.pc-pid-btn svg { color: var(--muted); }
.pc-pid-btn:hover svg { color: var(--srv, var(--gold)); }
