/* Optional local GG Sans font (add your licensed .ttf to fonts/). */
@font-face {
  font-family: "gg sans";
  src: url("../fonts/gg sans Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}


/* Layout: server rail | channel sidebar | chat | member list. One dark visual world, chosen on purpose for a chat app. */
:root {
  --bg-rail: #0e1015;
  --bg-side: #151820;
  --bg-chat: #1b1e27;
  --bg-raised: #252935;
  --bg-hover: #222632;
  --line: #2b303d;
  --text: #e8eaf0;
  --muted: #9198a8;
  --faint: #646b7b;
  --accent: #2bc7a8;
  --accent-soft: rgba(43,199,168,.14);
  --accent-ink: #04201a;
  --online: #3ecf8e;
  --danger: #ff5d6c;
  --idle: #f0b232;
  --bg-card: #101218;
  --bg-menu: #1a1d26;
  --bg-bubble: #1d2029;
  --bg-me: #12141b;
  --bg-reply: #20232d;
  --link: #7cc4ff;
  --accent-text: #b6f2e5;
  --mention-me: #ffd98a;
  --chat-size: 15px;
  --font-display: "gg sans", "gg sans SemiBold", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "gg sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg-chat); color: var(--text); font: 15px/1.45 var(--font-body); overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
button:focus-visible, textarea:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { display: block; }

.app { display: grid; grid-template-columns: auto 1fr auto; height: 100%; }
.nav { display: flex; height: 100%; min-height: 0; }

/* Server rail */
.rail { width: 72px; background: var(--bg-rail); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; overflow-y: auto; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.srv { position: relative; width: 48px; height: 48px; flex: none; }
.srv-btn { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; font: 700 16px/1 var(--font-display); color: #fff; transition: background .18s, transform .12s; overflow: hidden; }
.srv-btn:hover { transform: translateY(-1px); }
.srv::before { content: ""; position: absolute; left: -12px; top: 50%; width: 4px; height: 0; border-radius: 0 4px 4px 0; background: var(--text); transform: translateY(-50%); transition: height .18s; }
.srv:hover::before { height: 18px; }
.srv.on::before { height: 36px; }
.rail-sep { width: 32px; height: 2px; border-radius: 1px; background: var(--line); flex: none; }
.srv-add .srv-btn { background: var(--bg-raised); color: var(--accent); font-size: 26px; font-weight: 500; }
.srv-add .srv-btn:hover { background: var(--accent); color: var(--accent-ink); }
.logo .srv-btn { background: #232428; color: var(--accent-ink); border-radius: 16px; padding: 0; transition: background .18s, border-radius .18s; }
.logo .srv-btn img { width: 100%; height: 100%; display: block; object-fit: contain; border-radius: inherit; filter: none; transition: filter .18s; }
.logo.on .srv-btn, .logo .srv-btn:hover { background: #5865F2; }
.logo.on .srv-btn img, .logo .srv-btn:hover img { filter: brightness(0) invert(1); }

/* Channel sidebar */
.side { width: 240px; background: var(--bg-side); display: flex; flex-direction: column; min-height: 0; }
.side-head { height: 52px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); }
.side-head h2 { margin: 0; font: 700 16px/1.2 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); flex: none; }
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn[hidden] { display: none; }
.chan-scroll { flex: 1; overflow-y: auto; padding: 14px 8px; }
.cat { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 6px 8px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.cat .icon-btn { width: 22px; height: 22px; }
.chan { width: 100%; display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 6px; color: var(--muted); font-weight: 500; text-align: left; }
.chan:hover { background: var(--bg-hover); color: var(--text); }
.chan.on { background: var(--bg-raised); color: var(--text); }
.chan .hash { color: var(--faint); font-size: 18px; line-height: 1; width: 16px; text-align: center; }
.chan span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-empty { padding: 8px; color: var(--muted); font-size: 14px; }

.me-bar { flex: none; height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 10px; background: var(--bg-me); }
.me-bar .who { min-width: 0; flex: 1; }
.me-bar .nm { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-bar .st { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Avatars */
.av { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden; color: #fff; font: 700 15px/1 var(--font-display); position: relative; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.sm { width: 32px; height: 32px; font-size: 13px; }
.av-wrap { position: relative; flex: none; }
.dot { position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--bg-side); background: var(--faint); }
.dot.on { background: var(--online); }

/* Main chat */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg-chat); }
.top { height: 52px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); }
.top .hash { color: var(--faint); font-size: 22px; line-height: 1; }
.top h1 { margin: 0; font: 700 16px/1.2 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .sub { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 10px; border-left: 1px solid var(--line); }
.top .grow { flex: 1; }
.menu-btn { display: none; }
.icon-btn.active { color: var(--text); background: var(--bg-raised); }

.banner { flex: none; padding: 8px 16px; font-size: 13px; background: var(--accent-soft); color: var(--accent-text); border-bottom: 1px solid var(--accent-soft); }
.banner[hidden] { display: none; }

.feed { flex: 1; overflow-y: auto; padding: 16px 0 8px; overflow-anchor: none; display: flex; flex-direction: column; }
.feed > * { flex-shrink: 0; }
/* the welcome sits at the bottom of a short channel, just above the message box */
.feed > .intro { margin-top: auto; }
.intro { padding: 16px 16px 8px; }
.intro .big { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-raised); font-size: 42px; font-weight: 400; line-height: 1; color: var(--text); margin-bottom: 8px; }
.intro h3 { margin: 0 0 8px; font: 800 32px/1.2 var(--font-display); text-wrap: balance; overflow-wrap: anywhere; }
.intro p { margin: 0; color: var(--muted); font-size: 16px; }
.intro-edit { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; height: 32px; padding: 0 12px; border-radius: 8px; background: var(--bg-raised); color: var(--text); font-size: 14px; font-weight: 600; }
.intro-edit:hover { background: var(--bg-hover); }
.intro-edit svg { display: block; }
.wave-signal { display: inline-flex; align-items: center; gap: 10px; height: 48px; margin-top: 16px; padding: 0 18px; border-radius: 999px; background: #101014; color: #f4f5f7; font-size: 15px; font-weight: 650; transition: background .15s, transform .15s; }
.wave-signal:hover { background: #09090c; transform: translateY(-1px); }
.wave-signal:active { transform: scale(.97); }
.wave-signal .wave-icon { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 8px; flex: 0 0 auto; pointer-events: none; }
.wave-signal .wave-icon .tenor-wave-embed { width: 54px !important; max-width: 54px !important; margin: 0 !important; }
.wave-signal .wave-icon .tenor-gif-embed { width: 54px !important; min-width: 54px !important; margin: 0 !important; }
.wave-signal .wave-icon iframe { pointer-events: none !important; }
.tenor-wave-embed { width: 128px; height: 140px; max-width: 100%; margin: 6px 0; border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.tenor-wave-embed .tenor-gif-embed { width: 100% !important; margin: 0 !important; }
.tenor-wave-embed .wave-gif { display:block; width:100%; height:100%; max-width:128px; max-height:140px; object-fit:contain; object-position:center; border-radius:10px; }
.wave-signal .wave-icon .tenor-wave-embed { width:44px !important; height:44px !important; margin:0 !important; }
.wave-signal .wave-icon .wave-gif { width:44px !important; height:44px !important; max-width:44px !important; max-height:44px !important; object-fit:contain !important; border-radius:8px; }
.wave-signal:disabled { opacity: .45; cursor: not-allowed; transform: none; }
/* wave back: under unanswered messages, and on message requests */
.wave-reply { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; margin: 14px 16px 6px; padding: 4px 4px 12px 16px; border-radius: 12px; border: 1px dashed var(--line); color: var(--muted); font-size: 14px; }
.wave-reply b { color: var(--text); }
.wave-reply .wave-signal { margin-top: 8px; }
.wave-signal.rq-wave { height: 34px; margin-top: 0; padding: 0 12px 0 4px; gap: 6px; font-size: 14px; }
.wave-signal.rq-wave .wave-icon { width: 30px; height: 30px; border-radius: 6px; }
.wave-signal.rq-wave .wave-icon .tenor-wave-embed, .wave-signal.rq-wave .wave-icon .wave-gif { width: 30px !important; height: 30px !important; max-width: 30px !important; max-height: 30px !important; }

.day { display: flex; align-items: center; gap: 10px; margin: 18px 16px 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.day::before, .day::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.group { margin-top: 14px; }
.msg.first { padding-top: 4px; }
.msg .av-abs { position: absolute; left: 16px; top: 6px; }
.msg.first.has-reply .av-abs { top: 28px; }
.ghead { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.ghead .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ghead .tm { font-size: 12px; color: var(--faint); white-space: nowrap; }
.bot-tag { font-size: 10px; font-weight: 700; letter-spacing: .04em; background: var(--accent); color: var(--accent-ink); padding: 1px 5px; border-radius: 4px; align-self: center; }
.msg { position: relative; padding: 2px 16px 2px 72px; }
.msg:hover, .msg.picking { background: var(--bg-hover); }
.msg .htm { position: absolute; left: 16px; width: 44px; top: 5px; font-size: 11px; color: var(--faint); text-align: right; opacity: 0; font-variant-numeric: tabular-nums; }
.msg:hover .htm { opacity: 1; }
.body { overflow-wrap: anywhere; white-space: pre-wrap; font-size: var(--chat-size); }
.body a { color: var(--link); text-decoration: none; }
.body a:hover { text-decoration: underline; }
.body code { font: 13px/1.4 var(--font-mono); background: var(--bg-rail); padding: 1px 5px; border-radius: 4px; }
.body pre { margin: 4px 0; padding: 10px 12px; background: var(--bg-rail); border: 1px solid var(--line); border-radius: 6px; font: 13px/1.5 var(--font-mono); white-space: pre-wrap; overflow-x: auto; }
.body .mention { background: var(--accent-soft); color: var(--accent-text); border-radius: 4px; padding: 0 3px; font-weight: 500; }

.rxs { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 2px; }
.rx { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px; border-radius: 8px; background: var(--bg-raised); border: 1px solid transparent; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); }
.rx:hover { border-color: var(--faint); }
.rx.mine { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }

.tools { position: absolute; right: 16px; top: -16px; display: none; background: var(--bg-raised); border: 1px solid var(--line); border-radius: 8px; padding: 2px; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.msg:hover .tools, .msg.picking .tools { display: flex; }
.tools button { height: 30px; min-width: 30px; padding: 0 6px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); font-size: 13px; font-weight: 600; }
.tools button:hover { background: var(--bg-hover); color: var(--text); }
.tools button.confirm { color: var(--danger); }

.picker { position: fixed; z-index: 40; display: grid; grid-template-columns: repeat(4, 38px); gap: 4px; padding: 8px; background: var(--bg-raised); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.picker[hidden] { display: none; }
.picker button { width: 38px; height: 38px; border-radius: 8px; font-size: 22px; }
.picker button:hover { background: var(--bg-hover); }

.compose-wrap { flex: none; padding: 0 16px 6px; }
.compose { display: flex; align-items: flex-end; gap: 8px; background: var(--bg-raised); border-radius: 10px; padding: 0 8px 0 14px; }
.compose textarea { flex: 1; resize: none; border: 0; background: none; color: var(--text); font: inherit; padding: 12px 0; max-height: 220px; min-height: 46px; line-height: 22px; outline: none; }
.compose textarea::placeholder { color: var(--faint); }
.compose textarea:disabled { cursor: not-allowed; }
.send { height: 34px; width: 34px; margin-bottom: 6px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.send:not(:disabled):hover { background: var(--accent); color: var(--accent-ink); }
.send:disabled { opacity: .4; cursor: default; }
.typing { height: 22px; padding: 2px 16px 0; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.typing b { color: var(--text); font-weight: 600; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.empty-state { flex: 1; display: grid; place-items: center; padding: 24px; text-align: center; }
.empty-state h3 { margin: 0 0 6px; font: 700 24px/1.2 var(--font-display); }
.empty-state p { margin: 0 0 16px; color: var(--muted); max-width: 40ch; }
.btn { height: 38px; padding: 0 16px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--text); }
.btn.ghost:hover { background: var(--bg-hover); filter: none; }

/* Members */
.members { width: 240px; background: var(--bg-side); overflow-y: auto; padding: 16px 8px; }
.members[hidden] { display: none; }
.members h4 { margin: 12px 8px 6px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.members h4:first-child { margin-top: 0; }
.mem { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; }
.mem:hover { background: var(--bg-hover); }
.mem .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.mem.off { opacity: .45; }
.mem .you { color: var(--faint); font-size: 12px; margin-left: 2px; }

/* Modal + toast */
.scrim { position: fixed; inset: 0; background: rgba(4,5,8,.65); z-index: 50; display: grid; place-items: center; padding: 16px; }
.scrim[hidden] { display: none; }
.modal { width: min(440px, 100%); background: var(--bg-chat); border: 1px solid var(--line); border-radius: 12px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.modal h3 { margin: 0 0 6px; font: 700 22px/1.2 var(--font-display); }
.modal p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.modal label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.modal input { width: 100%; height: 42px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-rail); color: var(--text); font: inherit; padding: 0 12px; }
.modal .row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.modal .err { color: var(--danger); font-size: 13px; margin-top: 6px; min-height: 18px; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--bg-raised); border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.4); font-size: 14px; max-width: calc(100% - 32px); }
.toast[hidden] { display: none; }
.drawer-scrim { display: none; }

/* Status dots */
.dot.s-online { background: var(--online); }
.dot.s-idle { background: var(--idle); }
.dot.s-dnd { background: var(--danger); }
.dot.s-invisible, .dot.s-offline { background: var(--faint); }
[data-uid] { cursor: pointer; }
.ghead .nm[data-uid]:hover { text-decoration: underline; }

/* Me bar */
.me-btn { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; padding: 4px; margin-left: -4px; border-radius: 8px; text-align: left; }
.me-bar { gap: 4px; padding: 0 6px 0 10px; }
.me-ctl { display: flex; align-items: center; gap: 0; flex: none; }
.me-ctl .icon-btn { width: 32px; height: 32px; }
.vgroup { display: flex; align-items: center; border-radius: 8px; transition: background-color .14s; }
.vgroup:hover, .vgroup.open { background: var(--bg-hover); }
.vgroup .vbtn { width: 30px; height: 32px; border-radius: 8px 0 0 8px; }
.vgroup .vbtn:hover { background: transparent; }
.vbtn.off { color: var(--danger); }
.vbtn.off:hover { color: var(--danger); }
.vcaret { width: 16px; height: 32px; display: grid; place-items: center; color: var(--muted); border-radius: 0 8px 8px 0; transition: color .14s; }
.vcaret svg { transition: transform .18s var(--ease-out); }
.vgroup.open .vcaret svg { transform: rotate(180deg); }
.vcaret:hover { color: var(--text); }
.vmenu { position: fixed; z-index: 85; width: 240px; padding: 8px; border-radius: 12px; background: var(--bg-card); border: 1px solid var(--line); box-shadow: 0 14px 40px rgba(0,0,0,.55); animation: pop-in .16s var(--ease-out); transform-origin: bottom left; }
.vmenu[hidden] { display: none; }
.vmenu.closing { animation: pop-out .12s ease-in forwards; }
.vm-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px; border-radius: 8px; text-align: left; color: var(--text); }
.vm-row:not(:disabled):hover { background: var(--bg-hover); }
.vm-row:disabled { cursor: default; }
.vm-row:disabled .chev { opacity: .4; }
.vm-tx { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.vm-tx b { font-size: 15px; }
.vm-tx span { font-size: 12px; color: var(--muted); }
.vm-link { justify-content: flex-start; font-weight: 600; gap: 10px; }
.vm-link svg { color: var(--muted); }
.vm-sep { height: 1px; background: var(--line); margin: 6px 8px; }
.vm-vol, .vm-level { padding: 6px 8px; }
.vol { display: flex; flex-direction: column; gap: 8px; }
.vol + .vol { margin-top: 16px; }
.vol-top { display: flex; justify-content: space-between; align-items: baseline; }
.vol-top span { font: 600 12px/1 var(--font-mono); color: var(--muted); }
.vol input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 4px; background: linear-gradient(to right, var(--accent) var(--fill, 50%), var(--bg-raised) var(--fill, 50%)); cursor: pointer; }
.vol input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.vol input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.vm-level b { display: block; margin-bottom: 8px; }
.lv-bars { display: flex; gap: 3px; height: 18px; }
.lv-bars i { flex: 1; border-radius: 2px; background: var(--bg-raised); }
.vm-note { display: block; margin-top: 6px; font-size: 11px; color: var(--faint); }
.me-btn:hover { background: var(--bg-hover); }
.mem .mtext { min-width: 0; display: flex; flex-direction: column; }
.mem .cs { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }


/* Discord-like status flyout: hover the current status, then click a choice. */
.pcard .pc-menu .pc-item.status-trigger { cursor:pointer; }
.pcard:has(.status-flyout.open) { overflow:visible; }
.pcard .pc-sub.status-flyout {
  position:fixed; z-index:100; width:300px; max-width:calc(100vw - 16px);
  display:none; grid-template-rows:1fr; padding:8px;
  border:1px solid #35363d; border-radius:10px;
  background:#28292f; box-shadow:0 12px 32px rgba(0,0,0,.5);
  transition:none; overflow:visible;
}
.pcard .pc-sub.status-flyout.open { display:grid; }
.pcard .pc-sub.status-flyout .pc-opt { opacity:1; transform:none; min-height:44px; align-items:center; border-radius:6px; }
.pcard .pc-sub.status-flyout .pc-opt:hover { background:#383940; }
.pcard .pc-sub.status-flyout .pc-opt .d { margin-top:2px; }
.pcard .pc-sub.status-flyout .pc-sub-in { overflow:visible; }

/* Profile card */
.pcard { position: fixed; z-index: 45; width: 300px; max-width: calc(100vw - 16px); max-height: calc(100% - 16px); overflow-y: auto; background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 44px rgba(0,0,0,.6); scrollbar-width: none; }
.pcard[hidden] { display: none; }
.pc { position: relative; background: var(--bg-card); }
.pc-banner { height: 106px; background-size: cover; background-position: center; border-radius: 11px 11px 0 0; }
.pc-av { position: absolute; left: 16px; top: 58px; }
.pc-av .av { width: 84px; height: 84px; font-size: 30px; box-shadow: 0 0 0 6px var(--bg-card); }
.pc-av .dot { width: 22px; height: 22px; border-width: 5px; border-color: var(--bg-card); right: -2px; bottom: -2px; }
.pc-bubble { position: absolute; left: 116px; right: 14px; top: 92px; min-height: 40px; display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--bg-bubble); border: 1px solid var(--line); border-radius: 14px; font-size: 13px; line-height: 1.3; text-align: left; }
.pc-bubble .bt { overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-bubble.empty { color: var(--muted); font-style: italic; }
.pc-bubble[role=button] { cursor: pointer; }
.pc-bubble[role=button]:hover { border-color: var(--faint); }
.pc-bubble .b1, .pc-bubble .b2 { position: absolute; border-radius: 50%; background: var(--bg-bubble); border: 1px solid var(--line); }
.pc-bubble .b1 { width: 12px; height: 12px; left: -10px; top: 8px; }
.pc-bubble .b2 { width: 6px; height: 6px; left: -18px; top: 2px; }
.pc-bubble svg { flex: none; color: var(--muted); }
.pc-bubble input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font: inherit; font-style: normal; outline: none; padding: 0; }
.pc-body { padding: 62px 16px 16px; }
.pc-body h3 { margin: 0; font: 700 21px/1.2 var(--font-display); overflow-wrap: anywhere; }
.pc-user { color: var(--text); font-size: 14px; margin-top: 2px; overflow-wrap: anywhere; }
.pc-user .pr { color: var(--muted); }
.pc-bio { margin: 8px 0 0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.pc-sec { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.pc-sec h5 { margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.pc-sec p { margin: 0; font-size: 14px; color: var(--muted); }
.pc-menu { margin-top: 12px; background: var(--bg-menu); border-radius: 8px; padding: 4px; }
.pc-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 10px; border-radius: 6px; font-size: 14px; font-weight: 500; color: var(--text); text-align: left; }
.pc-item + .pc-item, .pc-item + .pc-sub, .pc-sub + .pc-item { border-top: 1px solid var(--line); border-radius: 0 0 6px 6px; }
.pc-item:hover { background: var(--bg-hover); }
.pc-item .ic { width: 18px; height: 18px; display: grid; place-items: center; color: var(--muted); flex: none; }
.pc-item .lab { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-item .chev { color: var(--muted); transition: transform .15s; }
.pc-item[aria-expanded=true] .chev { transform: rotate(90deg); }
.pc-item .dot { position: static; border: 0; width: 12px; height: 12px; }
.pc-sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s cubic-bezier(.2,.8,.2,1); }
.pc-sub.open { grid-template-rows: 1fr; }
.pc-sub-in { overflow: hidden; min-height: 0; }
.pc-sub-in > :first-child { margin-top: 2px; }
.pc-sub-in > :last-child { margin-bottom: 4px; }
.pc-sub .pc-opt { opacity: 0; transform: translateY(-4px); transition: opacity .18s, transform .18s, background-color .12s; }
.pc-sub.open .pc-opt { opacity: 1; transform: none; }
.pc-sub.open .pc-opt:nth-child(2) { transition-delay: .03s, .03s, 0s; }
.pc-sub.open .pc-opt:nth-child(3) { transition-delay: .06s, .06s, 0s; }
.pc-sub.open .pc-opt:nth-child(4) { transition-delay: .09s, .09s, 0s; }
.pc-opt { width: 100%; display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px 8px 14px; border-radius: 6px; text-align: left; font-size: 14px; }
.pc-opt:hover { background: var(--bg-hover); }
.pc-opt .dot { position: static; border: 0; width: 10px; height: 10px; margin-top: 5px; flex: none; }
.pc-opt .d { display: block; font-size: 12px; color: var(--muted); }
.pc-opt[aria-checked=true] { background: var(--accent-soft); }
.pc-item.danger { color: var(--danger); }
.pc-item.danger .ic { color: var(--danger); }
.pe-preview .pc { border: 1px solid var(--line); border-radius: 12px; }

/* Profile editor */
.pedit { width: min(760px, 100%); max-height: calc(100% - 8px); overflow-y: auto; background: var(--bg-chat); border: 1px solid var(--line); border-radius: 12px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.pedit > h3 { margin: 0 0 4px; font: 700 22px/1.2 var(--font-display); }
.pedit > p { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.pe-grid { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
.pe-form { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pe-field label, .pe-field .lbl { display: block; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.pe-field input[type=text], .pe-field textarea { width: 100%; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-rail); color: var(--text); font: inherit; padding: 10px 12px; }
.pe-field input[type=text] { height: 42px; padding: 0 12px; }
.pe-field textarea { resize: vertical; min-height: 84px; }
.pe-hint { font-size: 12px; color: var(--faint); margin-top: 4px; display: flex; justify-content: space-between; gap: 8px; }
.pe-pic { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pe-pic .btn { height: 34px; padding: 0 12px; font-size: 14px; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.sw[aria-checked=true] { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg-chat) inset; }
.sw.auto { background: var(--bg-raised); display: grid; place-items: center; font-size: 11px; color: var(--muted); font-weight: 700; }
.stat-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stat-opt { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); font-size: 14px; text-align: left; }
.stat-opt:hover { background: var(--bg-hover); }
.stat-opt[aria-checked=true] { border-color: var(--accent); background: var(--accent-soft); }
.stat-opt .dot { position: static; border: 0; width: 10px; height: 10px; flex: none; }
.pe-preview { position: sticky; top: 0; }
.pe-preview .lbl { display: block; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.pe-preview .pc { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg-side); }
.pe-row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.pe-err { color: var(--danger); font-size: 13px; margin-right: auto; align-self: center; }

/* Responsive */
@media (max-width: 1100px) {
  .members { position: fixed; right: 0; top: 52px; bottom: 0; z-index: 30; box-shadow: -10px 0 30px rgba(0,0,0,.4); }
}
@media (max-width: 760px) {
  .pe-grid { grid-template-columns: 1fr; }
  .pe-preview { position: static; order: -1; }
  .app { grid-template-columns: 1fr; }
  .nav { position: fixed; left: 0; top: 0; bottom: 0; z-index: 35; transform: translateX(-100%); transition: transform .2s; box-shadow: 10px 0 30px rgba(0,0,0,.4); }
  .nav.open { transform: none; }
  .drawer-scrim.open { display: block; position: fixed; inset: 0; background: rgba(4,5,8,.55); z-index: 34; }
  .menu-btn { display: grid; }
  .top .sub { display: none; }
  .tools { right: 8px; }
}
/* ---------- Unread, badges ---------- */
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font: 700 11px/18px var(--font-body); text-align: center; font-variant-numeric: tabular-nums; flex: none; }
.srv .badge { position: absolute; right: -4px; bottom: -4px; height: 22px; min-width: 22px; line-height: 16px; border: 3px solid var(--bg-rail); border-radius: 11px; pointer-events: none; }
.srv.unread::before { height: 8px; }
.srv.unread:hover::before { height: 18px; }
.logo.on .srv-btn { border-radius: 16px; }
.logo .srv-btn { border-radius: 16px; }
.logo .srv-btn:hover, .logo.on .srv-btn { border-radius: 16px; }
.chan-row { position: relative; display: flex; align-items: center; }
.chan-row .chan { flex: 1; min-width: 0; }
.chan .cn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.chan.unread { color: var(--text); font-weight: 650; }
.chan.unread::before, .dm-row.unread::before { content: ""; position: absolute; left: -8px; top: 50%; width: 4px; height: 8px; margin-top: -4px; border-radius: 0 4px 4px 0; background: var(--text); }
.chan .badge { margin-left: auto; }
.cgear { position: absolute; right: 4px; opacity: 0; width: 24px; height: 24px; }
.chan-row:hover .cgear, .cgear:focus-visible { opacity: 1; }
.chan-row:hover .chan .badge { visibility: hidden; }
.side-head h2 { cursor: default; }
.side-head .grow { flex: 1; }
.dm-row { position: relative; width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; color: var(--muted); text-align: left; margin-bottom: 2px; }
.dm-row:hover { background: var(--bg-hover); color: var(--text); }
.dm-row.on { background: var(--bg-raised); color: var(--text); }
.dm-row.unread { color: var(--text); font-weight: 650; }
.dm-row .mtext { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dm-row .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.dm-row.unread .nm { font-weight: 700; }
.dm-row .cs { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.dm-row .dot { border-color: var(--bg-side); }
/* DM list items: pin icon, hover close button */
.dm-item { position: relative; margin-bottom: 2px; }
/* Message requests */
.rq-row { display: flex; align-items: center; gap: 12px; padding: 14px 10px; border-top: 1px solid var(--line); border-radius: 8px; transition: background-color .12s; }
.rq-row:hover { background: var(--bg-hover); border-top-color: transparent; }
.rq-row:hover + .rq-row { border-top-color: transparent; }
.rq-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rq-top { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.rq-top b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rq-top .un { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rq-top .ago { font-size: 12px; color: var(--faint); white-space: nowrap; flex: none; }
.rq-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rq-prev { font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rq-acts { display: flex; align-items: center; gap: 8px; flex: none; }
.rq-acts .btn { height: 34px; padding: 0 14px; font-size: 14px; }
.btn.neutral { background: var(--bg-raised); color: var(--text); }
.btn.neutral:hover { background: var(--bg-hover); filter: none; }
.rq-flag { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); transition: background-color .12s, color .12s; }
.rq-flag:hover { background: var(--bg-raised); color: var(--danger); }
.rq-note { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.f-tab .badge { margin-left: 2px; }
@media (max-width: 560px) { .rq-row { flex-wrap: wrap; } .rq-acts { width: 100%; justify-content: flex-end; } }
.dm-item .dm-row { margin-bottom: 0; transition: background-color .14s, color .14s, padding .12s; }
.dm-item:hover .dm-row, .dm-item:focus-within .dm-row { padding-right: 34px; }
.dm-item:hover .dm-row .badge { visibility: hidden; }
.dm-pin { flex: none; width: 18px; height: 18px; display: grid; place-items: center; color: var(--muted); }
.dm-pin svg { display: block; }
.dm-x { position: absolute; right: 6px; top: 50%; width: 24px; height: 24px; margin-top: -12px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); opacity: 0; transition: opacity .12s, color .12s, background-color .12s; }
.dm-item:hover .dm-x, .dm-x:focus-visible { opacity: 1; }
.dm-x:hover { color: var(--text); background: var(--bg-raised); }

.new-divider { position: relative; height: 0; margin: 14px 16px 6px; border-top: 1px solid var(--danger); }
.new-divider span { position: absolute; right: 0; top: -9px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; }
.msg.mentioned { background: rgba(240,178,50,.08); box-shadow: inset 2px 0 0 var(--idle); }
.msg.mentioned:hover { background: rgba(240,178,50,.12); }
.body .mention.me { background: rgba(240,178,50,.22); color: var(--mention-me); }
.msg.replying { background: rgba(43,199,168,.08); box-shadow: inset 2px 0 0 var(--accent); }
@keyframes flash { 0%, 40% { background: rgba(43,199,168,.22); } 100% { background: transparent; } }
.msg.flash { animation: flash 1.6s ease-out; }

/* ---------- Replies & editing ---------- */
.reply-ref { display: flex; align-items: center; gap: 6px; max-width: 100%; margin: 0 0 3px; padding: 0; font-size: 13px; color: var(--muted); text-align: left; position: relative; }
.reply-ref::before { content: ""; position: absolute; left: -36px; top: 50%; width: 28px; height: 12px; border-left: 2px solid var(--line); border-top: 2px solid var(--line); border-top-left-radius: 6px; }
.reply-ref:not(:disabled):hover .rt { color: var(--text); }
.reply-ref .rn { font-weight: 600; color: var(--text); white-space: nowrap; flex: none; }
.reply-ref .rt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.reply-ref .ri { font-style: italic; display: inline-flex; align-items: center; gap: 4px; }
.reply-ref .ri svg { display: inline; }
.av.xs { width: 16px; height: 16px; font-size: 8px; flex: none; }
.av.xl { width: 80px; height: 80px; font-size: 30px; margin-bottom: 10px; }
.ghead .nbadges { display: inline-flex; align-items: center; gap: 2px; align-self: center; }
.edited { font-size: 11px; color: var(--faint); }
.edit-box { margin: 4px 0 2px; }
.edit-box textarea { width: 100%; resize: none; border: 0; border-radius: 8px; background: var(--bg-raised); color: var(--text); font: inherit; padding: 10px 12px; line-height: 22px; outline: none; }
.edit-box textarea:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.edit-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.linkish { color: var(--link); font-size: 12px; }
.linkish:hover { text-decoration: underline; }
.crown-wrap { display: inline-flex; align-items: center; align-self: center; vertical-align: middle; }
.crown-wrap .server-owner-badge { width: 17px; height: 17px; object-fit: contain; display: block; }

/* ---------- Composer extras ---------- */
.compose-wrap { position: relative; }
.reply-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 6px 14px; background: var(--bg-reply); border-radius: 10px 10px 0 0; font-size: 13px; color: var(--muted); animation: rise .16s var(--ease-out); }
.reply-bar[hidden] { display: none; }
.reply-bar b { color: var(--text); }
.mem { width: 100%; text-align: left; }
.reply-bar .icon-btn { width: 24px; height: 24px; }
.compose-wrap.has-top .compose { border-top-left-radius: 0; border-top-right-radius: 0; }
.reply-bar + .pending:not([hidden]) { border-radius: 0; }
.pending { display: flex; gap: 10px; padding: 12px; background: var(--bg-raised); border-radius: 10px 10px 0 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.pending[hidden] { display: none; }
.pend { position: relative; width: 132px; flex: none; background: var(--bg-side); border-radius: 8px; padding: 6px; animation: pop-in .18s var(--ease-out); }
.pend img { width: 100%; height: 96px; object-fit: cover; border-radius: 4px; display: block; }
.pend-n { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pend-x { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; background: var(--bg-raised); border: 1px solid var(--line); display: grid; place-items: center; color: var(--danger); }
.pend-x:hover { background: var(--danger); color: #fff; }
.attach { width: 30px; height: 30px; margin: 0 2px 8px -6px; display: grid; place-items: center; color: var(--muted); border-radius: 50%; flex: none; align-self: flex-end; }
.attach:not(:disabled):hover { color: var(--text); }
.attach:disabled { opacity: .4; cursor: default; }
.drop-zone { position: absolute; inset: 0; z-index: 25; display: grid; place-items: center; background: rgba(12,14,19,.82); animation: fade-in .12s ease-out; pointer-events: none; }
.drop-zone[hidden] { display: none; }
.drop-zone > div { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 32px 48px; border: 2px dashed var(--accent); border-radius: 16px; color: var(--text); text-align: center; }
.drop-zone b { font: 700 20px/1.2 var(--font-display); }
.drop-zone span { color: var(--muted); font-size: 14px; }
.main { position: relative; }

/* ---------- Images ---------- */
.imgs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.att { display: block; max-width: 100%; border-radius: 8px; overflow: hidden; background: var(--bg-raised); cursor: zoom-in; padding: 0; position: relative; }
.att img { display: block; width: 100%; height: 100%; object-fit: cover; }
.att.loading { animation: shimmer 1.2s ease-in-out infinite; }
.att.broken { cursor: default; display: grid; place-items: center; font-size: 12px; color: var(--muted); min-height: 60px; }
@keyframes shimmer { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }
.lightbox { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(4,5,8,.88); padding: 24px; animation: fade-in .16s ease-out; }
.lightbox[hidden] { display: none; }
.lightbox.closing { animation: fade-out .14s ease-in forwards; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 80px); border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.6); animation: pop-in .22s var(--ease-out); }
.lb-x { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; background: rgba(255,255,255,.08); color: var(--text); border-radius: 50%; }

/* ---------- Settings, people ---------- */
.settings { width: min(640px, 100%); }
.people-box { width: min(440px, 100%); }
.set-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.set-head h3 { margin: 0; font: 700 22px/1.2 var(--font-display); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { padding: 8px 12px; border-radius: 6px 6px 0 0; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .14s, border-color .14s; }
.tab:hover { color: var(--text); }
.tab[aria-selected=true] { color: var(--text); border-bottom-color: var(--accent); }
.set-body { display: flex; flex-direction: column; gap: 14px; }
.set-row { display: flex; gap: 8px; }
.set-row input { flex: 1; min-width: 0; height: 40px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-rail); color: var(--text); font: inherit; padding: 0 12px; }
.set-note { margin: 0; color: var(--muted); font-size: 14px; }
.set-note b { color: var(--text); }
.err { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 4px; }
.danger-zone { border: 1px solid rgba(255,93,108,.35); border-radius: 10px; padding: 14px; }
.danger-zone h4 { margin: 0 0 4px; font-size: 15px; }
.danger-zone p { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger.armed { background: #c9303f; }
.danger-t { color: var(--danger) !important; }
.danger-t.armed { background: rgba(255,93,108,.15) !important; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.modal .row #mDanger { margin-right: auto; }
.people-list { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow-y: auto; }
.prow { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; width: 100%; text-align: left; }
.prow:hover { background: var(--bg-hover); }
.prow .nm { flex: 1; min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow select { height: 30px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg-rail); color: var(--text); font: inherit; font-size: 13px; padding: 0 6px; }
.prow select:disabled { opacity: .5; }
.role-fixed { font-size: 12px; font-weight: 700; color: var(--idle); padding: 0 6px; }
.prow .dot { border-color: var(--bg-chat); }
.prow.pick .dot { border-color: var(--bg-chat); }
#ppSearch { width: 100%; height: 42px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-rail); color: var(--text); font: inherit; padding: 0 12px; margin-bottom: 10px; }
.role-pill { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 2px 8px; border-radius: 6px; background: var(--bg-menu); font-size: 12px; font-weight: 600; }
.role-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--rc); }
.pc-msg { width: 100%; margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.pc-msg svg { display: inline; }
.pc-item.armed { background: rgba(255,93,108,.12); }
.members.dm-panel { padding: 0; background: var(--bg-card); }
.members.dm-panel .pc { min-height: 100%; }
.intro .av.xl { box-shadow: none; }

/* ---------- Badges ---------- */
.pc-badges { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 10px; padding: 4px 6px; border-radius: 10px; background: var(--bg-menu); border: 1px solid var(--line); }
.bdg { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; cursor: default; transition: transform .14s var(--ease-out), background-color .14s; }
.bdg:hover, .bdg:focus-visible { transform: translateY(-2px) scale(1.12); background: rgba(255,255,255,.06); }
.bdg svg, .bdg-ic svg, .mini-badges svg, .shape-opt svg { display: block; }
.tip { position: fixed; z-index: 90; max-width: 220px; padding: 6px 10px; border-radius: 8px; background: #08090c; color: #f2f3f5; font-size: 13px; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.5); pointer-events: none; white-space: nowrap; }
.tip[hidden] { display: none; }
.tip::after { content: ""; position: absolute; left: var(--ax, 50%); bottom: -5px; width: 10px; height: 10px; margin-left: -5px; background: #08090c; transform: rotate(45deg); border-radius: 2px; }
.tip.below::after { bottom: auto; top: -5px; }
.tip.show { animation: tip-in .12s var(--ease-out); }
@keyframes tip-in { from { opacity: 0; transform: translateY(3px); } }
.tip.below.show { animation-name: tip-in-b; }
@keyframes tip-in-b { from { opacity: 0; transform: translateY(-3px); } }
.badges-ed { width: min(760px, 100%); }
.bgive { display: grid; grid-template-columns: 260px 1fr; gap: 18px; min-height: 340px; }
.bg-left { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.b-search { width: 100%; height: 38px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-rail); color: var(--text); font: inherit; padding: 0 12px; }
.bgive .people-list { max-height: 380px; }
.prow.sel { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.prow .mtext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mini-badges { display: flex; gap: 3px; }
.bg-right { min-width: 0; }
.bg-who { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 16px; }
.blist { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; max-height: 360px; overflow-y: auto; }
.brow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); text-align: left; transition: border-color .14s, background-color .14s; }
.brow:hover { background: var(--bg-hover); }
.brow[aria-checked=true] { border-color: rgba(43,199,168,.55); background: var(--accent-soft); }
.brow .nm { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bdg-ic { display: grid; place-items: center; flex: none; }
.switch { width: 34px; height: 20px; border-radius: 10px; background: var(--bg-raised); border: 1px solid var(--line); position: relative; flex: none; transition: background-color .16s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .18s var(--ease-out), background-color .16s; }
.brow[aria-checked=true] .switch { background: var(--accent); border-color: var(--accent); }
.brow[aria-checked=true] .switch::after { transform: translateX(14px); background: #fff; }
.bcreate { display: grid; grid-template-columns: 1fr 260px; gap: 22px; }
.bcreate input[type=text] { width: 100%; height: 42px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-rail); color: var(--text); font: inherit; padding: 0 12px; }
.shape-grid { display: grid; grid-template-columns: repeat(auto-fill, 42px); gap: 6px; }
.shape-opt { width: 42px; height: 42px; border-radius: 8px; border: 1px solid var(--line); display: grid; place-items: center; transition: border-color .14s, background-color .14s, transform .14s; }
.shape-opt:hover { background: var(--bg-hover); transform: translateY(-1px); }
.shape-opt[aria-checked=true] { border-color: var(--accent); background: var(--accent-soft); }
.b-preview { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.b-preview .lbl { width: 100%; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.b-preview .pc-badges { margin: 0; }
.b-prev-name { font-weight: 600; }
.bc-side .lbl { display: block; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.bcount { font-size: 12px; color: var(--muted); white-space: nowrap; }
.bcreate .btn { align-self: flex-start; }
.badges-ed .err { margin-top: 0; }
@media (max-width: 760px) { .bgive, .bcreate { grid-template-columns: 1fr; } }

/* ---------- Badges v2 ---------- */
.pc-name { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.pc-name .pc-badges { margin: 0; padding: 2px 4px; gap: 1px; border-radius: 8px; }
.pc-name .bdg { width: 24px; height: 24px; }
.bdg.sm { width: 20px; height: 20px; border-radius: 4px; }
.bdg.sm:hover, .bdg.sm:focus-visible { transform: translateY(-1px) scale(1.15); }
.bcustom { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: var(--bg-side); }
.bcustom h4 { margin: 0 0 2px; font-size: 16px; }
.bcustom > p { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.ctiles { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ctile { position: relative; width: 52px; height: 52px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-raised); display: grid; place-items: center; transition: border-color .14s, background-color .14s; }
.ctile:hover, .ctile:focus-within { border-color: var(--faint); }
.ctile.hidden-b .bdg-ic { opacity: .3; filter: grayscale(.6); }
.hid-ov { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text); pointer-events: none; }
.hid-ov svg { width: 22px; height: 22px; }
.ctile-more { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; background: var(--bg-chat); border: 1px solid var(--line); color: var(--muted); display: grid; place-items: center; opacity: 0; transform: scale(.8); transition: opacity .14s, transform .14s var(--ease-out), color .14s; }
.ctile:hover .ctile-more, .ctile-more:focus-visible, .ctile-more[aria-expanded=true] { opacity: 1; transform: none; }
.ctile-more:hover { color: var(--text); }
.ctile-more svg { width: 13px; height: 13px; }
.pc-badges.own { gap: 2px; }
.own-b { position: relative; display: inline-grid; }
.own-b.is-hidden .bdg { opacity: .35; filter: grayscale(.7); }
.own-more { position: absolute; top: -7px; right: -7px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg-chat); border: 1px solid var(--line); color: var(--muted); display: grid; place-items: center; opacity: 0; transform: scale(.7); transition: opacity .14s, transform .14s var(--ease-out), color .14s; z-index: 1; }
.own-more svg { width: 10px; height: 10px; }
.own-b:hover .own-more, .own-more:focus-visible { opacity: 1; transform: none; }
.own-more:hover { color: var(--text); }
.ctile.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ctile-btn { width: 100%; height: 100%; border-radius: 10px; }
.bv-left.customizing .bgrid { gap: 12px; padding-top: 8px; }
.save-bar { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 8px 8px 8px 12px; border-radius: 10px; background: var(--bg-card); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0,0,0,.35); animation: rise .2s var(--ease-out); }
.save-bar { flex-wrap: wrap; }
.save-bar span { flex: 1 1 100%; min-width: 0; font-size: 13px; font-weight: 600; }
.save-bar .btn.ghost { margin-left: auto; }
.save-bar .btn { height: 30px; padding: 0 12px; font-size: 13px; }
.save-bar.warn { border-color: var(--danger); background: linear-gradient(rgba(255,93,108,.16), rgba(255,93,108,.16)), var(--bg-card); animation: shake .45s ease-in-out; }
.save-bar.warn span { color: var(--danger); }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }
.bv-foot .save-bar { margin: 0 0 10px; }
.bv-foot .save-bar .btn { width: auto; }
.bv-foot .save-bar .btn.ghost { background: transparent; }
.bv-foot .save-bar .btn:not(.ghost) { background: var(--accent); color: var(--accent-ink); }
.btn.view-b { width: 100%; background: var(--bg-raised); }
.btn.view-b:hover { background: var(--bg-hover); }
.bmenu { position: fixed; z-index: 85; min-width: 200px; padding: 6px; border-radius: 10px; background: var(--bg-card); border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(0,0,0,.55); animation: pop-in .14s var(--ease-out); transform-origin: top left; }
.bmenu[hidden] { display: none; }
.bmenu.closing { animation: pop-out .1s ease-in forwards; }
.bm-title { padding: 4px 8px 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.bm-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 6px; font-size: 14px; font-weight: 500; text-align: left; transition: background-color .12s; }
.bm-item:hover, .bm-item:focus-visible { background: var(--bg-hover); }
.bm-item svg { color: var(--muted); flex: none; }
/* Discord-style DM right-click context menu */
#dmmenu { min-width:190px; width:196px; padding:7px; background:#24252b; border:1px solid #34353d; border-radius:9px; box-shadow:0 12px 32px rgba(0,0,0,.5); }
#dmmenu .bm-item { font-size:13px; font-weight:600; min-height:34px; padding:7px 8px; gap:10px; }
#dmmenu .bm-item svg { height:17px; width:17px; color:#b5b6c0; }
#dmmenu .bm-item {justify-content:flex-start;}
#dmmenu .bm-item:not(:has(svg)) { padding-left: 12px; }
#dmmenu .bm-item:hover { background:#5865F2; color:#fff; }
#dmmenu .bm-item:hover svg { color:#fff; }
#dmmenu .dm-context-separator { height:1px; background:#3b3c45; margin:6px 2px; }
#dmmenu .dm-context-subtext { display:block; margin-top:1px; color:#a5a6b0; font-size:11px; font-weight:400; }
#dmmenu .bm-item:hover .dm-context-subtext { color:#e1e4ff; }
#dmmenu .dm-context-danger:hover { background:#b83b48; }
#dmmenu .dm-context-star.active svg { fill:#f3f3f5; }

.pe-row { position: sticky; bottom: -22px; margin: 20px -22px -22px; padding: 12px 22px; background: var(--bg-chat); border-top: 1px solid transparent; transition: background-color .2s, border-color .2s; align-items: center; }
.pe-dirty { display: none; margin-right: auto; font-weight: 600; font-size: 14px; }
.pe-row.dirty { background: var(--bg-card); border-top-color: var(--line); }
.pe-row.dirty .pe-dirty { display: block; animation: rise .2s var(--ease-out); }
.pe-row.dirty .pe-err:empty { display: none; }
.badge-view { width: min(820px, 100%); padding: 0; display: grid; grid-template-columns: 290px 1fr; min-height: 520px; overflow: hidden; }
.bv-left { display: flex; flex-direction: column; padding: 24px; border-right: 1px solid var(--line); background: var(--bg-card); min-height: 0; overflow-y: auto; }
.bv-left h3 { margin: 0 0 4px; font: 700 22px/1.2 var(--font-display); }
.bv-left > p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.bv-left h5 { margin: 20px 0 10px; font-size: 14px; font-weight: 700; color: var(--text); }
.bgrid { display: grid; grid-template-columns: repeat(4, 52px); gap: 8px; }
.btile { position: relative; width: 52px; height: 52px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-raised); display: grid; place-items: center; transition: border-color .14s, background-color .14s, transform .14s var(--ease-out); }
.btile:hover { transform: translateY(-2px); border-color: var(--faint); }
.btile.sel { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.btile.locked svg { opacity: .55; filter: saturate(.5); }
.btile.locked:hover svg, .btile.locked.sel svg { opacity: .85; filter: none; }
.hid-dot { position: absolute; right: -5px; top: -5px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg-chat); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); }
.hid-dot svg { width: 11px; height: 11px; }
.bv-foot { margin-top: auto; padding-top: 20px; }
.bv-foot .btn { width: 100%; background: var(--bg-raised); }
.bv-right { position: relative; padding: 48px 28px 28px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.bv-x { position: absolute; top: 14px; right: 14px; }
.bv-big { margin-bottom: 10px; animation: pop-in .26s var(--ease-out); }
.bv-big svg { filter: drop-shadow(0 8px 24px rgba(0,0,0,.45)); }
.bv-big.locked svg { opacity: .5; filter: saturate(.4) drop-shadow(0 8px 24px rgba(0,0,0,.45)); }
.bv-right h2 { margin: 0; font: 800 30px/1.1 var(--font-display); text-transform: uppercase; letter-spacing: .02em; overflow-wrap: anywhere; }
.bv-meta { margin-top: 6px; color: var(--muted); font-size: 13px; }
.bv-box { margin-top: 22px; width: 100%; text-align: left; background: var(--bg-side); border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.bv-box p { margin: 0; font-size: 14px; }
.bv-small { color: var(--muted); font-size: 12px !important; }
.bv-box .btn { margin-top: 6px; }
@media (max-width: 760px) {
  .badge-view { grid-template-columns: 1fr; min-height: 0; max-height: calc(100% - 8px); overflow-y: auto; }
  .bv-left { border-right: 0; border-bottom: 1px solid var(--line); }
  .bv-right { order: -1; padding-top: 40px; }
}

/* Motion */
:root { --ease-out: cubic-bezier(.2,.8,.2,1); }
@keyframes pop-in { from { opacity: 0; transform: scale(.94) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop-out { to { opacity: 0; transform: scale(.96) translateY(6px); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.22); } 70% { transform: scale(.94); } 100% { transform: scale(1); } }
@keyframes slide-in-r { from { opacity: 0; transform: translateX(18px); } }
@keyframes slide-out-r { to { opacity: 0; transform: translateX(18px); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, 12px) scale(.97); } }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }

.pcard { animation: pop-in .18s var(--ease-out); }
.pcard.closing { animation: pop-out .13s ease-in forwards; pointer-events: none; }
.pcard.still, .pcard.still .pc-bubble, .pcard.still .pc-banner, .pcard.still .pc-av { animation: none; }
.pcard.still.closing { animation: pop-out .13s ease-in forwards; }
.picker { animation: pop-in .15s var(--ease-out); transform-origin: bottom right; }
.picker.closing { animation: pop-out .11s ease-in forwards; pointer-events: none; }
.picker button { transition: background-color .12s, transform .12s; }
.picker button:hover { transform: scale(1.15); }
.scrim { animation: fade-in .16s ease-out; }
.scrim .modal, .scrim .pedit { animation: pop-in .22s var(--ease-out); }
.scrim.closing { animation: fade-out .15s ease-in forwards; pointer-events: none; }
.scrim.closing .modal, .scrim.closing .pedit { animation: pop-out .15s ease-in forwards; }
.toast { animation: toast-in .22s var(--ease-out); }
.toast.closing { animation: toast-out .18s ease-in forwards; }
.members { animation: slide-in-r .2s var(--ease-out); }
.members.closing { animation: slide-out-r .15s ease-in forwards; }
.drawer-scrim.open { animation: fade-in .2s ease-out; }
.feed.switching { animation: fade-in .2s ease-out; }
.group.enter, .msg.enter { animation: msg-in .24s var(--ease-out); }
.rx.bump { animation: bump .34s var(--ease-out); }
.rxs .rx.new { animation: pop-in .2s var(--ease-out); }
.typing.show { animation: rise .2s var(--ease-out); }
.pc-bubble { animation: pop-in .25s .05s var(--ease-out) both; transform-origin: left center; }
.pc-banner, .pc-av { animation: fade-in .2s ease-out; }

.chan, .icon-btn, .pc-item, .pc-opt, .mem, .btn, .send, .stat-opt, .sw, .rx, .tools button, .me-btn, .srv-btn {
  transition: background-color .14s, color .14s, border-color .14s, transform .14s var(--ease-out), border-radius .18s, filter .14s;
}
.btn:active, .send:not(:disabled):active, .rx:active, .icon-btn:active, .pc-item:active, .pc-opt:active, .stat-opt:active { transform: scale(.96); }
.srv-btn:active { transform: translateY(1px); }
.sw:hover { transform: scale(1.1); }
.msg { transition: background-color .1s; }
.tools { animation: fade-in .12s ease-out; }
.av img { transition: opacity .2s; }
.compose { transition: box-shadow .15s; }
.compose:focus-within { box-shadow: 0 0 0 1px var(--line); }
.chan .hash { transition: color .14s; }
.chan:hover .hash, .chan.on .hash { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  html:not(.motion-ok) * { transition: none !important; animation: none !important; }
}
html.reduce-motion * { transition: none !important; animation: none !important; }

/* ---------- Gradient themes: panels become tinted glass over the gradient ---------- */
html.grad body { background-attachment: fixed; }
html.grad .rail { background: rgb(0 0 0 / calc(.42 + var(--gx, 0))); }
html.grad .side { background: rgb(0 0 0 / calc(.28 + var(--gx, 0))); }
html.grad .me-bar { background: rgb(0 0 0 / calc(.22 + var(--gx, 0))); }
html.grad .main { background: rgb(0 0 0 / calc(.14 + var(--gx, 0))); }
html.grad .members { background: rgb(0 0 0 / calc(.26 + var(--gx, 0))); }
html.grad .compose { background: rgba(255,255,255,.08); }
html.grad .top, html.grad .side-head { border-bottom-color: rgba(255,255,255,.08); }
html.grad .msg:hover, html.grad .msg.picking { background: rgba(0,0,0,.16); }
html.grad .chan:hover, html.grad .dm-row:hover, html.grad .mem:hover, html.grad .me-btn:hover { background: rgba(255,255,255,.07); }
html.grad .chan.on, html.grad .dm-row.on { background: rgba(255,255,255,.13); }
html.grad .ghead .tm, html.grad .day, html.grad .edited { color: rgba(255,255,255,.6); }
html.grad .day::before, html.grad .day::after { background: rgba(255,255,255,.14); }
html.grad .rx { background: rgba(0,0,0,.22); }
html.grad .body code { background: rgba(0,0,0,.3); }
html.grad .compose textarea::placeholder, html.grad .top .hash, html.grad .chan .hash { color: rgba(255,255,255,.6); }
html.grad.theme-light .compose textarea::placeholder, html.grad.theme-light .top .hash, html.grad.theme-light .chan .hash { color: var(--faint); }
html.grad.theme-light .msg:hover { background: rgba(0,0,0,.04); }
html.grad.theme-light .chan.on, html.grad.theme-light .dm-row.on { background: rgba(0,0,0,.07); }
html.grad.theme-light .ghead .tm, html.grad.theme-light .day, html.grad.theme-light .edited { color: var(--faint); }
html.grad.theme-light .rx { background: rgba(0,0,0,.05); }
html.grad.theme-light .body code { background: rgba(0,0,0,.06); }
html.grad.theme-light .rail { background: rgb(255 255 255 / calc(.5 + var(--gx, 0))); }
html.grad.theme-light .side { background: rgb(255 255 255 / calc(.62 + var(--gx, 0))); }
html.grad.theme-light .me-bar { background: rgb(255 255 255 / calc(.45 + var(--gx, 0))); }
html.grad.theme-light .main { background: rgb(255 255 255 / calc(.72 + var(--gx, 0))); }
html.grad.theme-light .members { background: rgb(255 255 255 / calc(.62 + var(--gx, 0))); }
html.grad.theme-light .compose { background: rgba(0,0,0,.05); }
html.theme-light .scrim { background: rgba(20,22,28,.45); }
html.theme-light .dot { border-color: var(--bg-side); }

/* ---------- Compact message display ---------- */
html.compact .group { margin-top: 4px; }
html.compact .msg .av-abs { display: none; }
html.compact .msg { padding-left: 76px; }
html.compact .msg .htm { opacity: 1; top: 4px; width: 50px; }
html.compact .msg.first { padding-top: 2px; }
html.compact .msg.first .ghead { display: inline-flex; margin-right: 6px; vertical-align: baseline; }
html.compact .msg.first .ghead .tm { display: none; }
html.compact .msg.first > .body { display: inline; }
html.compact .reply-ref::before { display: none; }
.msg.first .htm { display: none; }
html.compact .msg.first .htm { display: block; }
.img-links { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 2px; }
.img-link { color: var(--link); font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.img-link:hover { text-decoration: underline; }
.img-link svg { display: inline; }

/* ---------- Profile theme on cards ---------- */
.pc.themed, .fp-left.themed { background: linear-gradient(180deg, var(--p1) 0%, var(--p2) 100%); --text: #f4f4f6; --muted: rgba(255,255,255,.74); --faint: rgba(255,255,255,.55); --line: rgba(255,255,255,.14); --bg-hover: rgba(255,255,255,.08); --bg-raised: rgba(0,0,0,.25); --bg-menu: rgba(0,0,0,.28); color: var(--text); }
.pc.themed .pc-av .av { box-shadow: 0 0 0 6px var(--p1); }
.pc.themed .pc-av .dot { border-color: var(--p1); }
.pc.themed .pc-menu, .pc.themed .pc-badges { background: rgba(0,0,0,.28); border-color: rgba(255,255,255,.08); }
.pc.themed .pc-item + .pc-item, .pc.themed .pc-item + .pc-sub, .pc.themed .pc-sub + .pc-item, .pc.themed .pc-sec { border-color: rgba(255,255,255,.12); }
.pc.themed .pc-item:hover, .pc.themed .pc-opt:hover { background: rgba(255,255,255,.08); }
.pc.themed .pc-bubble, .pc.themed .pc-bubble .b1, .pc.themed .pc-bubble .b2 { background: rgba(0,0,0,.4); border-color: rgba(255,255,255,.12); }
.pc.themed .pc-user .pr, .pc.themed .pc-sec p, .pc.themed .pc-sec h5, .pc.themed .pc-item .ic, .pc.themed .pc-opt .d { color: rgba(255,255,255,.72); }
.pc.themed .role-pill { background: rgba(0,0,0,.28); }
.pc.pc-light, .fp-left.pc-light { --text: #17181c; --muted: rgba(0,0,0,.64); --faint: rgba(0,0,0,.5); --line: rgba(0,0,0,.12); --bg-hover: rgba(0,0,0,.06); --bg-raised: rgba(255,255,255,.45); --bg-menu: rgba(255,255,255,.45); color: var(--text); }
.pc.pc-light .pc-menu, .pc.pc-light .pc-badges, .pc.pc-light .role-pill { background: rgba(255,255,255,.45); border-color: rgba(0,0,0,.08); }
.pc.pc-light .pc-item + .pc-item, .pc.pc-light .pc-item + .pc-sub, .pc.pc-light .pc-sub + .pc-item, .pc.pc-light .pc-sec { border-color: rgba(0,0,0,.1); }
.pc.pc-light .pc-item:hover, .pc.pc-light .pc-opt:hover { background: rgba(0,0,0,.06); }
.pc.pc-light .pc-bubble, .pc.pc-light .pc-bubble .b1, .pc.pc-light .pc-bubble .b2 { background: rgba(255,255,255,.6); border-color: rgba(0,0,0,.1); color: #17181c; }
.pc.pc-light .pc-user .pr, .pc.pc-light .pc-sec p, .pc.pc-light .pc-sec h5, .pc.pc-light .pc-item .ic, .pc.pc-light .pc-opt .d { color: rgba(0,0,0,.6); }
.pe-preview .pc-banner, .pe-preview .pc-av, .pe-preview .pc-bubble, .pe-preview .bv-big { animation: none; }
.uname-in { display: flex; align-items: center; height: 42px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-rail); padding-left: 12px; transition: border-color .14s; }
.uname-in:focus-within { border-color: var(--accent); }
.uname-in.bad { border-color: var(--danger); }
.uname-in .at { color: var(--muted); font-weight: 600; }
.uname-in input { flex: 1; min-width: 0; height: 100%; border: 0 !important; background: none !important; color: var(--text); font: inherit; padding: 0 12px 0 2px !important; outline: none; }
.uname-hint.good { color: var(--online); font-weight: 600; }
.uname-hint.bad { color: var(--danger); font-weight: 600; }
.ptheme { position: relative; height: 112px; border-radius: 12px; border: 1px solid var(--line); transition: background .2s; }
.ptheme.unset { background: var(--bg-raised); }
.pt-dot { position: absolute; left: 50%; width: 30px; height: 30px; margin-left: -15px; border-radius: 9px; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); transition: transform .14s var(--ease-out); }
.pt-dot:hover { transform: scale(1.1); }
.pt-dot.top { top: 10px; }
.pt-dot.bottom { bottom: 10px; }
.pe-hint .linkish { font-size: 12px; flex: none; }
.sw.custom-sw { background: conic-gradient(#ff5d6c, #f0b232, #3ecf8e, #4fd1e8, #5aa9ff, #a78bff, #ff5fa8, #ff5d6c); }

/* ---------- Color picker ---------- */
.cpick { position: fixed; z-index: 95; width: 240px; padding: 14px; border-radius: 12px; background: var(--bg-card); border: 1px solid var(--line); box-shadow: 0 16px 44px rgba(0,0,0,.55); display: flex; flex-direction: column; gap: 12px; animation: pop-in .16s var(--ease-out); }
.cpick[hidden] { display: none; }
.cpick.closing { animation: pop-out .12s ease-in forwards; }
.cp-sv { position: relative; height: 150px; border-radius: 8px; cursor: crosshair; touch-action: none; }
.cp-knob { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.4), 0 2px 4px rgba(0,0,0,.4); pointer-events: none; }
.cp-hue { position: relative; height: 12px; border-radius: 6px; background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%); cursor: pointer; touch-action: none; }
.cp-hknob { position: absolute; top: 50%; width: 10px; height: 20px; margin: -10px 0 0 -5px; border-radius: 4px; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.4), 0 2px 4px rgba(0,0,0,.4); pointer-events: none; }
.cp-hexrow { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 4px 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-chat); }
.cp-hexrow:focus-within { border-color: var(--accent); }
.cp-hexrow span { color: var(--muted); font: 600 15px/1 var(--font-mono); }
.cp-hexrow input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font: 600 15px/1 var(--font-mono); outline: none; text-transform: uppercase; }
.cp-hexrow .icon-btn[hidden] { display: none; }
.cp-presets { display: flex; gap: 6px; }
.cp-pre { flex: 1; height: 30px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); transition: transform .12s var(--ease-out); }
.cp-pre:hover { transform: translateY(-2px); }
.color-in { cursor: pointer; }
.color-in .chip { width: 28px; height: 22px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.color-in:hover { border-color: var(--faint); }

/* ---------- My Profile tab ---------- */
.us-pedit .pe-grid { grid-template-columns: 1fr 300px; }
.us-pedit .pe-row { display: none; position: sticky; bottom: 16px; margin: 24px 0 0; padding: 10px 12px 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-card); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.us-pedit .pe-row.dirty { display: flex; animation: rise .2s var(--ease-out); }
.pe-row.warn { border-color: var(--danger) !important; background: linear-gradient(rgba(255,93,108,.16), rgba(255,93,108,.16)), var(--bg-card) !important; animation: shake .45s ease-in-out !important; }
.pe-row.warn .pe-dirty { color: var(--danger); }

/* ---------- Inline About Me editor ---------- */
.bio-ed { position: relative; margin-top: 8px; border-radius: 8px; padding: 6px 30px 6px 8px; margin-left: -8px; margin-right: -8px; border: 1px solid transparent; cursor: text; transition: background-color .14s, border-color .14s; }
.bio-ed:hover, .bio-ed:focus-visible { background: var(--bg-hover); border-color: var(--line); }
.bio-txt { margin: 0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.bio-txt.empty { color: var(--muted); font-style: italic; }
.bio-pen { position: absolute; top: 6px; right: 8px; color: var(--muted); opacity: 0; transition: opacity .14s; }
.bio-pen svg { display: block; }
.bio-ed:hover .bio-pen, .bio-ed:focus-visible .bio-pen { opacity: 1; }
.bio-ed.editing { cursor: default; padding: 0; margin-left: 0; margin-right: 0; border: 0; background: none; }
.bio-ed textarea { width: 100%; resize: vertical; min-height: 72px; border-radius: 8px; border: 1px solid var(--accent); background: var(--bg-raised); color: var(--text); font: inherit; font-size: 14px; padding: 8px 10px; outline: none; }
.bio-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 4px; border-radius: 8px; border: 1px solid transparent; }
.bio-row.warn { border-color: var(--danger); background: rgba(255,93,108,.14); animation: shake .45s ease-in-out; }
.bio-msg { flex: 1; min-width: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.bio-row.warn .bio-msg { color: var(--danger); }
.bio-count { font: 600 11px/1 var(--font-mono); color: var(--faint); }
.fp-sec .bio-ed { margin-top: 0; }

/* ---------- Friends ---------- */
.friends-row .fr-ic { width: 32px; height: 32px; display: grid; place-items: center; color: var(--muted); flex: none; }
.friends-row .nm { flex: 1; font-weight: 600; }
.friends-row.on .fr-ic, .friends-row:hover .fr-ic { color: var(--text); }
.friends { display: flex; flex-direction: column; min-height: 100%; }
.f-tabs { display: flex; align-items: center; gap: 6px; padding: 0 16px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.f-tab { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 6px; color: var(--muted); font-weight: 600; font-size: 14px; transition: background-color .14s, color .14s; }
.f-tab:hover { background: var(--bg-hover); color: var(--text); }
.f-tab[aria-selected=true] { background: var(--bg-raised); color: var(--text); }
.f-tab.add { background: #262a4a; color: #a6b2ff; }
.f-tab.add[aria-selected=true] { background: #262a4a; color: #a6b2ff; }
.f-body { padding: 16px; }
.f-count { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.frow { display: flex; align-items: center; gap: 12px; padding: 10px; border-top: 1px solid var(--line); border-radius: 8px; transition: background-color .12s; }
.frow:hover { background: var(--bg-hover); border-top-color: transparent; }
.frow.clickable { cursor: pointer; }
.frow:hover + .frow { border-top-color: transparent; }
.frow .dot { border-color: var(--bg-chat); }
.frow:hover .dot { border-color: var(--bg-hover); }
.f-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.f-tx b { font-weight: 700; }
.f-tx span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-acts { display: flex; gap: 8px; }
.f-rb { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-side); color: var(--muted); display: grid; place-items: center; transition: background-color .14s, color .14s, transform .14s var(--ease-out); }
.frow:hover .f-rb { background: var(--bg-chat); }
.f-rb:hover { color: var(--text); transform: scale(1.06); }
.f-rb.ok:hover { color: var(--online); }
.f-rb.danger:hover, .f-rb.danger.armed { color: var(--danger); }
.f-add h3 { margin: 4px 0 4px; font-size: 18px; }
.f-add > p { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.f-addrow { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-rail); transition: border-color .14s; }
.f-addrow:focus-within { border-color: var(--accent); }
.f-addrow.good { border-color: var(--online); }
.f-addrow.bad { border-color: var(--danger); }
.f-addrow .at { color: var(--muted); font-weight: 600; }
.f-addrow input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 15px; outline: none; height: 36px; }
.f-addrow .btn { flex: none; }
.f-addrow .btn:disabled { opacity: .5; cursor: default; }
.f-msg { margin: 8px 0 0; font-size: 13px; font-weight: 600; }
.f-msg.good { color: var(--online); }
.f-msg.bad { color: var(--danger); }
.pc-actions-row { display: flex; gap: 8px; margin-top: 12px; }
.pc-actions-row .pc-msg { flex: 1; margin-top: 0; }
.fbtn svg { display: block; }
.fbtn.accept { color: var(--online); }
.fbtn.friends { color: var(--online); }
.fbtn.armed { color: var(--danger); }
.tab .tab-n { margin-left: 6px; padding: 0 6px; border-radius: 8px; background: var(--bg-raised); font-size: 11px; color: var(--muted); }
.fp-what.muted { color: var(--muted); font-size: 13px; }
.fp-act .av-wrap .dot { border-color: var(--bg-side); }

/* Discord profile action controls */
.pc-actions-row, .fp-actions {display:flex;align-items:center;gap:8px;}
.pc-actions-row .btn.pc-msg, .fp-actions .btn.pc-msg {flex:0 0 auto;width:auto;min-height:32px;height:32px;padding:0 13px;display:inline-flex;align-items:center;justify-content:center;gap:7px;background:#5865F2;color:#fff;border-radius:7px;font-size:13px;font-weight:650;margin:0;}
.pc-actions-row .btn.pc-msg:hover, .fp-actions .btn.pc-msg:hover {background:#4752C4;filter:none;}
.pc-actions-row .btn.pc-msg svg, .fp-actions .btn.pc-msg svg {display:block;width:16px;height:16px;}
.pc-actions-row .fbtn, .fp-actions .fbtn, .profile-more-btn {width:34px;height:32px;min-width:34px;padding:0;margin:0;border-radius:8px;background:#303136;color:#f2f3f5;display:inline-flex;align-items:center;justify-content:center;}
.pc-actions-row .fbtn:hover, .fp-actions .fbtn:hover, .profile-more-btn:hover {background:#414249;filter:none;}
.pc-actions-row .fbtn.friends, .fp-actions .fbtn.friends {color:#f2f3f5;}
.profile-more-wrap {position:relative;flex:none;display:inline-flex;}
.profile-more-menu {position:absolute;right:0;top:calc(100% + 6px);z-index:100;min-width:190px;padding:5px;border:1px solid #35363c;border-radius:9px;background:#111214;box-shadow:0 12px 24px rgba(0,0,0,.45);}
.profile-more-menu[hidden] {display:none!important;}
.profile-more-option {display:block;width:100%;padding:9px 10px;border-radius:5px;text-align:left;font-size:13px;color:#e9eaed;}
.profile-more-option:hover {background:#5865F2;color:#fff;}

/* ---------- Full profile page ---------- */
.pc-av.to-full { cursor: pointer; }
.pc-av.to-full .av { transition: filter .14s; }
.pc-av.to-full:hover .av, .pc-av.to-full:focus-visible .av { filter: brightness(.82); }
.fprofile { position: relative; width: min(1000px, 100%); height: min(680px, calc(100% - 8px)); display: grid; grid-template-columns: 400px 1fr; border-radius: 16px; overflow: hidden; background: var(--bg-chat); border: 1px solid var(--line); box-shadow: 0 24px 70px rgba(0,0,0,.55); animation: pop-in .22s var(--ease-out); }
.scrim.closing .fprofile { animation: pop-out .15s ease-in forwards; }
.fp-left { position: relative; background: var(--bg-card); overflow-y: auto; color: var(--text); }
.fp-banner { height: 150px; background-size: cover; background-position: center; }
.fp-av { position: absolute; left: 24px; top: 82px; }
.fp-av .av { width: 128px; height: 128px; font-size: 46px; box-shadow: 0 0 0 8px var(--bg-card); }
.fp-left.themed .fp-av .av { box-shadow: 0 0 0 8px var(--p1); }
.fp-av .dot { width: 30px; height: 30px; border-width: 6px; border-color: var(--bg-card); right: 2px; bottom: 2px; }
.fp-left.themed .fp-av .dot { border-color: var(--p1); }
.fp-bubble { left: 168px; right: 18px; top: 158px; }
.fp-body { padding: 76px 24px 24px; display: flex; flex-direction: column; gap: 6px; }
.fp-name { margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font: 800 26px/1.15 var(--font-display); overflow-wrap: anywhere; }
.fp-name .pc-badges { margin: 0; }
.fp-sub { color: var(--text); font-size: 14px; }
.fp-sub .pr, .fp-sub .fp-st { color: var(--muted); }
.fp-actions { display: flex; gap: 8px; margin: 12px 0 6px; }
.fp-actions .btn { display: inline-flex; align-items: center; gap: 8px; }
.fp-actions .btn svg { display: inline; }
.btn.icon-only { width: 38px; padding: 0; justify-content: center; background: var(--bg-raised); }
.fp-sec { padding-top: 14px; }
.fp-sec h5 { margin: 0 0 4px; font-size: 12px; font-weight: 700; color: var(--text); }
.fp-sec p { margin: 0; font-size: 14px; color: var(--text); }
.fp-bio { white-space: pre-wrap; overflow-wrap: anywhere; }
.fp-bio.none { color: var(--muted) !important; font-style: italic; }
.fp-note { width: 100%; resize: vertical; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text); font: inherit; font-size: 14px; padding: 4px 6px; margin-left: -6px; }
.fp-note::placeholder { color: var(--muted); font-style: italic; }
.fp-note:hover { border-color: var(--line); }
.fp-note:focus { outline: none; border-color: var(--accent); background: var(--bg-raised); }
.fp-right { position: relative; padding: 28px 32px; overflow-y: auto; min-width: 0; }
.fp-tabs { margin-right: 40px; }
.fp-x { position: absolute; top: 14px; right: 14px; z-index: 2; background: var(--bg-raised); border-radius: 50%; width: 32px; height: 32px; }
.fp-hint { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.fp-act { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 8px; border-radius: 10px; background: var(--bg-side); border: 1px solid var(--line); text-align: left; transition: background-color .14s, border-color .14s, transform .14s var(--ease-out); }
.fp-act:hover { background: var(--bg-hover); border-color: var(--faint); transform: translateY(-1px); }
.fp-sicon { width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center; color: #fff; font: 700 15px/1 var(--font-display); }
.fp-atx { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fp-where { font-size: 12px; color: var(--muted); }
.fp-where b { color: var(--text); }
.fp-what { font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.fp-sname { font-size: 15px; }
.fp-empty { padding: 40px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; }
.fp-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.fp-badge { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; background: var(--bg-side); border: 1px solid var(--line); }
.fp-badge b { display: block; margin-bottom: 2px; }
.fp-badge p { margin: 0; color: var(--muted); font-size: 13px; }
@media (max-width: 860px) {
  .fprofile { grid-template-columns: 1fr; height: calc(100% - 8px); overflow-y: auto; }
  .fp-left { overflow: visible; }
  .fp-right { overflow: visible; padding: 20px; }
}

/* ---------- User settings screen ---------- */
.us { position: fixed; inset: 0; z-index: 55; display: grid; grid-template-columns: minmax(200px, 1fr) minmax(0, 760px) minmax(60px, 1fr); background: var(--bg-chat); animation: us-in .22s var(--ease-out); }
.us[hidden] { display: none; }
.us.closing { animation: us-out .16s ease-in forwards; }
@keyframes us-in { from { opacity: 0; transform: scale(1.04); } }
@keyframes us-out { to { opacity: 0; transform: scale(1.04); } }
.us-nav { background: var(--bg-side); display: flex; flex-direction: column; align-items: flex-end; padding: 60px 8px 24px 20px; overflow-y: auto; }
.us-nav > * { width: 200px; }
.us-group { font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--muted); padding: 14px 10px 6px; }
.us-tab { text-align: left; padding: 7px 10px; border-radius: 6px; color: var(--muted); font-weight: 500; margin-bottom: 2px; transition: background-color .12s, color .12s; }
.us-tab:hover { background: var(--bg-hover); color: var(--text); }
.us-tab[aria-selected=true] { background: var(--bg-raised); color: var(--text); font-weight: 600; }
.us-body { padding: 60px 40px 80px; overflow-y: auto; min-width: 0; }
.us-title { margin: 0 0 22px; font: 700 24px/1.2 var(--font-display); }
.us-close { align-self: start; justify-self: start; margin: 60px 0 0 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); }
.us-close span { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--muted); display: grid; place-items: center; transition: background-color .14s, color .14s, border-color .14s; }
.us-close:hover span { background: var(--bg-raised); color: var(--text); border-color: var(--text); }
.us-close small { font-size: 12px; font-weight: 700; }
.us-sec { padding-bottom: 26px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.us-sec:last-child { border-bottom: 0; }
.us-sec h3 { margin: 0 0 6px; font: 700 18px/1.3 var(--font-display); }
.us-sec h4 { margin: 18px 0 10px; font-size: 15px; }
.us-note { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.us-note.on { color: var(--online); margin: 6px 0 0; font-weight: 600; }
.tg-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; }
.tg-row + .tg-row { border-top: 1px solid var(--line); }
.tg-row.disabled .tg-tx { opacity: .5; }
.tg-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tg-tx b { font-weight: 600; }
.tg-tx span { color: var(--muted); font-size: 13px; }
.tg { flex: none; border-radius: 12px; }
.tg .switch { display: block; }
.tg .switch { width: 42px; height: 24px; border-radius: 12px; }
.tg .switch::after { top: 3px; left: 3px; width: 16px; height: 16px; }
.tg[aria-checked=true] .switch { background: var(--accent); border-color: var(--accent); }
.tg[aria-checked=true] .switch::after { transform: translateX(18px); background: #fff; }
.tg:disabled { opacity: .45; cursor: not-allowed; }
.theme-row { display: flex; flex-wrap: wrap; gap: 12px; }
.theme-sw { position: relative; width: 52px; height: 52px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--ring, var(--line)); transition: transform .14s var(--ease-out), box-shadow .14s; }
.theme-sw:hover { transform: translateY(-2px); }
.theme-sw[aria-pressed=true] { box-shadow: 0 0 0 2px var(--accent), inset 0 0 0 1px var(--ring, var(--line)); }
.theme-sw[aria-pressed=true]::after { content: ""; position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/12px no-repeat; border: 2px solid var(--bg-chat); }
.theme-sw.sync { background: var(--bg-raised); color: var(--text); display: grid; place-items: center; }
.custom-box { display: grid; grid-template-columns: 1fr 260px; gap: 22px; align-items: start; padding: 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-side); }
.cb-left { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.cb-left > .btn { align-self: flex-start; }
.cb-field .lbl { display: block; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.cb-colors { display: flex; flex-wrap: wrap; gap: 14px; }
.seg { display: inline-flex; padding: 3px; border-radius: 8px; background: var(--bg-raised); gap: 2px; }
.seg button { padding: 6px 12px; border-radius: 6px; font-size: 14px; font-weight: 600; color: var(--muted); transition: background-color .14s, color .14s; }
.seg button[aria-checked=true] { background: var(--bg-chat); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.color-in { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-chat); }
.color-in input { width: 32px; height: 28px; border: 0; padding: 0; background: none; cursor: pointer; }
.color-in .hex { font: 600 13px/1 var(--font-mono); color: var(--muted); }
.mini { height: 170px; border-radius: 10px; overflow: hidden; display: grid; grid-template-columns: 26px 64px 1fr; border: 1px solid var(--line); box-shadow: 0 10px 28px rgba(0,0,0,.25); }
.m-rail { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 8px; }
.m-rail i { width: 16px; height: 16px; border-radius: 6px; display: block; }
.m-side { padding: 10px 6px; display: flex; flex-direction: column; gap: 5px; }
.m-side i { display: block; height: 9px; border-radius: 3px; }
.m-chat { padding: 12px 10px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.m-msg { display: flex; gap: 6px; align-items: center; }
.m-av { width: 16px; height: 16px; border-radius: 50%; display: block; flex: none; }
.m-lines { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.m-lines i { display: block; height: 4px; border-radius: 2px; opacity: .8; }
.m-input { position: absolute; left: 10px; right: 10px; bottom: 10px; height: 18px; border-radius: 5px; display: flex; justify-content: flex-end; align-items: center; padding-right: 4px; }
.m-input i { width: 10px; height: 10px; border-radius: 3px; display: block; }
.radio-cards { display: flex; flex-direction: column; gap: 8px; }
.rcard { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--bg-side); border: 1px solid var(--line); text-align: left; transition: border-color .14s, background-color .14s; }
.rcard:hover { background: var(--bg-hover); }
.rcard[aria-checked=true] { border-color: var(--accent); background: var(--accent-soft); }
.rdot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--muted); flex: none; display: grid; place-items: center; }
.rcard[aria-checked=true] .rdot { border-color: var(--accent); }
.rcard[aria-checked=true] .rdot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.rtx { display: flex; flex-direction: column; gap: 2px; }
.rtx span { color: var(--muted); font-size: 13px; }
.slider { display: flex; align-items: center; gap: 14px; }
.slider input { flex: 1; accent-color: var(--accent); }
.slider-val { font: 700 14px/1 var(--font-mono); min-width: 40px; text-align: right; }
.ticks { display: flex; justify-content: space-between; color: var(--faint); font-size: 11px; padding: 4px 54px 0 0; }
.size-preview { margin-top: 16px; padding: 14px; border-radius: 10px; background: var(--bg-side); border: 1px solid var(--line); }
.size-preview b { color: #ff6b6b; }
.size-preview p { margin: 2px 0 0; font-size: var(--chat-size); }
.kb-list { display: flex; flex-direction: column; }
.kb-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kb-keys { display: flex; align-items: center; gap: 4px; color: var(--muted); flex: none; }
kbd { font: 700 12px/1 var(--font-mono); padding: 5px 8px; border-radius: 6px; background: var(--bg-raised); border: 1px solid var(--line); border-bottom-width: 3px; color: var(--text); }
.us-profile { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }
.us-card .pc { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-card); }
.us-pside { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
@media (max-width: 900px) {
  .us { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .us-nav { flex-direction: row; align-items: center; padding: 10px 56px 10px 10px; overflow-x: auto; gap: 4px; }
  .us-nav > * { width: auto; flex: none; }
  .us-group { display: none; }
  .us-body { padding: 20px 16px 60px; }
  .us-close { position: fixed; top: 8px; right: 8px; margin: 0; }
  .us-close small { display: none; }
  .custom-box, .us-profile { grid-template-columns: 1fr; }
}
  .verified-name-badge { display:inline-flex; vertical-align:middle; align-items:center; margin-left:4px; flex:0 0 auto; }
  .badge-layout-box { width: min(640px, 100%); }
  .bv-foot .btn + .btn { margin-top: 8px; }
  .badge-layout-empty { color: var(--muted); font-size: 14px; margin: 0; }

  /* Badge layout editor */
  .badge-layout { display:flex; flex-direction:column; gap:10px; }
  .badge-layout-note { color:var(--muted); font-size:12px; line-height:1.5; margin:0 0 4px; }
  .badge-layout-order-strip { display:flex; flex-direction:row; align-items:stretch; gap:9px; min-height:64px; padding:10px; overflow-x:auto; overflow-y:hidden; border:1px dashed var(--line); border-radius:12px; background:var(--bg-card); }
  .badge-layout-chip { flex:0 0 auto; min-width:112px; max-width:170px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; padding:9px 12px; border:1px solid var(--line); border-radius:10px; background:var(--bg-raised); cursor:grab; user-select:none; touch-action:none; transition:border-color .12s, opacity .12s, transform .12s; }
  .badge-layout-chip:active { cursor:grabbing; }
  .badge-layout-chip.is-dragging { opacity:.55; transform:scale(.96); z-index:2; }
  .badge-layout-chip.drop-before { border-left:3px solid var(--accent); }
  .badge-layout-chip.drop-after { border-right:3px solid var(--accent); }
  .badge-layout-chip .bdg-ic { display:grid; place-items:center; width:30px; height:30px; }
  .badge-layout-chip .badge-layout-name { max-width:145px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; font-weight:600; }
  .badge-layout-drag-handle { color:var(--muted); font-size:17px; line-height:12px; }
  .badge-size-row { display:grid; grid-template-columns:minmax(105px,1fr) minmax(120px,1.5fr) 42px; align-items:center; gap:10px; padding:8px 2px; border-bottom:1px solid var(--line); }
  .badge-size-row label { font-size:12px; color:var(--text); }
  .badge-size-row input { width:100%; accent-color:var(--accent); }
  .badge-size-row output { color:var(--muted); font-size:12px; text-align:right; font-variant-numeric:tabular-nums; }
  .badge-layout-save { display:flex; justify-content:flex-end; gap:8px; margin-top:10px; }


/* Discord-like empty DMs and add friend view */
.side.empty-dms .side-head {height:56px;padding:0 8px;border-bottom:1px solid var(--line)}
.side.empty-dms .side-head #srvName {font-size:12px;width:100%;text-align:center;background:var(--bg-raised);border-radius:7px;padding:8px 5px;cursor:pointer}
.side.empty-dms .side-head .grow {display:none}
.side.empty-dms .chan-scroll {padding:8px}
.side.empty-dms .friends-row {padding:7px 9px;margin-bottom:4px}
.side.empty-dms .friends-row.on {background:var(--bg-raised);border-radius:7px}
.side.empty-dms .cat {margin-top:12px;padding:12px 8px 8px;border-top:1px solid var(--line);text-transform:none;letter-spacing:0;font-size:12px;font-weight:500}
.side.empty-dms .dm-skeletons {display:flex;flex-direction:column;gap:11px;padding:8px 7px;opacity:.65}
.side.empty-dms .dm-skel {display:flex;gap:8px;align-items:center;height:28px}
.side.empty-dms .dm-skel-circle {width:28px;height:28px;border-radius:50%;background:#24252b;flex:none}
.side.empty-dms .dm-skel-bar {width:50%;height:16px;border-radius:9px;background:#24252b}
.side.empty-dms .dm-skel:nth-child(even) .dm-skel-bar {width:60%}
.side.empty-dms .dm-skel:nth-child(n+8) {opacity:.35}
.friends.empty-home .f-tabs {height:45px;min-height:45px;padding:0 14px;gap:4px;border-bottom:1px solid var(--line)}
.friends.empty-home .f-tab {padding:5px 12px}
.friends.empty-home .f-tab.add {background:#262a4a;color:#a6b2ff}
.friends.empty-home .f-tab.add[aria-selected=true] {background:#262a4a;color:#a6b2ff}
.friends.empty-home .f-body {padding:0}
.friends.empty-home .f-add {position:relative;padding:18px 26px 0;}
.friends.empty-home .f-add h3 {font-size:17px;margin:0 0 4px}
.friends.empty-home .f-add>p {font-size:13px;margin-bottom:14px;color:var(--text)}
.friends.empty-home .f-addrow {background:transparent;border-radius:14px;padding:10px;min-height:68px;align-items:flex-start;gap:8px}
.friends.empty-home .f-addrow .at {display:none}
.friends.empty-home .f-addrow input {padding-left:2px;font-size:13px}
.friends.empty-home .f-addrow .btn {background:#5865f2;color:#fff;font-size:12px;height:31px;border-radius:7px;padding:0 12px}
.friends.empty-home .f-addrow .btn:disabled {opacity:.55}
.friends.empty-home .f-mascot {position:absolute;right:28px;top:5px;width:96px;height:72px;object-fit:contain;pointer-events:none}
.friends.empty-home .f-addnote {font-size:12px;color:var(--muted);margin:7px 0 20px}
.friends.empty-home .f-discovery {padding:16px 26px;border-top:1px solid var(--line)}
.friends.empty-home .f-discovery h3 {font-size:16px;margin:0 0 6px}
.friends.empty-home .f-discovery p {font-size:13px;color:var(--text);margin:0 0 16px}
.friends.empty-home .f-discover-btn {display:flex;align-items:center;gap:9px;width:min(570px,100%);border:1px solid var(--line);border-radius:8px;padding:9px 12px;text-align:left;font-size:13px;font-weight:600;min-height:51px}
.friends.empty-home .f-discover-btn:hover {background:var(--bg-hover)}
.friends.empty-home .f-discover-btn .disc-ic {display:grid;place-items:center;width:31px;height:31px;border-radius:8px;background:#3ba26c;color:white;font-size:20px}
.friends.empty-home .f-discover-btn .disc-chevron {margin-left:auto;font-size:24px;color:var(--muted)}
@media(max-width:620px){.friends.empty-home .f-mascot{width:65px;right:6px;opacity:.8}.friends.empty-home .f-add,.friends.empty-home .f-discovery{padding-left:14px;padding-right:14px}.friends.empty-home .f-addrow{flex-wrap:wrap}}


/* Friends header — single-row Discord-like navigation */
.top[hidden] {display:none !important}
.friends .f-tabs.discord-friends-tabs,
.friends.empty-home .f-tabs.discord-friends-tabs {
  display:flex;align-items:center;flex-wrap:nowrap;gap:8px;
  padding:0 16px;height:49px;min-height:49px;
  border-bottom:1px solid var(--line);overflow-x:auto;scrollbar-width:none;
}
.friends .f-tabs.discord-friends-tabs::-webkit-scrollbar {display:none}
.discord-friends-tabs .f-head-label {display:inline-flex;align-items:center;gap:8px;padding:0 6px 0 0;color:var(--text);font-weight:700;font-size:15px;white-space:nowrap;flex:none}
.discord-friends-tabs .f-head-label svg {height:20px;width:20px;color:#b5bac1}
.discord-friends-icon {width:20px;height:20px;display:block;object-fit:contain;flex:none}
.hash .discord-friends-icon {width:22px;height:22px}
.fr-ic .discord-friends-icon {width:20px;height:20px}
.discord-friends-tabs .f-head-divider {display:block;width:3px;height:3px;background:#4a4c56;border-radius:50%;flex:none;margin:0 7px 0 1px}
.friends .discord-friends-tabs .f-tab {flex:none;white-space:nowrap;font-size:14px;font-weight:600;padding:5px 12px;border-radius:6px}
.friends .discord-friends-tabs .f-tab:not(.add)[aria-selected=true] {background:#303137;color:#fff}
.friends .discord-friends-tabs .f-tab.add,
.friends.empty-home .discord-friends-tabs .f-tab.add {background:#262a4a;color:#a6b2ff}
.friends .discord-friends-tabs .f-tab.add:hover {background:#30365f;color:#c1c8ff}


/* Compact user profile popover: banner actions like Discord */
.pcard .pc.compact-user { min-height:0; }
.pcard .compact-user .pc-banner { height:100px; }
.pcard .compact-user .pc-av { top:52px; left:12px; }
.pcard .compact-user .pc-av .av { width:78px; height:78px; box-shadow:0 0 0 6px var(--bg-card); }
.pcard .compact-user .pc-body { padding:51px 12px 14px; }
.pcard .compact-user .pc-name {font-size:19px;line-height:1.25;}
.pcard .compact-user .pc-user {font-size:13px; margin-top:1px;}
.pcard .compact-user .pc-banner-actions {position:absolute;right:11px;top:7px;display:flex;align-items:center;gap:7px;z-index:5;}
.pcard .compact-user .pc-banner-actions .fbtn,
.pcard .compact-user .pc-banner-actions .profile-more-btn { width:33px;min-width:33px;height:33px;border-radius:50%; background:rgba(20,20,22,.62);color:#fff;display:grid;place-items:center;transition:background .15s; }
.pcard .compact-user .pc-banner-actions .fbtn:hover,
.pcard .compact-user .pc-banner-actions .profile-more-btn:hover {background:rgba(12,12,15,.85);}
.pcard .compact-user .pc-banner-actions .fbtn svg {width:18px;height:18px;}
.pcard .compact-user .pc-banner-actions .profile-more-menu {top:39px;z-index:110;}
.pcard .compact-user .pc-quickmsg {margin-top:18px;width:100%;height:45px;padding:0 13px;display:flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid #3b3b41;border-radius:9px;color:#9798a1;text-align:left;background:rgba(21,22,27,.2);font-size:13px;}
.pcard .compact-user .pc-quickmsg:hover {border-color:#646772;background:#2b2b33;}
.pcard .compact-user .pc-quickmsg svg {flex:none;width:19px;height:19px;color:#b6b8c2;}
.pcard .compact-user .pc-bio {font-size:13px;}
.pcard .compact-user .pc-bubble {display:none;}


/* Friend status: white silhouette and check at the lower shoulder / arm.
   Both top-right controls use the identical neutral gray appearance. */
.pcard .compact-user .pc-banner-actions .fbtn,
.pcard .compact-user .pc-banner-actions .fbtn.friends,
.pcard .compact-user .pc-banner-actions .profile-more-btn {
  background: #303136 !important;
  color: #fff !important;
  box-shadow: none;
}
.pcard .compact-user .pc-banner-actions .fbtn:hover,
.pcard .compact-user .pc-banner-actions .profile-more-btn:hover {
  background: #414249 !important;
  color: #fff !important;
}
.pcard .compact-user .pc-banner-actions .fbtn svg {width:20px;height:20px;color:#fff;}

/* Discord-like custom status symbols (online / idle / do-not-disturb / invisible) */
.discord-status-icon {display:inline-grid;place-items:center;width:18px;height:18px;flex:none;line-height:0;}
.discord-status-icon svg {display:block;width:15px;height:15px;}
.pc-opt .discord-status-icon {width:19px;height:20px;}
.pc-opt .discord-status-icon svg {width:15px;height:15px;}
.pc-item .ic:has(.discord-status-icon) {color:inherit;}


/* Status art on every avatar: crescent, DND minus, and invisible ring. */
.dot.s-online {background:#43A76B;}
.dot.s-idle,.dot.s-dnd,.dot.s-invisible,.dot.s-offline {
  background-color:var(--bg-side) !important; background-position:center;
  background-repeat:no-repeat; background-size:100% 100%;
}
.dot.s-idle {background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20fill%3D%22%23F0B232%22%20d%3D%22M15%2012.7A7.15%207.15%200%200%201%206.3%204a7.2%207.2%200%201%200%208.7%208.7Z%22%2F%3E%3C%2Fsvg%3E");}
.dot.s-dnd {background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2020%2020%22%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%229%22%20fill%3D%22%23ED4245%22%2F%3E%3Cpath%20stroke%3D%22%2324252B%22%20stroke-width%3D%222.9%22%20stroke-linecap%3D%22round%22%20d%3D%22M5.7%2010h8.6%22%2F%3E%3C%2Fsvg%3E");}
.dot.s-invisible {background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20fill%3D%22%2381838C%22%20fill-rule%3D%22evenodd%22%20d%3D%22M10%201a9%209%200%201%201%200%2018%209%209%200%200%201%200-18Zm0%205.6a3.4%203.4%200%201%200%200%206.8%203.4%203.4%200%200%200%200-6.8Z%22%2F%3E%3C%2Fsvg%3E");}
.dot.s-offline {background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20fill%3D%22%2381838C%22%20fill-rule%3D%22evenodd%22%20d%3D%22M10%201a9%209%200%201%201%200%2018%209%209%200%200%201%200-18Zm0%205.6a3.4%203.4%200%201%200%200%206.8%203.4%203.4%200%200%200%200-6.8Z%22%2F%3E%3C%2Fsvg%3E");}
.dot.s-idle,.dot.s-dnd,.dot.s-invisible,.dot.s-offline {background-origin:content-box;}

/* Larger Discord-style avatar status badges (reference proportions). */
.av-wrap > .dot {
  width: 19px; height: 19px; border-width: 3px;
  right: -3px; bottom: -3px;
}
.av-wrap:has(> .av.sm) > .dot {
  width: 17px; height: 17px; border-width: 3px;
  right: -3px; bottom: -3px;
}
.pc-av.av-wrap > .dot {
  width: 29px; height: 29px; border-width: 5px;
  right: -3px; bottom: -3px;
}
.fp-av.av-wrap > .dot {
  width: 40px; height: 40px; border-width: 7px;
  right: 0; bottom: 0;
}

/* Opaque backing for status artwork: prevent avatars showing through moon/ring/cutouts. */
.av-wrap > .dot.s-idle,
.av-wrap > .dot.s-dnd,
.av-wrap > .dot.s-invisible,
.av-wrap > .dot.s-offline { background-color:var(--bg-side) !important; }
.me-bar .av-wrap > .dot.s-idle,
.me-bar .av-wrap > .dot.s-dnd,
.me-bar .av-wrap > .dot.s-invisible,
.me-bar .av-wrap > .dot.s-offline { background-color:var(--bg-me) !important; }
.pc-av.av-wrap > .dot.s-idle,
.pc-av.av-wrap > .dot.s-dnd,
.pc-av.av-wrap > .dot.s-invisible,
.pc-av.av-wrap > .dot.s-offline,
.fp-av.av-wrap > .dot.s-idle,
.fp-av.av-wrap > .dot.s-dnd,
.fp-av.av-wrap > .dot.s-invisible,
.fp-av.av-wrap > .dot.s-offline { background-color:var(--bg-card) !important; }
.pc.themed .pc-av.av-wrap > .dot.s-idle,
.pc.themed .pc-av.av-wrap > .dot.s-dnd,
.pc.themed .pc-av.av-wrap > .dot.s-invisible,
.pc.themed .pc-av.av-wrap > .dot.s-offline,
.fp-left.themed .fp-av.av-wrap > .dot.s-idle,
.fp-left.themed .fp-av.av-wrap > .dot.s-dnd,
.fp-left.themed .fp-av.av-wrap > .dot.s-invisible,
.fp-left.themed .fp-av.av-wrap > .dot.s-offline { background-color:var(--p1) !important; }
.frow .av-wrap > .dot.s-idle,
.frow .av-wrap > .dot.s-dnd,
.frow .av-wrap > .dot.s-invisible,
.frow .av-wrap > .dot.s-offline { background-color:var(--bg-chat) !important; }
.frow:hover .av-wrap > .dot.s-idle,
.frow:hover .av-wrap > .dot.s-dnd,
.frow:hover .av-wrap > .dot.s-invisible,
.frow:hover .av-wrap > .dot.s-offline { background-color:var(--bg-hover) !important; }

/* Local GG Sans Regular (.ttf): drop your legally obtained font file into fonts/.
   Other weights use browser-synthesized bold until matching files are provided. */
@font-face {
  font-family: "Burrow Local GG Sans";
  src: url("../fonts/gg%20sans%20Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
:root {
  --font-body: "Burrow Local GG Sans", "gg sans", system-ui, sans-serif;
  --font-display: "Burrow Local GG Sans", "gg sans", system-ui, sans-serif;
}
/* Keep the default compact user panel layout for every user, including the owner. */
.me-bar { height: 56px; flex-wrap: nowrap; align-content: normal; }
.me-bar .me-btn { flex: 1 1 auto; min-width: 0; width: auto; }
.me-bar .me-ctl { flex: none; width: auto; justify-content: flex-end; }


/* Compact GG Sans friend request form, matched to the reference layout.
   Keep the empty-friends and normal Friends tabs visually identical. */
.friends .f-add { position:relative; padding:18px 26px 10px; }
.friends .f-add > h3 { font-size:17px; margin:0 0 6px; }
.friends .f-add > p { font-size:13px; margin-bottom:14px; }
.friends .f-friend-request,
.friends.empty-home .f-friend-request {
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:0;
  width:100%;
  min-height:0;
  padding:0 12px;
  background:#17171a;
  border:1px solid #303035;
  border-radius:14px;
  font-family:var(--font-body);
  font-size:14px;
  font-weight:400;
  line-height:20px;
  box-shadow:none;
}
.friends .f-request-top,
.friends.empty-home .f-request-top {
  display:flex;
  align-items:center;
  gap:8px;
  width:100%;
  height:42px;
  min-height:42px;
  padding:0;
}
.friends .f-request-top .at { display:none; }
.friends .f-request-top input,
.friends.empty-home .f-request-top input {
  flex:1;
  min-width:0;
  width:100%;
  height:40px;
  padding:0;
  margin:0;
  border:0;
  border-radius:0;
  outline:none;
  background:transparent;
  color:#f2f3f5;
  font-family:var(--font-body);
  font-size:14px;
  font-weight:400;
  line-height:20px;
  letter-spacing:0;
}
.friends .f-request-top .f-send-request,
.friends.empty-home .f-request-top .f-send-request {
  flex:none;
  height:31px;
  padding:0 12px;
  margin:0;
  border-radius:7px;
  background:#5865F2;
  color:#fff;
  font-family:var(--font-body);
  font-size:12px;
  font-weight:600;
  line-height:31px;
  opacity:1;
  filter:none;
}
.friends .f-request-top .f-send-request:disabled,
.friends.empty-home .f-request-top .f-send-request:disabled {
  opacity:.65;
  color:#fff;
  cursor:default;
}
.friends .f-request-top .f-send-request:not(:disabled):hover { background:#4752c4; }
.friends .f-request-personal,
.friends.empty-home .f-request-personal {
  position:relative;
  width:100%;
  height:68px;
  min-height:68px;
  padding:0;
  border-top:1px solid #303035;
}
.friends .f-request-note,
.friends.empty-home .f-request-note {
  display:block;
  width:100%;
  min-height:0;
  height:67px;
  padding:10px 0 22px;
  margin:0;
  resize:none;
  border:0;
  border-radius:0;
  outline:none;
  background:transparent;
  color:#f2f3f5;
  font-family:var(--font-body);
  font-size:14px;
  font-weight:400;
  line-height:20px;
  letter-spacing:0;
  box-sizing:border-box;
}
.friends .f-request-count {
  position:absolute;
  right:0;
  bottom:6px;
  pointer-events:none;
  color:#94959c;
  font:12px/1 var(--font-body);
}
.friends .f-request-note::placeholder,
.friends .f-request-top input::placeholder {
  color:#94959c;
  opacity:1;
}
.friends .f-friend-request:focus-within { border-color:#5865F2; }
.friends .f-friend-request.bad { border-color:var(--danger); }
.friends .f-friend-request.good { border-color:var(--online); }

@media(max-width:560px) {
  .friends .f-add {padding:14px 12px 8px;}
  .friends .f-request-top {flex-wrap:wrap; padding-bottom:8px;}
  .friends .f-request-top .f-send-request {margin-left:auto;}
}


/* ----- Compact Add Friend card + Discord-style bottom-left controls ----- */
/* Don't stretch the friend form across the full desktop width. */
.friends .f-friend-request,
.friends.empty-home .f-friend-request {
  width: 100%;
  max-width: 1080px;
  margin-left: 0;
  margin-right: auto;
}
/* Keep both fields consistent with GG Sans, no browser-specific font metrics. */
.friends .f-request-top input,
.friends .f-request-note,
.friends .f-request-top .f-send-request {
  font-family: var(--font-body);
  letter-spacing: 0;
}
/* Explicitly size icon SVGs without relying on altering their SVG path strings. */
.me-ctl > .icon-btn svg,
.me-ctl .vbtn svg { width: 20px; height: 20px; }

/* Doctor Wumpus peeks above the friend request card in every state.
   Anchor to the compact card, not to the entire page width. */
.friends .f-request-stage,
.friends.empty-home .f-request-stage {
  position: relative;
  width: 100%;
  max-width: 1080px;
  margin-top: 14px;
}
.friends .f-request-stage .f-friend-request,
.friends.empty-home .f-request-stage .f-friend-request {
  width: 100%;
  max-width: 100%;
}
.friends .f-request-stage .f-mascot,
.friends.empty-home .f-request-stage .f-mascot {
  display: block;
  position: absolute;
  top: auto;
  bottom: calc(100% - 3px);
  right: 16px;
  width: 104px;
  height: 78px;
  object-fit: contain;
  object-position: center bottom;
  z-index: 1;
  pointer-events: none;
  opacity: 1;
}
@media (max-width: 620px) {
  .friends .f-request-stage .f-mascot,
  .friends.empty-home .f-request-stage .f-mascot {
    right: 4px;
    width: 78px;
    height: 62px;
    opacity: 1;
  }
}


/* -------- Burrow auth screens: space backdrop + compact forms -------- */
.auth-locked .app { visibility:hidden;pointer-events:none; }
.auth-gate[hidden], .auth-gate [hidden] { display:none!important; }
.auth-gate { position:fixed;inset:0;z-index:2000;overflow-y:auto;isolation:isolate;
  background:linear-gradient(108deg,#170643 1%,#1d126a 35%,#282db0 66%,#1266ee 100%);
  color:#f2f3f5;font-family:var(--font-body,"gg sans",system-ui,sans-serif); }
.auth-gate * {box-sizing:border-box;}
.auth-gate button,.auth-gate input,.auth-gate select {font:inherit;}
.auth-space {position:absolute;inset:0;min-height:100%;overflow:hidden;pointer-events:none;z-index:-1;}
.auth-space-glow {position:absolute;inset:-25%;background:
  radial-gradient(ellipse at 58% 8%,rgba(91,100,247,.40),transparent 39%),
  radial-gradient(ellipse at 89% 72%,rgba(40,128,255,.5),transparent 40%),
  radial-gradient(ellipse at 15% 70%,rgba(32,4,94,.6),transparent 48%);}
.auth-stars {position:absolute;inset:0;}
.auth-stars i {position:absolute;display:block;border-radius:1px;background:#c5c5ff;box-shadow:0 0 8px #b5a0ff;animation:auth-twinkle 5s ease-in-out infinite alternate;}
@keyframes auth-twinkle {from{opacity:.17;transform:scale(.8)}to{opacity:.85;transform:scale(1.15)}}
.auth-planet {position:absolute;opacity:.28;filter:blur(4px);}
.auth-planet-left {left:5%;top:35%;height:125px;width:125px;border:16px solid rgba(204,174,255,.75);border-radius:50%;box-shadow:0 0 22px #b59de9, inset 0 0 14px #c0adff;}
.auth-planet-right {right:6%;top:34%;width:105px;height:76px;border-radius:16px;background:linear-gradient(125deg,transparent 12%,#738cec 12% 30%,#3a61c3 80%);transform:rotate(25deg);}
.auth-planet-top {left:34%;top:17%;width:82px;height:88px;border:14px solid #bb72df;border-left-color:transparent;border-radius:50%;transform:rotate(-25deg);filter:blur(10px);}
.auth-cross {position:absolute;width:41px;height:41px;opacity:.35;filter:blur(2px);}
.auth-cross:before,.auth-cross:after {content:"";position:absolute;background:#bdaaff;box-shadow:0 0 14px #a8a9ff;border-radius:100px;}
.auth-cross:before {width:7px;height:100%;left:17px;top:0;}.auth-cross:after {height:7px;width:100%;top:17px;left:0;}
.auth-cross-one {left:14%;top:62%;}.auth-cross-two {right:17%;bottom:22%;}
.auth-page-header {position:absolute;top:30px;left:34px;z-index:1;}
.auth-brand {display:flex;align-items:center;gap:8px;color:#fff;font-size:18px;font-weight:800;letter-spacing:-.2px;}
.auth-brand-mark {display:grid;place-items:center;color:#fff;}
.auth-brand-mark svg {height:24px;width:28px;}
.auth-panel {min-height:100vh;min-height:100dvh;display:flex;align-items:center;justify-content:center;padding:78px 22px 45px;}
.auth-card {width:min(100%,465px);max-width:465px;padding:25px 28px 26px;border-radius:7px;
  background:#232428;box-shadow:0 18px 48px rgba(0,0,0,.34);}
.auth-back {display:inline-flex;align-items:center;gap:4px;min-height:32px;padding:0 13px;border-radius:6px;
  background:#313238;color:#f2f3f5;font-size:13px!important;font-weight:650;cursor:pointer;margin-bottom:16px;}
.auth-back:hover {background:#3b3c43;}
.auth-heading {text-align:center; margin:0 0 20px;}
.auth-heading h2,.auth-card h2 {font-size:20px;font-weight:800;line-height:1.25;margin:0;color:#f2f3f5;}
.auth-heading .auth-subtitle {font-size:13px;color:#e0e1e5;margin:8px 0 0;}
#authRegisterPane .auth-heading {margin-bottom:24px;}
.auth-card form {display:flex;flex-direction:column;gap:0;}
.auth-card form label {color:#e9e9ee;font-size:12px;font-weight:750;letter-spacing:0;margin:0 0 7px;}
.auth-required {color:#ed6570;}
.auth-card form input,.auth-card form select {display:block;width:100%;height:36px;min-height:36px;
  background:#1e1f23;color:#f2f3f5;border:1px solid #393a40;border-radius:6px;outline:none;
  padding:0 11px;font-size:14px;margin:0 0 18px;transition:border-color .14s;}
.auth-card form input:focus,.auth-card form select:focus {border-color:#6676fc;box-shadow:0 0 0 1px #6676fc;}
.auth-card form input::placeholder {color:#888991;}
.auth-password {position:relative;}
.auth-password input {padding-right:42px!important;margin-bottom:0!important;}
.auth-show-pass {position:absolute;top:0;right:0;width:40px;height:36px;display:grid;place-items:center;
  color:#c9cbd1;border-radius:4px;cursor:pointer;}
.auth-show-pass:hover {color:#fff;}
.auth-show-pass svg {display:block;}
.auth-inline-link {align-self:flex-start;cursor:pointer;font-size:11px!important;color:#9caeff;}
.auth-inline-link:hover,.auth-alternate button:hover {text-decoration:underline;}
.auth-forgot {margin:5px 0 18px;}
.auth-primary {height:36px;width:100%;border-radius:6px;background:#5865f2;color:#fff;
  font-size:13px!important;font-weight:750;cursor:pointer;transition:background .14s;}
.auth-primary:hover:not(:disabled) {background:#4752c4;}
.auth-primary:disabled {opacity:.65;cursor:wait;}
.auth-secondary {height:36px;width:100%;margin-top:12px;border:1px solid #575862;background:#32343b;color:#fff;
  border-radius:6px;font-size:13px;font-weight:700;cursor:pointer;}
.auth-secondary:hover {background:#43454d;}
.auth-alternate {font-size:12px;color:#a8a9b0;margin:9px 0 0;}
.auth-alternate button {color:#9cb0ff;cursor:pointer;font-size:12px;font-weight:500;}
.auth-error {font-size:12px;line-height:1.35;color:#fb8189;margin:0;}
.auth-error:not(:empty) {margin-bottom:10px;}
.auth-dob-row {display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:9px;}
.auth-dob-row select {min-width:0;appearance:none;cursor:pointer;margin-bottom:16px!important;
  padding:0 30px 0 11px!important;color:#edeef3;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23f2f3f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 9px center;background-size:16px;}
.auth-dob-row select:invalid {color:#94959c;}
.auth-dob-row select option {color:#f2f3f5;background:#292a30;}
.auth-legal {font-size:11px;line-height:1.48;color:#adb0ba;margin:3px 0 18px;}
.auth-register-alternate {margin-top:17px;}
.auth-local-notice {font-size:10px;color:#8d90a1;margin:20px 0 0;text-align:center;}
#authWelcomePane {text-align:center;padding:14px 3px;}
#authWelcomePane h2 {margin-bottom:9px;}
#authWelcomePane .auth-subtitle {margin:0 0 24px;color:#d2d3da;font-size:13px;}
@media(min-width:1100px){.auth-card{width:475px;max-width:475px;}}
@media(max-width:600px){.auth-page-header{top:20px;left:20px}.auth-panel{padding:80px 12px 24px;align-items:center}.auth-card{width:min(100%,420px);padding:22px 20px 23px}.auth-planet-left{left:-60px}}
@media(max-height:650px){.auth-panel{align-items:flex-start;}.auth-card{margin:auto 0;}}

.us-account-info{display:flex;align-items:center;gap:14px;margin:16px 0 22px;padding:16px;background:var(--bg-raised);border:1px solid var(--line);border-radius:12px}
.us-account-avatar{height:47px;width:47px;border-radius:50%;background:#5865F2;color:white;display:grid;place-items:center;font-size:18px;font-weight:800}
.us-account-info>div{display:flex;flex-direction:column;gap:3px}.us-account-info strong{font-size:16px}.us-account-info>div span{color:var(--muted);font-size:13px}.us-logout{margin-top:18px;background:#5865F2!important;color:#fff!important}

/* Full-profile Edit Profile button: Discord blue with white label and icon */
.fp-actions .btn.profile-edit-btn { background: #5865F2; color: #fff; }
.fp-actions .btn.profile-edit-btn:hover { background: #4752C4; filter: none; }
.fp-actions .btn.profile-edit-btn svg { color: inherit; }
/* Keep the birthday label separated from the password control. */
#authRegisterPane .auth-password { margin-bottom:18px; }

/* Discord-style red Log Out action in settings navigation */
.us-logout-divider {height:1px;background:var(--line);margin:12px 10px 8px;width:180px;flex:none;}
.us-nav .us-logout-nav {display:flex;align-items:center;gap:10px;color:#f26970;font-weight:600;padding:9px 10px;text-align:left;flex:none;}
.us-nav .us-logout-nav svg {flex:none;width:19px;height:19px;color:#f26970;}
.us-nav .us-logout-nav:hover,.us-nav .us-logout-nav:focus-visible {background:rgba(237,66,69,.13);color:#ff777e;}
.us-nav .us-logout-nav:hover svg {color:#ff777e;}

/* Burrow loading screen – supplied transparent animated GIF and rotating tips. */
.burrow-loading[hidden] {display:none!important;}
.burrow-loading {
  position:fixed;inset:0;z-index:99999;
  display:flex;align-items:center;justify-content:center;
  background:#111113;color:#f2f3f5;
  font-family:var(--font-body,'gg sans',system-ui,sans-serif);
  text-align:center;padding:24px;
}
.burrow-loading-inner {
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:0;max-width:340px;transform:translateY(-16px);
}
.burrow-loading-gif {display:block;width:150px;height:146px;object-fit:contain;margin:0 0 6px;image-rendering:auto;}
.burrow-loading-heading {color:#94959c;font-size:14px;font-weight:650;line-height:22px;margin:0 0 5px;}
.burrow-loading-tip {color:#f1f1f3;font-size:13px;font-weight:500;line-height:23px;max-width:310px;margin:0;}
.burrow-loading-tip kbd {font:inherit;color:#fff;background:#26272b;border:1px solid #38393f;border-radius:5px;padding:3px 6px;box-shadow:0 1px 1px rgba(0,0,0,.25);white-space:nowrap;}
@media(max-width:480px) {.burrow-loading-gif {width:134px;height:131px}.burrow-loading-tip{font-size:13px}}
