/* ---------- themes ---------- */
:root, [data-theme="dark"] {
  --bg-1: #1e1f22; --bg-2: #2b2d31; --bg-3: #313338; --bg-float: #111214;
  --hover: rgba(78, 80, 88, .3); --active: rgba(78, 80, 88, .6);
  --input: #1e1f22; --composer: #383a40; --card: #2b2d31;
  --text: #dbdee1; --strong: #f2f3f5; --muted: #949ba4; --faint: #6d6f78;
  --border: #3f4147; --border-soft: rgba(255, 255, 255, .06);
  --accent: #5865f2; --accent-h: #4752c4; --green: #23a559; --red: #da373c; --red-h: #a12828; --yellow: #f0b232;
  --shadow: 0 8px 24px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
[data-theme="midnight"] {
  --bg-1: #000; --bg-2: #0e0f11; --bg-3: #141518; --bg-float: #000;
  --hover: rgba(255, 255, 255, .05); --active: rgba(255, 255, 255, .1);
  --input: #0a0a0b; --composer: #1c1d21; --card: #0e0f11; --border: #26272b;
}
[data-theme="light"] {
  --bg-1: #e3e5e8; --bg-2: #f2f3f5; --bg-3: #fff; --bg-float: #fff;
  --hover: rgba(116, 124, 138, .14); --active: rgba(116, 124, 138, .26);
  --input: #e3e5e8; --composer: #ebedef; --card: #f2f3f5;
  --text: #313338; --strong: #060607; --muted: #5c5e66; --faint: #80848e;
  --border: #e1e2e4; --border-soft: rgba(0, 0, 0, .06);
  --shadow: 0 8px 24px rgba(0, 0, 0, .12);
  color-scheme: light;
}

/* ---------- base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0 }
[hidden] { display: none !important }
html, body, #app { height: 100% }
body { font: 15px/1.375 "Segoe UI Variable Text", "Segoe UI", "Inter", system-ui, -apple-system, sans-serif; background: var(--bg-3); color: var(--text); overflow: hidden; -webkit-font-smoothing: antialiased }
button { font: inherit; cursor: pointer; border: 0; color: inherit; background: none }
button:disabled { cursor: not-allowed; opacity: .5 }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
input, textarea { font: inherit; color: var(--text); background: var(--input); border: 0; border-radius: 4px; padding: 10px; outline: none; width: 100% }
input:focus-visible, textarea:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent) }
h1 { font-size: 24px; color: var(--strong); font-weight: 700 }
h2 { font-size: 20px; color: var(--strong); font-weight: 700; margin-bottom: 8px }
h3 { font-size: 16px; color: var(--strong); font-weight: 600; margin-bottom: 8px }
.ic { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none }
.muted { color: var(--muted) }
.small { font-size: 14px } .tiny { font-size: 12px }
.strong { color: var(--strong); font-weight: 600 }
.center { text-align: center }
.pad { padding: 12px 8px }
.grow { flex: 1; min-width: 0 }
.row { display: flex; gap: 8px; align-items: center }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.danger-text { color: var(--red) }
::-webkit-scrollbar { width: 8px; height: 8px }
::-webkit-scrollbar-thumb { background: var(--bg-1); border-radius: 4px }
::-webkit-scrollbar-track { background: transparent }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--accent); color: #fff; border-radius: 4px; padding: 0 16px; height: 38px; font-size: 14px; font-weight: 500; white-space: nowrap; transition: background .15s }
.btn:hover:not(:disabled) { background: var(--accent-h) }
.btn.danger { background: var(--red) } .btn.danger:hover:not(:disabled) { background: var(--red-h) }
.btn.secondary { background: #4e5058 } .btn.secondary:hover:not(:disabled) { background: #6d6f78 }
[data-theme="light"] .btn.secondary { background: #6d6f78 }
.btn.ok { background: var(--green) }
.btn.sm { height: 30px; padding: 0 12px; font-size: 13px }
.btn.lg { height: 44px; font-size: 16px }
.btn.block { width: 100% }
.link { color: #00a8fc; font-size: 14px; padding: 0 16px; height: 38px }
.link:hover { text-decoration: underline }
.link.inline { padding: 0; height: auto }
.icon-btn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 4px; color: var(--muted) }
.icon-btn:hover { background: var(--hover); color: var(--text) }
.icon-btn.sm { width: 20px; height: 20px }
.round-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--bg-2); color: var(--muted) }
.round-btn:hover { color: var(--strong) }
.round-btn.ok:hover { color: var(--green) }
.round-btn.danger:hover { color: var(--red) }
.badge { display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; margin-left: 6px }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 8px; text-align: left }
.field > span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--muted) }
.field small { font-size: 12px; color: var(--muted) }
.form-err { color: #fa777c; font-size: 14px; min-height: 0 }
.form-err:empty { display: none }
.stack { display: flex; flex-direction: column; gap: 16px }
.narrow { max-width: 420px }

/* ---------- auth ---------- */
.auth { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 24px;
  background: radial-gradient(1200px 600px at 10% -10%, #5865f2 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #3b2ca8 0%, transparent 55%), #0f1014 }
.auth-card { background: var(--bg-3); width: min(480px, 100%); padding: 32px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, .2), 0 24px 64px rgba(0, 0, 0, .35); display: flex; flex-direction: column; gap: 20px; text-align: center }
.auth-card h1 { margin-bottom: -12px }
.brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: .02em; color: var(--strong) }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--accent); color: #fff }
.auth-card .small { text-align: left; margin-top: -8px }
.lang-switch { display: flex; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: 13px; padding-top: 8px; border-top: 1px solid var(--border-soft) }
.lang-switch svg { margin-right: 4px }
.lang-switch button { padding: 4px 8px; border-radius: 4px; color: var(--muted) }
.lang-switch button:hover { color: var(--text) }
.lang-switch button.on { background: var(--hover); color: var(--strong) }
.auth-foot { display: flex; align-items: center; gap: 6px; color: rgba(255, 255, 255, .6); font-size: 12px }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 72px 240px 1fr auto; height: 100% }

#nav { background: var(--bg-1); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; overflow-y: auto; scrollbar-width: none }
#nav::-webkit-scrollbar { display: none }
.nav-item { position: relative; width: 72px; display: flex; justify-content: center }
.pill { position: absolute; left: 0; top: 50%; width: 4px; height: 0; margin-top: 0; background: var(--strong); border-radius: 0 4px 4px 0; transition: height .15s, margin .15s }
.nav-item:hover .pill { height: 20px; margin-top: -10px }
.nav-item.active .pill { height: 40px; margin-top: -20px }
.srv { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 24px; background: var(--bg-3); color: var(--text); font-weight: 600; font-size: 15px; transition: border-radius .15s, background .15s, color .15s; overflow: hidden }
.nav-item:hover .srv, .nav-item.active .srv { border-radius: 16px; background: var(--accent); color: #fff }
.srv.green { color: var(--green) }
.nav-item:hover .srv.green { background: var(--green); color: #fff }
.nav-badge { position: absolute; right: 10px; bottom: -2px; border: 3px solid var(--bg-1); height: 22px; min-width: 22px; border-radius: 11px; margin: 0 }
.sep { width: 32px; height: 2px; border-radius: 1px; background: var(--border); flex: none }

#side { background: var(--bg-2); display: flex; flex-direction: column; min-width: 0 }
.side-head { height: 48px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 16px; border-bottom: 1px solid var(--bg-1); box-shadow: 0 1px 0 var(--border-soft); color: var(--strong); font-weight: 600; text-align: left; width: 100% }
.menu-btn:hover { background: var(--hover) }
.side-scroll { flex: 1; overflow-y: auto; padding: 8px }
.cat { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); padding: 18px 8px 6px }
.item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; height: 34px; padding: 0 8px; border-radius: 4px; color: var(--muted); margin: 1px 0; font-weight: 500 }
.item:hover { background: var(--hover); color: var(--text) }
.item.active { background: var(--active); color: var(--strong) }
.item.big { height: 42px; gap: 12px }
.item.dm { height: 42px; gap: 12px }
.user-panel { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 8px; background: color-mix(in srgb, var(--bg-1) 70%, var(--bg-2)); flex: none }
.user-panel > .grow { line-height: 1.2 }

.avatar { --s: 32px; position: relative; width: var(--s); height: var(--s); border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: calc(var(--s) * .42); flex: none; user-select: none }
.status { position: absolute; right: -2px; bottom: -2px; width: calc(var(--s) * .38); height: calc(var(--s) * .38); min-width: 12px; min-height: 12px; border-radius: 50%; border: 3px solid var(--bg-2) }
.status.on { background: var(--green) }
.status.off { background: #80848e; box-shadow: inset 0 0 0 3px #80848e }
.status.off::after { content: ""; position: absolute; inset: 25%; border-radius: 50%; background: var(--bg-2) }
.profile-card .status, .welcome .status { border-color: var(--card) }

#main { display: flex; flex-direction: column; min-width: 0; background: var(--bg-3) }
.top { height: 48px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 16px; border-bottom: 1px solid var(--bg-1); box-shadow: 0 1px 0 var(--border-soft); color: var(--muted); white-space: nowrap; overflow: hidden }
.top strong { color: var(--strong); font-weight: 600 }
.vsep { width: 1px; height: 24px; background: var(--border); margin: 0 8px }
.tabs { display: flex; gap: 4px }
.tab { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 4px; color: var(--muted); font-weight: 500 }
.tab:hover { background: var(--hover); color: var(--text) }
.tab.active { background: var(--active); color: var(--strong) }
.tab.add { background: var(--green); color: #fff; margin-left: 8px }
.tab.add.active { background: transparent; color: var(--green) }
.tab .count { margin-left: 6px; font-size: 12px; color: var(--muted) }
.status-text { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-left: 8px }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #80848e }
.dot.on { background: var(--green) }
.enc { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); padding: 4px 8px; border-radius: 12px }

/* ---------- friends ---------- */
.page { padding: 8px 20px 20px 30px; overflow-y: auto; flex: 1 }
.page > .cat { padding-left: 0 }
.friend { display: flex; align-items: center; gap: 12px; height: 62px; padding: 0 10px; margin: 0 -10px; border-top: 1px solid var(--border-soft); border-radius: 8px }
.friend:hover { background: var(--hover); border-top-color: transparent }
.friend:hover + .friend { border-top-color: transparent }
.friend:hover .round-btn { background: var(--bg-1) }
.empty { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 80px 20px; color: var(--muted); text-align: center }
.empty-ic { display: grid; place-items: center; width: 88px; height: 88px; border-radius: 50%; background: var(--bg-2); color: var(--faint) }
.add-friend { padding: 20px 30px; border-bottom: 1px solid var(--border-soft) }
.add-friend h2 { font-size: 16px; text-transform: uppercase; margin-bottom: 4px }
.add-box { display: flex; align-items: center; gap: 12px; margin-top: 16px; background: var(--input); border-radius: 8px; padding: 0 12px; border: 1px solid var(--bg-1) }
.add-box:focus-within { border-color: var(--accent) }
.add-box input { background: none; padding: 16px 0; box-shadow: none !important }
.add-box .btn { height: 32px }

/* ---------- chat ---------- */
#msgs { flex: 1; overflow-y: auto; padding-bottom: 16px; display: flex; flex-direction: column }
.welcome { margin-top: auto; padding: 16px 16px 8px }
.welcome h1 { font-size: 32px; margin: 8px 0 4px }
.welcome-ic { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; background: var(--active); color: var(--strong) }
.day { display: flex; align-items: center; margin: 24px 16px 8px; font-size: 12px; font-weight: 600; color: var(--muted) }
.day::before, .day::after { content: ""; flex: 1; height: 1px; background: var(--border) }
.day span { padding: 0 8px }
.msg { position: relative; display: flex; gap: 16px; padding: 2px 48px 2px 16px; margin-top: 17px }
.msg.cont { margin-top: 0; padding-left: 72px }
.msg:hover { background: color-mix(in srgb, var(--bg-1) 18%, transparent) }
.msg-head { display: flex; align-items: baseline; gap: 8px }
.author { color: var(--strong); font-weight: 600 }
.time { color: var(--muted); font-size: 12px }
.hover-time { position: absolute; left: 0; width: 72px; text-align: center; font-size: 11px; color: var(--muted); top: 4px; visibility: hidden }
.msg.cont:hover .hover-time { visibility: visible }
.text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text) }
.composer { padding: 0 16px 24px; flex: none }
.composer-box { display: flex; align-items: flex-end; gap: 4px; background: var(--composer); border-radius: 8px; padding: 0 8px 0 16px }
.composer textarea { background: none; resize: none; padding: 11px 0; max-height: 200px; line-height: 22px; box-shadow: none !important }
.composer .send { margin-bottom: 6px }
.composer .send:hover { color: var(--accent) }

.compact .msg { margin-top: 2px; padding-left: 16px }
.compact .msg > .avatar { display: none }
.compact .msg.cont { padding-left: 16px }
.compact .msg .grow { display: flex; gap: 8px; align-items: baseline }
.compact .msg-head { flex-direction: row-reverse; flex: none }
.compact .hover-time { display: none }

/* ---------- members ---------- */
#members { background: var(--bg-2); width: 240px; padding: 0 8px 16px; overflow-y: auto }
.member { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 8px; border-radius: 4px; color: var(--text); font-weight: 500 }
.member:hover { background: var(--hover) }
.member.offline { opacity: .4 }
.crown { color: var(--yellow); display: grid }

/* ---------- floating: menu, modal, toast ---------- */
.menu { position: fixed; z-index: 70; background: var(--bg-float); border-radius: 6px; padding: 6px 8px; box-shadow: var(--shadow); border: 1px solid var(--border-soft); animation: pop .12s ease-out }
.menu-item { display: flex; align-items: center; width: 100%; height: 32px; padding: 0 8px; border-radius: 3px; font-size: 14px; font-weight: 500; color: var(--text); text-align: left }
.menu-item:hover { background: var(--accent); color: #fff }
.menu-item.accent { color: #949cf7 } .menu-item.accent:hover { color: #fff }
.menu-item.danger { color: #f23f43 } .menu-item.danger:hover { background: var(--red); color: #fff }
.menu-sep { height: 1px; background: var(--border-soft); margin: 4px }

.modal-bg { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .7); display: grid; place-items: center; padding: 16px; animation: fade .15s }
.modal { background: var(--bg-3); border-radius: 8px; width: min(440px, 100%); box-shadow: var(--shadow); overflow: hidden; animation: pop .15s ease-out }
.modal-body { padding: 24px 16px 16px; display: flex; flex-direction: column; gap: 12px }
.modal-body h2 { text-align: center; margin: 0 }
.modal-body > .muted { text-align: center }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px; background: var(--bg-2) }
.copy-box { display: flex; align-items: center; gap: 8px; background: var(--input); border-radius: 4px; padding: 4px 4px 4px 12px }
.copy-box code { flex: 1; font: 16px/1 ui-monospace, Consolas, monospace; color: var(--strong); letter-spacing: .05em }
.copy-box .btn.ok { background: var(--green) }
.warn-box { display: flex; gap: 10px; align-items: flex-start; background: color-mix(in srgb, var(--yellow) 14%, transparent); border: 1px solid var(--yellow); color: var(--text); padding: 10px 12px; border-radius: 4px; font-size: 14px }
.warn-box svg { color: var(--yellow) }

#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none }
.toast { display: flex; align-items: center; gap: 8px; background: var(--bg-float); color: var(--strong); padding: 10px 14px; border-radius: 6px; box-shadow: var(--shadow); border: 1px solid var(--border-soft); font-size: 14px; animation: pop .15s ease-out; transition: opacity .3s, transform .3s }
.toast.ok svg { color: var(--green) }
.toast.err svg { color: #f23f43 }
.toast.out { opacity: 0; transform: translateY(6px) }
@keyframes pop { from { opacity: 0; transform: scale(.96) } }
@keyframes fade { from { opacity: 0 } }

/* ---------- settings ---------- */
.settings { position: fixed; inset: 0; z-index: 50; display: flex; background: var(--bg-3) }
.set-side { flex: 1 0 218px; background: var(--bg-2); display: flex; justify-content: flex-end; overflow-y: auto }
.set-side-inner { width: 218px; padding: 60px 6px 60px 20px }
.set-side .cat { padding: 6px 10px; margin-top: 12px }
.set-nav { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; margin-bottom: 2px; border-radius: 4px; color: var(--muted); font-weight: 500; text-align: left }
.set-nav:hover { background: var(--hover); color: var(--text) }
.set-nav.active { background: var(--active); color: var(--strong) }
.set-nav.danger { color: #f23f43 }
.set-sep { height: 1px; background: var(--border-soft); margin: 24px 0 }
.set-side .set-sep { margin: 8px 10px }
.set-main { flex: 1 1 800px; display: flex; overflow-y: auto }
.set-content { width: 100%; max-width: 740px; padding: 60px 40px 80px }
.set-content.wide { max-width: 1000px }
.set-content > h2 { margin-bottom: 20px }
.set-close { flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 60px 21px 0 0; color: var(--muted); font-size: 13px; font-weight: 600; position: sticky; top: 0 }
.close-circle { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--muted); color: var(--muted) }
.close-circle:hover { background: var(--hover); color: var(--strong); border-color: var(--strong) }

.profile-card { background: var(--card); border-radius: 8px; overflow: hidden }
.banner { height: 100px; background: linear-gradient(120deg, var(--accent), #8b5cf6) }
.profile-row { display: flex; align-items: flex-end; gap: 16px; padding: 0 16px; margin-top: -40px }
.profile-row .avatar { box-shadow: 0 0 0 6px var(--card) }
.profile-row .grow { display: flex; align-items: center; gap: 10px; padding-bottom: 6px }
.profile-name { font-size: 20px; font-weight: 700; color: var(--strong) }
.profile-info { margin: 16px; padding: 16px; background: var(--bg-1); border-radius: 8px; display: flex; flex-direction: column; gap: 16px }
[data-theme="light"] .profile-info { background: #fff }
.info .cat { padding: 0 0 4px }
.danger-zone { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; border: 1px solid color-mix(in srgb, var(--red) 50%, transparent); border-radius: 8px }

.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 20%, transparent); color: #949cf7 }
[data-theme="light"] .tag { color: var(--accent) }
.tag.plain { background: var(--hover); color: var(--muted) }
.tag.red { background: color-mix(in srgb, var(--red) 20%, transparent); color: #f23f43 }
.tag.green { background: color-mix(in srgb, var(--green) 20%, transparent); color: var(--green) }

.feature-list { display: flex; flex-direction: column; gap: 8px }
.feat { display: flex; gap: 14px; padding: 16px; background: var(--card); border-radius: 8px }
.feat-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: #949cf7; flex: none }
.feat p { margin-top: 2px }

.themes { display: flex; gap: 16px; flex-wrap: wrap }
.theme-card { display: flex; flex-direction: column; gap: 8px; align-items: center; color: var(--text); font-size: 14px; font-weight: 500 }
.swatch { display: flex; width: 120px; height: 72px; border-radius: 8px; overflow: hidden; border: 2px solid var(--border); transition: border-color .15s }
.swatch i { flex: 1 }
.theme-card:hover .swatch { border-color: var(--muted) }
.theme-card.active .swatch { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) }
.theme-card.dark i:nth-child(1) { background: #1e1f22; flex: .5 } .theme-card.dark i:nth-child(2) { background: #2b2d31 } .theme-card.dark i:nth-child(3) { background: #313338; flex: 2 }
.theme-card.midnight i:nth-child(1) { background: #000; flex: .5 } .theme-card.midnight i:nth-child(2) { background: #0e0f11 } .theme-card.midnight i:nth-child(3) { background: #141518; flex: 2 }
.theme-card.light i:nth-child(1) { background: #e3e5e8; flex: .5 } .theme-card.light i:nth-child(2) { background: #f2f3f5 } .theme-card.light i:nth-child(3) { background: #fff; flex: 2 }

.toggle-row { position: relative; display: flex; align-items: center; gap: 16px; padding: 4px 0; cursor: pointer }
.toggle-row input { position: absolute; opacity: 0; width: 1px; height: 1px }
.switch { position: relative; width: 40px; height: 24px; border-radius: 12px; background: #80848e; flex: none; transition: background .15s }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s }
.toggle-row input:checked + .switch { background: var(--green) }
.toggle-row input:checked + .switch::after { transform: translateX(16px) }
.toggle-row input:focus-visible + .switch { box-shadow: 0 0 0 2px var(--accent) }

.radio-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px }
.radio { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 4px; background: var(--card); text-align: left }
.radio:hover { background: var(--active) }
.radio.active { background: var(--active) }
.radio-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--muted); flex: none; display: grid; place-items: center }
.radio.active .radio-dot { border-color: var(--accent) }
.radio.active .radio-dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent) }

/* ---------- admin ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px }
.stat { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--card); border-radius: 8px; color: var(--muted); font-size: 13px }
.stat b { display: block; font-size: 24px; line-height: 1.1; color: var(--strong) }
.stat-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: #949cf7 }
.admin-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px }
.search { width: 240px; height: 32px; padding: 0 10px; font-size: 14px }
.table-wrap { background: var(--card); border-radius: 8px; overflow: auto }
table { width: 100%; border-collapse: collapse; font-size: 14px }
th { text-align: left; padding: 10px 14px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); border-bottom: 1px solid var(--border) }
td { padding: 10px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle }
tbody tr:last-child td { border-bottom: 0 }
tbody tr:hover { background: var(--hover) }
td.right { text-align: right }
.acts { display: inline-flex; gap: 6px }
.mini-srv { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; flex: none }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .layout { grid-template-columns: 72px 240px 1fr } #members { display: none } }
@media (max-width: 760px) {
  .layout { grid-template-columns: 72px 1fr } #side { display: none }
  .set-side { flex: 0 0 auto } .set-side-inner { width: 180px; padding: 24px 6px }
  .set-content { padding: 24px 16px } .stats { grid-template-columns: repeat(2, 1fr) }
  .tabs .tab:not(.active):not(.add) { display: none }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important } }

/* ---------- avatars with images, user links ---------- */
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block }
.user-link { display: inline-flex; align-items: center; text-align: left; border-radius: 50% }
.msg-head .user-link { border-radius: 2px }
.msg-head .user-link:hover .author, .top .user-link:hover strong { text-decoration: underline }
.msg > .user-link { align-self: flex-start; margin-top: 2px }
.me-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 2px; margin-left: -2px; border-radius: 4px; text-align: left; line-height: 1.2 }
.me-btn:hover { background: var(--hover) }
.member { width: 100%; text-align: left }
.friend { cursor: pointer }
.uname { margin-left: 6px; opacity: 0; transition: opacity .1s }
.friend:hover .uname { opacity: 1 }
.uname-big { font-size: 20px; color: var(--strong); margin-bottom: 8px }

/* ---------- attachments ---------- */
.msg .grow > .text + * { margin-top: 4px }
.att-img { display: block; margin-top: 4px; border-radius: 8px; overflow: hidden; max-width: min(400px, 100%); cursor: zoom-in }
.att-img img { display: block; max-width: 100%; max-height: 350px; object-fit: contain; background: var(--bg-2) }
.att-file { display: flex; align-items: center; gap: 10px; margin-top: 4px; padding: 10px; width: min(430px, 100%); background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: 8px }
.att-ic { color: var(--accent); display: grid }
.att-name { display: block; color: #00a8fc; text-decoration: none; font-weight: 500 }
.att-name:hover { text-decoration: underline }
.att-video, .att-audio { width: min(430px, 100%); margin-top: 4px }
.att-media { display: block; width: 100%; max-height: 320px; border-radius: 8px 8px 0 0; background: #000 }
.att-video .att-file { margin-top: 0; border-radius: 0 0 8px 8px }
.att-audio .att-file { border-radius: 8px 8px 0 0 }
.att-audio audio { width: 100%; display: block; background: var(--bg-2); border-radius: 0 0 8px 8px }
.lightbox { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; max-width: 90vw }
.lightbox img { max-width: 90vw; max-height: 82vh; border-radius: 4px; object-fit: contain }
.lightbox a { color: #fff; opacity: .7; font-size: 14px }
.lightbox a:hover { opacity: 1; text-decoration: underline }
.modal.bare { background: none; box-shadow: none; width: auto; overflow: visible }

.composer .attach { margin-bottom: 6px; margin-left: -8px }
.composer .attach:hover { color: var(--strong); background: none }
.composer-box { padding-left: 12px }
.uploads { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px }
.uploads:empty { display: none }
.upload { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--bg-2); border-radius: 8px; font-size: 14px }
.upload .bar { width: 160px; height: 6px; border-radius: 3px; background: var(--bg-1); overflow: hidden }
.upload .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s }
#main { position: relative }
.drop { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(0, 0, 0, .55); pointer-events: none }
.drop > div { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 32px 48px; border-radius: 12px; background: var(--accent); color: #fff; box-shadow: var(--shadow); outline: 2px dashed rgba(255, 255, 255, .6); outline-offset: -10px }
.drop b { font-size: 20px }

/* ---------- profile card ---------- */
.modal.profile-modal { width: min(600px, 100%) }
.pcard { background: var(--bg-2); position: relative }
.p-banner { height: 140px; background-size: cover; background-position: center }
.preview .p-banner { height: 100px }
.p-top { display: flex; justify-content: space-between; align-items: flex-start; padding: 0 16px; margin-top: -50px }
.p-top .avatar { box-shadow: 0 0 0 6px var(--bg-2); background-color: var(--bg-2) }
.p-top .status { border: 6px solid var(--bg-2); width: 30px; height: 30px; right: -2px; bottom: 0 }
.p-actions { margin-top: 62px }
.p-body { padding: 12px 16px 16px }
.p-name { font-size: 22px; font-weight: 700; color: var(--strong); line-height: 1.2; overflow-wrap: anywhere }
.p-user { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; margin-top: 2px }
.p-section { margin-top: 12px; padding: 12px; border-radius: 8px; background: var(--bg-1) }
[data-theme="light"] .p-section { background: #fff }
.p-section .cat { padding: 0 0 4px }
.p-section .cat:not(:first-child) { padding-top: 12px }
.p-bio { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px }
.p-mut { display: flex; align-items: center; gap: 6px; margin-top: 10px }
.p-section .item { margin: 2px -4px; width: calc(100% + 8px); color: var(--text) }

/* ---------- profile editor ---------- */
.profile-edit { display: flex; gap: 32px; align-items: flex-start }
.profile-edit .stack { max-width: 360px }
.profile-edit textarea { resize: vertical; min-height: 90px }
.preview { width: 300px; flex: none; position: sticky; top: 0 }
.preview .pcard { border-radius: 8px; overflow: hidden; box-shadow: var(--shadow) }
.color { width: 80px; height: 40px; padding: 4px; cursor: pointer }
.count-r { align-self: flex-end }
.save-bar { position: sticky; bottom: 20px; display: flex; align-items: center; gap: 8px; margin-top: 24px; padding: 10px 10px 10px 16px; border-radius: 8px; background: var(--bg-float); box-shadow: var(--shadow); color: var(--strong); font-weight: 500; animation: pop .15s ease-out }
@media (max-width: 900px) { .profile-edit { flex-direction: column-reverse } .preview { position: static } }

/* ---------- message tools, edit, reactions ---------- */
.msg-tools { position: absolute; right: 16px; top: -16px; display: none; background: var(--bg-3); border: 1px solid var(--border-soft); border-radius: 6px; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); overflow: hidden }
.msg:hover .msg-tools, .msg-tools:focus-within { display: flex }
.tool { display: grid; place-items: center; width: 32px; height: 32px; color: var(--muted) }
.tool:hover { background: var(--hover); color: var(--strong) }
.tool.danger:hover { color: #f23f43 }
.msg.editing { background: color-mix(in srgb, var(--bg-1) 18%, transparent) }
.edited { font-size: 11px; color: var(--muted) }
.edit-wrap { margin: 4px 0 }
.edit-box { background: var(--composer); border-radius: 8px; padding: 10px 14px; resize: none; line-height: 22px; overflow: hidden }
.edit-wrap .tiny { margin-top: 4px }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px }
.reaction { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border-radius: 8px; background: var(--bg-2); border: 1px solid transparent; font-size: 13px; font-weight: 600; color: var(--muted) }
.reaction:hover { border-color: var(--border) }
.reaction.mine { background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: var(--accent); color: #c9cdfb }
[data-theme="light"] .reaction.mine { color: var(--accent) }
.reaction .emoji { font-size: 16px; line-height: 1 }
.reaction.add { opacity: 0; color: var(--muted) }
.msg:hover .reaction.add { opacity: 1 }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px }
.emoji-btn { font-size: 22px; height: 34px; border-radius: 4px }
.emoji-btn:hover { background: var(--hover) }
.composer-box.locked { padding: 12px 16px; gap: 10px; align-items: center; color: var(--muted); font-size: 14px }

/* ---------- sidebar extras ---------- */
.item-wrap { position: relative }
.item-wrap .item { padding-right: 28px }
.ch-gear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); opacity: 0; color: var(--muted) }
.item-wrap:hover .ch-gear, .ch-gear:focus-visible { opacity: 1 }
.item.connected { color: var(--green) }
.voice-user { display: flex; align-items: center; gap: 8px; width: calc(100% - 28px); height: 30px; margin-left: 28px; padding: 0 6px; border-radius: 4px; color: var(--muted); font-size: 14px; text-align: left }
.voice-user:hover { background: var(--hover); color: var(--text) }
.voice-user .avatar, .vu-wrap .avatar { transition: box-shadow .1s }
.speaking .avatar, .voice-user.speaking .avatar { box-shadow: 0 0 0 2px var(--green) }
.vu-wrap { display: inline-flex; border-radius: 50% }
.in-call { color: var(--green); display: grid }
.voice-panel { display: flex; align-items: center; gap: 8px; padding: 8px; border-bottom: 1px solid var(--border-soft); background: color-mix(in srgb, var(--bg-1) 70%, var(--bg-2)) }
.vp-status { display: flex; align-items: center; gap: 6px; color: var(--green); font-weight: 600; font-size: 14px }
.icon-btn.red { color: #f23f43 }
.icon-btn.green { color: var(--green) }
.nav-badge.green { background: var(--green) }
.nav-voice { position: absolute; right: 10px; bottom: -2px; width: 18px; height: 18px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; border: 3px solid var(--bg-1); box-sizing: content-box }
.call-badge { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 13px; font-weight: 600 }
.call-bar { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 75; display: flex; align-items: center; gap: 12px; width: min(360px, 92vw); padding: 12px 14px; background: var(--bg-float); border-radius: 12px; box-shadow: var(--shadow); border: 1px solid var(--border-soft); animation: pop .15s ease-out }
.call-yes { background: var(--green) !important; color: #fff !important }
.call-no { background: var(--red) !important; color: #fff !important }
.radio-list.tight { margin-top: 0 }
.radio .ic { color: var(--muted) }

/* ---------- server / channel settings ---------- */
.roles-layout { display: flex; gap: 24px; align-items: flex-start }
.role-list { width: 220px; flex: none; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0 }
.role-list .btn { margin-bottom: 8px }
.role-item { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 4px; color: var(--text); text-align: left; font-weight: 500 }
.role-item:hover { background: var(--hover) }
.role-item.active { background: var(--active); color: var(--strong) }
.role-dot { width: 12px; height: 12px; border-radius: 50%; flex: none }
.role-edit { flex: 1; min-width: 0 }
.role-edit > .row { align-items: flex-end; gap: 16px }
.role-edit .field:first-child { flex: 1 }
.toggle-row.perm { padding: 14px 0; border-bottom: 1px solid var(--border-soft) }
.mt { margin-top: 20px }
.perm-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border-soft) }
.tri { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; flex: none }
.tri-btn { display: grid; place-items: center; width: 32px; height: 28px; color: var(--muted) }
.tri-btn + .tri-btn { border-left: 1px solid var(--border) }
.tri-btn:hover { background: var(--hover) }
.tri-btn.deny.on { background: var(--red); color: #fff }
.tri-btn.inherit.on { background: #4e5058; color: #fff }
.tri-btn.allow.on { background: var(--green); color: #fff }
.ov-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent) }
.private-row { padding: 12px 16px; background: var(--card); border-radius: 8px }
.chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 4px; background: var(--bg-2); border: 1px solid var(--border); font-size: 12px; font-weight: 500 }
.chip-x { display: grid; color: var(--muted); margin-right: -2px }
.chip-x:hover { color: var(--strong) }
.chip.add { width: 24px; justify-content: center; padding: 0; color: var(--muted) }
.chip.add:hover { color: var(--strong) }
.menu-item .role-dot { margin-right: 8px }
.copy-box.narrow { max-width: 420px }
@media (max-width: 900px) { .roles-layout { flex-direction: column } .role-list { width: 100%; position: static } }

/* ---------- context menus, server header ---------- */
.side-head.split { padding: 0 8px 0 0; gap: 0 }
.head-btn { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 16px; color: var(--strong); font-weight: 600; text-align: left }
.head-btn:hover { background: var(--hover) }
.menu-label { padding: 6px 8px 2px; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted) }
.menu-item .check { width: 16px; height: 16px; border-radius: 4px; border: 2px solid var(--muted); display: grid; place-items: center; flex: none }
.menu-item .check.on { background: var(--accent); border-color: var(--accent); color: #fff }
.quick-react { display: flex; justify-content: space-between; padding: 2px 0 6px; border-bottom: 1px solid var(--border-soft); margin-bottom: 4px }
.quick-react .emoji-btn { width: 32px; height: 32px; font-size: 18px; border-radius: 50%; background: var(--bg-2) }
.quick-react .emoji-btn:hover { background: var(--active) }
.msg-tools { display: flex; opacity: 0; pointer-events: none }
.msg:hover .msg-tools, .msg-tools:focus-within { opacity: 1; pointer-events: auto }

/* =====================================================================
   CIPHER "AURORA" LOOK — floating glass panels, violet→cyan accent.
   Overrides the base layout above so the app no longer mirrors Discord.
   ===================================================================== */
:root, [data-theme="dark"] {
  --bg-0: #06070d; --bg-1: #0c0e18; --bg-2: #11131f; --bg-3: #141726; --bg-float: #171a2b;
  --card: #191c2e; --input: #0d0f1b; --composer: #1a1e33;
  --hover: rgba(140, 150, 255, .07); --active: rgba(140, 150, 255, .14);
  --text: #d6daf0; --strong: #f7f8ff; --muted: #8890b4; --faint: #5d6488;
  --border: rgba(255, 255, 255, .09); --border-soft: rgba(255, 255, 255, .055);
  --accent: #7c5cff; --accent-h: #6a48f5; --accent-2: #22d3ee;
  --grad: linear-gradient(135deg, #7c5cff 0%, #4f7bff 50%, #22d3ee 100%);
  --green: #2dd4a4; --red: #ff4d6d; --red-h: #e23656; --yellow: #ffc857;
  --shadow: 0 18px 50px rgba(0, 0, 0, .55);
  --radius: 18px; --app-bg: radial-gradient(1000px 600px at 0% 0%, rgba(124, 92, 255, .18), transparent 60%), radial-gradient(900px 600px at 100% 100%, rgba(34, 211, 238, .12), transparent 60%), #06070d;
}
[data-theme="midnight"] {
  --bg-0: #000; --bg-1: #030305; --bg-2: #08080c; --bg-3: #0b0b11; --bg-float: #101018; --card: #101018; --input: #050508; --composer: #12121b;
  --app-bg: radial-gradient(900px 500px at 0% 0%, rgba(124, 92, 255, .1), transparent 60%), #000;
}
[data-theme="light"] {
  --bg-0: #eef0fb; --bg-1: #e6e8f7; --bg-2: #f6f7fe; --bg-3: #ffffff; --bg-float: #fff; --card: #f3f4fc; --input: #eceefa; --composer: #f1f2fb;
  --hover: rgba(90, 80, 200, .07); --active: rgba(90, 80, 200, .13);
  --text: #2a2d45; --strong: #0d0f22; --muted: #6a6f90; --faint: #9a9ebb;
  --border: rgba(20, 20, 60, .1); --border-soft: rgba(20, 20, 60, .06);
  --shadow: 0 18px 50px rgba(40, 40, 110, .16);
  --app-bg: radial-gradient(900px 600px at 0% 0%, rgba(124, 92, 255, .18), transparent 60%), radial-gradient(900px 600px at 100% 100%, rgba(34, 211, 238, .16), transparent 60%), #eef0fb;
}
body { background: var(--app-bg); font-family: "Segoe UI Variable Display", "Segoe UI", "Inter", system-ui, sans-serif; letter-spacing: .005em }
::-webkit-scrollbar-thumb { background: var(--active); border-radius: 8px }
input, textarea { border-radius: 12px; border: 1px solid var(--border-soft) }
input:focus-visible, textarea:focus-visible { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent); border-color: transparent }

/* buttons: pills with gradient */
.btn { border-radius: 999px; background: var(--grad); background-size: 140% 140%; font-weight: 600; box-shadow: 0 6px 18px -6px rgba(124, 92, 255, .6); transition: transform .12s, box-shadow .15s, background-position .3s }
.btn:hover:not(:disabled) { background: var(--grad); background-size: 140% 140%; background-position: 100% 0; transform: translateY(-1px); box-shadow: 0 10px 24px -8px rgba(124, 92, 255, .75) }
.btn.secondary, [data-theme="light"] .btn.secondary { background: var(--active); color: var(--strong); box-shadow: none }
.btn.secondary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 24%, transparent); box-shadow: none }
.btn.danger { background: linear-gradient(135deg, #ff4d6d, #ff7a59); box-shadow: 0 6px 18px -6px rgba(255, 77, 109, .6) }
.btn.danger:hover:not(:disabled) { background: linear-gradient(135deg, #ff3a5d, #ff6a45) }
.btn.ok { background: linear-gradient(135deg, #2dd4a4, #22d3ee); color: #052a22; box-shadow: 0 6px 18px -6px rgba(45, 212, 164, .6) }
.link { color: var(--accent-2) }
.icon-btn { border-radius: 10px }
.icon-btn.round { width: 38px; height: 38px; border-radius: 50%; background: var(--active); color: var(--strong) }
.icon-btn.red:hover { color: var(--red) }
.badge { background: var(--red) }

/* layout: floating panels with gaps */
.layout { grid-template-columns: 76px 256px 1fr auto; gap: 10px; padding: 10px; background: transparent }
#nav { background: transparent; padding: 6px 0; gap: 10px }
.nav-item { width: 76px }
.pill { width: 4px; background: var(--grad); border-radius: 0 6px 6px 0 }
.srv { width: 50px; height: 50px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--border-soft); transition: border-radius .2s, transform .15s, box-shadow .2s }
.nav-item:hover .srv { border-radius: 14px; background: var(--active); color: var(--strong); transform: translateY(-1px) }
.nav-item.active .srv { border-radius: 14px; background: var(--grad); color: #fff; box-shadow: 0 8px 22px -6px rgba(124, 92, 255, .7); border-color: transparent }
.srv.green { color: var(--green) }
.nav-item:hover .srv.green { background: color-mix(in srgb, var(--green) 20%, transparent); color: var(--green) }
.sep { width: 28px; background: var(--border) }
.nav-badge { border-color: var(--bg-0) }

#side, #main, #members { border-radius: var(--radius); border: 1px solid var(--border-soft); box-shadow: 0 10px 40px -18px rgba(0, 0, 0, .6); overflow: hidden }
#side { background: color-mix(in srgb, var(--bg-2) 92%, transparent); backdrop-filter: blur(16px) }
#main { background: color-mix(in srgb, var(--bg-3) 94%, transparent) }
#members { background: color-mix(in srgb, var(--bg-2) 92%, transparent); width: 250px; padding: 0 10px 16px; overflow-y: auto }
.side-head, .top { height: 56px; border-bottom: 1px solid var(--border-soft); box-shadow: none }
.side-head .strong, .top strong { font-size: 15px; letter-spacing: .01em }
.cat { font-size: 11px; letter-spacing: .08em; padding: 18px 10px 6px }
.item { border-radius: 10px; height: 36px; transition: background .12s, color .12s }
.item.active { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 26%, transparent), color-mix(in srgb, var(--accent-2) 8%, transparent)); color: var(--strong); box-shadow: inset 2px 0 0 var(--accent) }
.item.dm, .item.big { height: 46px }
.user-panel { margin: 8px; height: 56px; border-radius: 14px; background: var(--bg-1); border: 1px solid var(--border-soft); padding: 0 8px }
.voice-panel { margin: 0 8px; border-radius: 14px }
.status { border-color: var(--bg-2) }
.tab { border-radius: 999px; height: 30px; padding: 0 14px }
.tab.active { background: var(--grad); color: #fff }
.tab.active .count { color: rgba(255, 255, 255, .8) }
.tab.add { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green) }
.enc { border-radius: 999px; background: color-mix(in srgb, var(--green) 12%, transparent) }

/* chat */
.msg { margin: 10px 10px 0; padding: 4px 48px 4px 12px; border-radius: 14px }
.msg.cont { margin-top: 0; padding-left: 68px }
.msg:hover { background: var(--hover) }
.author { font-weight: 650 }
.day { margin: 24px 20px 8px }
.day span { padding: 3px 12px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--border-soft) }
.day::before, .day::after { background: var(--border-soft) }
.welcome-ic { border-radius: 22px; background: var(--grad); color: #fff }
.composer { padding: 0 16px 16px }
.composer-box { border-radius: 22px; background: var(--composer); border: 1px solid var(--border); box-shadow: 0 12px 30px -16px rgba(0, 0, 0, .7); padding: 2px 8px 2px 14px }
.composer-box:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, transparent) }
.composer textarea { border: 0 }
.composer .send { color: #fff; background: var(--grad); border-radius: 50%; width: 34px; height: 34px; margin: 0 0 5px }
.composer .send:hover { color: #fff; filter: brightness(1.1) }
.msg-tools { border-radius: 12px; background: var(--bg-float); border-color: var(--border) }
.reaction { border-radius: 999px }
.att-img, .att-file, .att-media { border-radius: 14px }

/* members panel: role groups */
.mem-head { display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 6px; color: var(--muted); border-bottom: 1px solid var(--border-soft); margin: 0 -10px 4px; padding: 0 16px; position: sticky; top: 0; background: inherit; z-index: 1 }
.mem-head .strong { font-size: 15px }
.count { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--active); color: var(--muted); text-transform: none; letter-spacing: 0 }
.mem-group { margin-top: 6px }
.mem-group.role { background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 10%, transparent), transparent 70%); border-radius: 14px; padding: 0 4px 4px; border: 1px solid color-mix(in srgb, var(--rc) 18%, transparent) }
.mem-cat { gap: 8px; justify-content: flex-start; padding: 12px 8px 6px }
.mem-group.role .mem-cat { color: color-mix(in srgb, var(--rc) 70%, var(--strong)) }
.member { border-radius: 12px; height: 46px }
.member:hover { background: var(--hover) }
.role-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; display: inline-block; box-shadow: 0 0 8px currentColor }

/* menus, modals, toasts */
.menu { border-radius: 14px; background: var(--bg-float); border: 1px solid var(--border); padding: 6px; backdrop-filter: blur(12px) }
.menu-item { border-radius: 9px }
.menu-item:hover { background: var(--grad); color: #fff }
.modal-bg { background: rgba(4, 5, 12, .72); backdrop-filter: blur(6px) }
.modal { border-radius: 22px; background: var(--bg-3); border: 1px solid var(--border) }
.modal-foot { background: var(--bg-2); border-top: 1px solid var(--border-soft) }
.toast { border-radius: 999px; padding: 10px 18px; background: var(--bg-float) }

/* auth */
.auth { background: radial-gradient(900px 600px at 15% 10%, rgba(124, 92, 255, .45), transparent 60%), radial-gradient(800px 500px at 90% 90%, rgba(34, 211, 238, .3), transparent 60%), #06070d }
.auth-card { border-radius: 26px; background: color-mix(in srgb, var(--bg-3) 82%, transparent); border: 1px solid var(--border); backdrop-filter: blur(18px) }
.brand-mark { background: var(--grad); border-radius: 14px; box-shadow: 0 8px 24px -6px rgba(124, 92, 255, .7) }

/* settings */
.settings { background: var(--app-bg) }
.set-side { background: color-mix(in srgb, var(--bg-2) 85%, transparent); border-right: 1px solid var(--border-soft) }
.set-nav { border-radius: 10px }
.set-nav.active { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 26%, transparent), transparent); color: var(--strong); box-shadow: inset 2px 0 0 var(--accent) }
.feat, .radio, .stat, .table-wrap, .profile-card { border-radius: 16px; border: 1px solid var(--border-soft) }
.feat-ic, .stat-ic { border-radius: 12px; background: var(--grad); color: #fff }
.switch { background: var(--active) }
.toggle-row input:checked + .switch { background: var(--grad) }
.tag { border-radius: 999px; color: #c4b5ff }
.tag.on { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green) }
.tag.off { background: var(--hover); color: var(--muted) }
.tag i { width: 7px; height: 7px; border-radius: 50%; background: currentColor }
.mini-srv { background: var(--grad); border-radius: 9px }
.mini-srv.big { width: 72px; height: 72px; border-radius: 22px; font-size: 22px }
.chip { border-radius: 999px }
.chip.active { background: var(--grad); color: #fff; border-color: transparent }

/* ---------- profile v2 ---------- */
.modal.profile-modal { width: min(560px, 100%); background: transparent; border: 0; box-shadow: none; overflow: visible }
.pcard { background: var(--bg-3); border-radius: 26px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow) }
.pcard .p-banner { height: 170px; position: relative }
.pcard .p-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, var(--bg-3) 100%) }
.preview .pcard .p-banner { height: 110px }
.p-head { position: relative; display: flex; align-items: flex-end; gap: 16px; padding: 0 22px; margin-top: -64px; z-index: 1; flex-wrap: wrap }
.preview .p-head { margin-top: -54px; gap: 12px; padding: 0 16px }
.p-ring { padding: 4px; border-radius: 50%; background: var(--grad); box-shadow: 0 12px 34px -8px rgba(124, 92, 255, .8); flex: none }
.p-ring .avatar { box-shadow: 0 0 0 4px var(--bg-3); background-color: var(--bg-3) }
.p-ring .status { border: 5px solid var(--bg-3); width: 28px; height: 28px; right: 0; bottom: 2px }
.preview .p-ring .avatar { --s: 84px !important; width: 84px; height: 84px }
.p-id { flex: 1; min-width: 160px; padding-bottom: 4px }
.p-name { font-size: 26px; font-weight: 800; line-height: 1.15; color: var(--strong); overflow-wrap: anywhere; background: linear-gradient(90deg, var(--strong), color-mix(in srgb, var(--accent-2) 60%, var(--strong))); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent }
.preview .p-name { font-size: 20px }
.p-user { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin-top: 4px }
.p-actions { display: flex; gap: 8px; align-items: center; margin: 0 0 6px auto }
.p-body { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 12px }
.preview .p-body { padding: 14px 16px 16px }
.p-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }
.p-stat { display: flex; flex-direction: column; align-items: center; padding: 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--border-soft) }
.p-stat b { font-size: 22px; color: var(--strong); background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent }
.p-stat span { font-size: 12px; color: var(--muted) }
.p-box { padding: 14px 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--border-soft) }
.p-label { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px }
.p-label .ic { color: var(--accent-2) }
.p-bio { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5 }
.p-facts { display: flex; gap: 22px; flex-wrap: wrap }
.p-fact { display: flex; flex-direction: column; gap: 2px }
.p-fact b { display: inline-flex; align-items: center; gap: 5px; color: var(--strong); font-weight: 600; font-size: 14px }
.p-fact b .ic { color: var(--yellow) }
.p-box .chips { margin-top: 12px }
.p-servers { display: flex; flex-wrap: wrap; gap: 8px }
.p-srv { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--border-soft); max-width: 220px; font-weight: 500 }
.p-srv:hover { border-color: var(--accent) }
.preview .pcard { border-radius: 22px }

/* ---------- admin v2 ---------- */
.stats { grid-template-columns: repeat(4, 1fr) }
.adm-hero { display: flex; align-items: center; gap: 16px; padding: 18px; margin: 12px 0 16px; border-radius: 20px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--card)), var(--card)); border: 1px solid var(--border) }
.adm-hero h2 { margin: 0 }
.adm-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px }
.adm-fact { display: flex; flex-direction: column; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--border-soft); font-size: 12px; color: var(--muted) }
.adm-fact b { color: var(--strong); font-size: 16px }
.set-content h3 { margin-top: 20px }
.back { margin-bottom: 4px }
.row.wrap { flex-wrap: wrap }
.adm-msgs { display: flex; flex-direction: column; gap: 6px }
.adm-msg { display: flex; gap: 12px; padding: 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--border-soft) }
.adm-msg:hover { border-color: var(--border) }
.adm-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 2px }
.adm-where { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent-2) 14%, transparent); color: var(--accent-2) }
.adm-where.dm { background: color-mix(in srgb, var(--accent) 16%, transparent); color: #b9a8ff }
.adm-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px }
.adm-file { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--accent-2); font-size: 13px }
.acts.col { flex-direction: column; gap: 4px }
.acts .icon-btn.sm { width: 30px; height: 30px }
.link-plain { text-align: left }
.link-plain:hover { text-decoration: underline }
tr.clickable { cursor: pointer }
.pad-b { padding-bottom: 4px }
@media (max-width: 760px) { .layout { gap: 6px; padding: 6px } .adm-facts { grid-template-columns: repeat(2, 1fr) } }

/* =====================================================================
   PROFESSIONAL TONE — calm graphite surfaces, one solid accent,
   no gradients, glows or neon. Overrides the Aurora block above.
   ===================================================================== */
:root, [data-theme="dark"] {
  --bg-0: #0f1115; --bg-1: #14161b; --bg-2: #181b21; --bg-3: #1c1f26; --bg-float: #22252d;
  --card: #20232b; --input: #14161b; --composer: #22252d;
  --hover: rgba(255, 255, 255, .045); --active: rgba(255, 255, 255, .08);
  --text: #d4d7de; --strong: #f3f4f6; --muted: #8b909c; --faint: #5f6470;
  --border: rgba(255, 255, 255, .08); --border-soft: rgba(255, 255, 255, .05);
  --accent: #4c6ef5; --accent-h: #3f5fe0; --accent-2: #8aa2ff;
  --grad: var(--accent);
  --green: #3fb27f; --red: #e5484d; --red-h: #cc3a3f; --yellow: #e2b340;
  --shadow: 0 12px 32px rgba(0, 0, 0, .35);
  --radius: 12px; --app-bg: #0f1115;
}
[data-theme="midnight"] { --bg-0: #000; --bg-1: #07080a; --bg-2: #0c0d10; --bg-3: #101114; --bg-float: #16171b; --card: #15161a; --input: #08090b; --composer: #16171b; --app-bg: #000 }
[data-theme="light"] {
  --bg-0: #eceef2; --bg-1: #e4e7ec; --bg-2: #f6f7f9; --bg-3: #fff; --bg-float: #fff; --card: #f4f5f8; --input: #eef0f4; --composer: #f4f5f8;
  --hover: rgba(15, 23, 42, .045); --active: rgba(15, 23, 42, .08);
  --text: #2b2f38; --strong: #0f1218; --muted: #666c79; --faint: #9aa0ab;
  --border: rgba(15, 23, 42, .1); --border-soft: rgba(15, 23, 42, .06);
  --accent-2: #3b5bdb; --shadow: 0 12px 32px rgba(15, 23, 42, .12); --app-bg: #eceef2;
}
body { background: var(--app-bg) }

/* flat buttons */
.btn, .btn:hover:not(:disabled) { background: var(--accent); box-shadow: none; transform: none; border-radius: 8px }
.btn:hover:not(:disabled) { background: var(--accent-h) }
.btn.secondary, [data-theme="light"] .btn.secondary { background: var(--active); color: var(--strong) }
.btn.secondary:hover:not(:disabled) { background: color-mix(in srgb, var(--strong) 14%, transparent) }
.btn.danger, .btn.danger:hover:not(:disabled) { background: var(--red); box-shadow: none }
.btn.danger:hover:not(:disabled) { background: var(--red-h) }
.btn.ok, .btn.ok:hover:not(:disabled) { background: var(--green); color: #fff; box-shadow: none }
.link { color: var(--accent-2) }

/* panels: subtle, no glow */
.layout { gap: 8px; padding: 8px }
#side, #main, #members { box-shadow: none; backdrop-filter: none; border-color: var(--border-soft) }
#side, #members { background: var(--bg-2) }
#main { background: var(--bg-3) }
.srv { border-radius: 12px; box-shadow: none }
.nav-item:hover .srv { transform: none; border-radius: 12px }
.nav-item.active .srv { background: var(--accent); box-shadow: none; border-radius: 12px }
.pill { background: var(--strong) }
.item.active { background: var(--active); box-shadow: none }
.set-nav.active { background: var(--active); box-shadow: none }
.tab { border-radius: 6px; gap: 6px }
.tab.active { background: var(--active); color: var(--strong) }
.tab.active .count { color: var(--muted) }
.user-panel { border-radius: 10px }
.composer-box { border-radius: 10px; box-shadow: none }
.composer .send { background: none; color: var(--muted); border-radius: 8px }
.composer .send:hover { color: var(--accent-2); filter: none }
.msg { border-radius: 8px }
.welcome-ic, .brand-mark { background: var(--accent); box-shadow: none }
.menu, .modal { backdrop-filter: none }
.menu-item:hover { background: var(--accent) }
.modal { border-radius: 14px }
.modal-bg { backdrop-filter: none; background: rgba(0, 0, 0, .6) }
.toast { border-radius: 10px }
.auth { background: #0f1115 }
.auth-card { background: var(--bg-3); backdrop-filter: none; border-radius: 14px }
.settings { background: var(--bg-3) }
.feat-ic, .stat-ic { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-2) }
.toggle-row input:checked + .switch { background: var(--accent) }
.tag { color: var(--accent-2); background: color-mix(in srgb, var(--accent) 14%, transparent) }
.mini-srv { background: var(--accent) }
.chip.active { background: var(--accent) }
.role-dot { box-shadow: none }
.mem-group.role { background: none; border: 0; border-radius: 0; padding: 0 }
.mem-group.role .mem-cat { color: var(--muted) }

/* profile: clean */
.modal.profile-modal { width: min(520px, 100%) }
.pcard { border-radius: 14px; box-shadow: var(--shadow) }
.pcard .p-banner::after { display: none }
.pcard .p-banner { height: 150px }
.p-ring { background: var(--bg-3); box-shadow: none; padding: 5px }
.p-ring .avatar { box-shadow: none }
.p-name { background: none; -webkit-text-fill-color: currentColor; color: var(--strong); font-weight: 700; font-size: 24px }
.p-stat b { background: none; -webkit-text-fill-color: currentColor; color: var(--strong) }
.p-box, .p-stat { border-radius: 10px }
.p-label .ic { color: var(--muted) }
.p-srv:hover { border-color: var(--border) }

/* admin */
.adm-hero { background: var(--card); border-radius: 12px }
.adm-where { background: var(--active); color: var(--text) }
.adm-where.dm { background: var(--active); color: var(--text) }
.adm-msg, .adm-fact, .feat, .radio, .stat, .table-wrap { border-radius: 10px }
.table-wrap > .adm-msgs { padding: 10px }
.stat b { font-size: 20px }

/* =====================================================================
   WORKSPACE LAYOUT — top bar with named server tabs, channel sidebar,
   chat bubbles, info panel. Replaces the vertical server rail.
   ===================================================================== */
.layout { grid-template-columns: 260px 1fr auto; grid-template-rows: 52px 1fr; gap: 0; padding: 0; background: var(--bg-0) }
#nav { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 4px; padding: 0 12px; height: 52px; overflow-x: auto; overflow-y: hidden;
  background: var(--bg-1); border-bottom: 1px solid var(--border) }
.top-brand { font-size: 16px; gap: 8px; padding-right: 16px; margin-right: 8px; border-right: 1px solid var(--border); height: 28px; flex: none }
.top-brand .brand-mark { width: 28px; height: 28px; border-radius: 8px }
.nav-item { width: auto; flex: none }
.nav-item .pill, #nav .sep { display: none }
.srv, .nav-item:hover .srv, .nav-item.active .srv { width: auto; height: 34px; border-radius: 8px; padding: 0 12px 0 6px; gap: 8px; display: flex; align-items: center;
  background: transparent; border: 1px solid transparent; color: var(--muted); font-weight: 500; font-size: 14px; transform: none; box-shadow: none }
.nav-item:hover .srv { background: var(--hover); color: var(--text) }
.nav-item.active .srv { background: var(--bg-3); border-color: var(--border); color: var(--strong) }
.srv.home { padding-left: 0 }
.srv-ini { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--active); color: var(--strong); font-size: 11px; font-weight: 700 }
.nav-item.active .srv-ini { background: var(--accent); color: #fff }
.srv-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.srv.green, .nav-item:hover .srv.green { width: 34px; padding: 0; justify-content: center; color: var(--muted); background: transparent }
.nav-item:hover .srv.green { color: var(--strong); background: var(--hover) }
.nav-badge { position: static; margin-left: -4px; border: 0; height: 18px; min-width: 18px }
.nav-voice { display: none }

#side, #main, #members { border-radius: 0; border: 0; box-shadow: none }
#side { background: var(--bg-2); border-right: 1px solid var(--border) }
#main { background: var(--bg-3) }
#members { background: var(--bg-2); border-left: 1px solid var(--border); width: 260px }
.side-head, .top, .mem-head { height: 52px }
.user-panel { margin: 10px; border-radius: 10px; background: var(--bg-3); border: 1px solid var(--border) }

/* chat bubbles */
#msgs { padding: 0 8px 12px }
.msg { margin: 12px 8px 0; padding: 2px 44px 2px 4px; gap: 10px; border-radius: 0; background: none !important }
.msg.cont { margin-top: 3px; padding-left: 54px }
.msg > .user-link .avatar { --s: 36px !important; width: 36px; height: 36px }
.msg .grow { display: flex; flex-direction: column; align-items: flex-start; min-width: 0 }
.msg-head { gap: 8px; margin: 0 0 3px 4px; font-size: 13px }
.msg .text { background: var(--card); border: 1px solid var(--border-soft); padding: 8px 12px; border-radius: 4px 14px 14px 14px; max-width: min(640px, 100%); line-height: 1.45 }
.msg.cont .text { border-radius: 14px }
.msg.mine { flex-direction: row-reverse; padding: 2px 4px 2px 44px }
.msg.mine.cont { padding-left: 44px; padding-right: 4px }
.msg.mine > .user-link { display: none }
.msg.mine .grow { align-items: flex-end }
.msg.mine .msg-head { margin: 0 4px 3px 0 }
.msg.mine .msg-head .user-link { display: none }
.msg.mine .text { background: var(--accent); border-color: transparent; color: #fff; border-radius: 14px 4px 14px 14px }
.msg.mine.cont .text { border-radius: 14px }
.msg.mine .edited { color: rgba(255, 255, 255, .7) }
.msg .hover-time { display: none }
.msg-tools { top: -14px; right: auto; left: 54px }
.msg.mine .msg-tools { left: auto; right: 8px }
.msg .att-img, .msg .att-file, .msg .att-video, .msg .att-audio { margin-top: 4px }
.msg.editing .grow { align-items: stretch }
.day { margin: 22px 12px 4px }
.composer { padding: 0 16px 16px }
.compact .msg .text { background: none; border: 0; padding: 0; color: var(--text) }
.compact .msg.mine { flex-direction: row }

/* info panel on the right */
.mem-head { margin: 0 -10px 6px; border-bottom: 1px solid var(--border) }
.mem-group + .mem-group { border-top: 1px solid var(--border-soft); margin-top: 8px; padding-top: 2px }
.member { height: 42px; border-radius: 8px }

@media (max-width: 1100px) { .layout { grid-template-columns: 240px 1fr } #members { display: none } }
@media (max-width: 760px) { .layout { grid-template-columns: 1fr } #side { display: none } .srv-name { max-width: 90px } }

/* ---------- login: split screen ---------- */
.auth.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr); gap: 0; padding: 0; align-items: stretch; justify-content: stretch; background: var(--bg-0) }
.auth-show { position: relative; display: flex; flex-direction: column; gap: 40px; padding: 40px 56px; background: var(--bg-1); border-right: 1px solid var(--border); overflow: hidden }
.auth-show::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(var(--border-soft) 1px, transparent 1px), linear-gradient(90deg, var(--border-soft) 1px, transparent 1px); background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%) }
.auth-show > * { position: relative }
.auth-show .brand { justify-content: flex-start; font-size: 18px }
.auth-pitch { margin-top: auto; max-width: 480px }
.auth-pitch h1 { font-size: 40px; line-height: 1.1; letter-spacing: -.02em; margin-bottom: 14px }
.auth-pitch > p { color: var(--muted); font-size: 16px; line-height: 1.5 }
.auth-feats { display: flex; flex-direction: column; gap: 14px; margin-top: 28px }
.auth-feat { display: flex; align-items: center; gap: 14px }
.auth-feat-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--bg-3); border: 1px solid var(--border); color: var(--accent-2); flex: none }
.auth-feat b { display: block; color: var(--strong); font-size: 14px; font-weight: 600 }
.auth-feat span { color: var(--muted); font-size: 13px }
.demo { margin-bottom: auto; max-width: 420px; padding: 14px; border-radius: 14px; background: var(--bg-3); border: 1px solid var(--border); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px }
.demo-head { display: flex; align-items: center; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--border-soft); color: var(--strong); font-weight: 600; font-size: 14px }
.demo-enc { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); padding: 2px 8px; border-radius: 999px }
.demo-msg { display: flex; gap: 8px; align-items: flex-end }
.demo-msg.mine { justify-content: flex-end }
.demo-av { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--active); color: var(--strong); font-size: 12px; font-weight: 700; flex: none }
.demo-who { display: block; font-size: 11px; color: var(--muted); margin: 0 0 2px 4px }
.demo-msg p { background: var(--card); border: 1px solid var(--border-soft); padding: 7px 12px; border-radius: 4px 14px 14px 14px; font-size: 14px }
.demo-msg.mine p { background: var(--accent); color: #fff; border-color: transparent; border-radius: 14px 4px 14px 14px }

.auth-panel { display: grid; place-items: center; padding: 40px 24px; background: var(--bg-0); overflow-y: auto }
.auth-form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 18px }
.auth-form h2 { font-size: 26px; margin-bottom: 4px; letter-spacing: -.01em }
.auth-form input { height: 44px; background: var(--bg-2); border: 1px solid var(--border) }
.auth-form input:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent) }
.auth-form .field > span { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; color: var(--text) }
.auth-form .btn.lg { height: 46px }
.segs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--border) }
.seg { height: 34px; border-radius: 7px; color: var(--muted); font-weight: 600; font-size: 14px }
.seg:hover { color: var(--text) }
.seg.on { background: var(--bg-3); color: var(--strong); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); border: 1px solid var(--border) }
.auth-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--border-soft) }
.auth-meta .row { gap: 6px }
.auth-meta .lang-switch { border: 0; padding: 0 }
@media (max-width: 900px) { .auth.split { grid-template-columns: 1fr } .auth-show { display: none } }

/* ---------- settings: workspace style ---------- */
.settings { display: grid; grid-template-columns: 280px 1fr; grid-template-rows: 52px 1fr; background: var(--bg-3) }
.set-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 12px; background: var(--bg-1); border-bottom: 1px solid var(--border) }
.set-crumb { display: inline-flex; align-items: center; gap: 8px; color: var(--strong); font-weight: 600; font-size: 14px }
.set-crumb .ic { color: var(--muted) }
.set-x { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px 0 6px; border-radius: 8px; color: var(--muted) }
.set-x:hover { background: var(--hover); color: var(--strong) }
kbd { font: 600 11px/1 ui-monospace, Consolas, monospace; padding: 4px 6px; border-radius: 5px; background: var(--bg-3); border: 1px solid var(--border); color: var(--muted) }
.set-side { flex: none; justify-content: stretch; background: var(--bg-2); border-right: 1px solid var(--border); overflow-y: auto }
.set-side-inner { width: 100%; padding: 16px 12px 24px }
.set-me { display: flex; align-items: center; gap: 10px; padding: 10px; margin-bottom: 8px; border-radius: 10px; background: var(--bg-3); border: 1px solid var(--border) }
.set-side .cat { padding: 14px 10px 6px; margin: 0 }
.set-nav { height: 36px; gap: 10px; border-radius: 8px; font-size: 14px }
.set-nav .ic { color: var(--muted) }
.set-nav:hover .ic { color: var(--text) }
.set-nav.active { background: var(--bg-3); color: var(--strong); box-shadow: inset 0 0 0 1px var(--border) }
.set-nav.active .ic { color: var(--accent-2) }
.set-nav.danger, .set-nav.danger .ic { color: var(--red) }
.set-side .set-sep { margin: 10px 4px; background: var(--border-soft) }
.set-main { overflow-y: auto; justify-content: center; background: var(--bg-3) }
.set-content { max-width: 820px; padding: 36px 40px 80px }
.set-content.wide { max-width: 1100px }
.set-content > h2:first-child { font-size: 24px; letter-spacing: -.01em; padding-bottom: 14px; margin-bottom: 22px; border-bottom: 1px solid var(--border-soft) }
.set-content h3 { font-size: 15px }
.set-sep { background: var(--border-soft) }
.feat, .radio, .profile-card, .danger-zone, .stat, .table-wrap { background: var(--card); border: 1px solid var(--border) }
.radio { border-radius: 10px; padding: 14px }
.radio.active { box-shadow: inset 0 0 0 1px var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--card)) }
.theme-card .swatch { border-radius: 10px; border: 1px solid var(--border) }
.theme-card.dark i:nth-child(1) { background: #14161b } .theme-card.dark i:nth-child(2) { background: #181b21 } .theme-card.dark i:nth-child(3) { background: #1c1f26 }
.theme-card.light i:nth-child(1) { background: #e4e7ec } .theme-card.light i:nth-child(2) { background: #f6f7f9 } .theme-card.light i:nth-child(3) { background: #fff }
.save-bar { border-radius: 12px; border: 1px solid var(--border); background: var(--bg-float); box-shadow: var(--shadow) }
.danger-zone { border-color: color-mix(in srgb, var(--red) 40%, var(--border)); border-radius: 12px }
@media (max-width: 760px) { .settings { grid-template-columns: 1fr } .set-side { display: none } .set-content { padding: 24px 16px } }

/* ---------- menus & dialogs ---------- */
.menu { border-radius: 12px; padding: 6px; background: var(--bg-float); border: 1px solid var(--border); box-shadow: 0 16px 40px rgba(0, 0, 0, .45) }
.menu-item { height: 34px; gap: 10px; padding: 0 10px; border-radius: 7px; font-size: 13.5px; color: var(--text) }
.menu-item .ic { color: var(--muted); flex: none }
.menu-item:hover { background: var(--hover); color: var(--strong) }
.menu-item:hover .ic { color: var(--strong) }
.menu-item.accent, .menu-item.accent .ic { color: var(--accent-2) }
.menu-item.accent:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-2) }
.menu-item.danger, .menu-item.danger .ic { color: var(--red) }
.menu-item.danger:hover { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red) }
.mi-pad { width: 16px; flex: none }
.menu-sep { margin: 5px 4px; background: var(--border-soft) }
.menu-label { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint) }
.quick-react { padding: 2px 2px 6px; margin-bottom: 4px; border-bottom: 1px solid var(--border-soft) }
.modal { border-radius: 14px; background: var(--bg-3); border: 1px solid var(--border); box-shadow: 0 24px 60px rgba(0, 0, 0, .5) }
.modal-body { padding: 24px 22px 18px }
.modal-body h2 { text-align: left; font-size: 19px }
.modal-body > .muted { text-align: left }
.modal-foot { padding: 14px 22px; background: var(--bg-2); border-top: 1px solid var(--border) }
.modal .btn, .modal .link { height: 36px }
.toast { border: 1px solid var(--border); background: var(--bg-float) }

/* ---------- logo ---------- */
img.brand-mark { display: block; object-fit: cover; padding: 0; background: none; box-shadow: none }
.top-brand img.brand-mark { width: 30px; height: 30px; border-radius: 9px }
.auth .brand img.brand-mark { width: 40px; height: 40px; border-radius: 11px }

/* ---------- top bar: you live on the right ---------- */
.me-bar { display: flex; align-items: center; gap: 2px; flex: none; padding-left: 10px; margin-left: 8px; border-left: 1px solid var(--border); height: 34px }
.me-bar .me-btn { flex: none; max-width: 200px; height: 38px; padding: 0 10px 0 3px; border-radius: 999px; gap: 8px; margin: 0 6px 0 0 }
.me-bar .me-btn:hover { background: var(--hover) }
.me-bar .me-btn .grow { line-height: 1.15 }
.me-bar .icon-btn.red { color: var(--red) }
#side { padding-bottom: 8px }

/* ---------- sidebar: sentence-case sections, boxed channel glyphs ---------- */
#side .cat { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; color: var(--faint); padding: 16px 10px 6px }
#side .item { height: 34px; gap: 10px; font-size: 14px }
#side .item > .ic:first-child { width: 24px; height: 24px; padding: 4px; border-radius: 7px; background: var(--active); color: var(--muted) }
#side .item.active > .ic:first-child { background: var(--accent); color: #fff }
#side .item.active { background: var(--bg-3); box-shadow: inset 0 0 0 1px var(--border) }
#side .side-head { font-size: 15px }

/* ---------- people page ---------- */
.page.people { padding: 28px 32px 40px }
.people-hero { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border-soft) }
.people-hero h1 { font-size: 28px; letter-spacing: -.02em }
.segs.wide { display: flex; gap: 2px }
.segs.wide .seg { padding: 0 14px; display: inline-flex; align-items: center; gap: 6px }
.segs .badge { margin: 0 }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px }
.pcard-mini { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 20px 14px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); cursor: pointer; transition: border-color .15s, transform .15s }
.pcard-mini:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); transform: translateY(-2px) }
.pcard-mini .avatar { margin-bottom: 8px }
.pcard-mini .status { border-color: var(--card) }
.pm-name { max-width: 100%; color: var(--strong); font-weight: 600 }
.pm-sub { margin: 8px 0 12px }
.pm-acts { display: flex; gap: 6px; align-items: center; margin-top: auto }
.pm-acts .icon-btn.round { width: 30px; height: 30px }
.pm-acts .icon-btn.round:hover { color: var(--red) }
.add-card { max-width: 560px; padding: 28px; border-radius: 16px; background: var(--card); border: 1px solid var(--border) }
.add-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-2); margin-bottom: 14px }
.add-row { display: flex; gap: 8px; margin-top: 18px }
.add-row input { height: 42px; background: var(--bg-2); border: 1px solid var(--border) }
.add-row .btn { height: 42px }
.empty-ic { border-radius: 18px; background: var(--card); border: 1px solid var(--border) }
@media (max-width: 760px) { .me-bar .me-btn .grow { display: none } .page.people { padding: 18px } }

/* ---------- login showcase v2 ---------- */
.auth-show { gap: 0; padding: 36px 56px 28px; background:
  radial-gradient(700px 420px at 20% 30%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%), var(--bg-1) }
.auth-inner { margin: auto 0; display: flex; flex-direction: column; gap: 28px; max-width: 540px; padding: 32px 0 }
.auth-pitch { margin: 0 }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--text);
  background: var(--bg-3); border: 1px solid var(--border); margin-bottom: 18px }
.eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent) }
.auth-pitch h1 { font-size: 44px; line-height: 1.08; letter-spacing: -.025em; margin-bottom: 14px }
.auth-pitch .hl { color: var(--accent-2) }
.auth-pitch > p { max-width: 440px }
.auth-feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 }
.auth-feat { flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; border-radius: 12px; background: color-mix(in srgb, var(--bg-3) 70%, transparent); border: 1px solid var(--border) }
.auth-feat-ic { width: 32px; height: 32px; border-radius: 9px; margin-bottom: 4px; background: color-mix(in srgb, var(--accent) 14%, transparent); border: 0 }
.auth-feat b { font-size: 13.5px }
.auth-feat span { font-size: 12.5px; line-height: 1.35 }
.demo { margin: 0; max-width: none; padding: 0; gap: 0; overflow: hidden; border-radius: 14px }
.demo-head { padding: 12px 14px; gap: 8px; background: var(--bg-2); border-bottom: 1px solid var(--border) }
.demo-hash { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--accent); color: #fff }
.demo-body { display: flex; flex-direction: column; gap: 10px; padding: 14px }
.demo-av { color: #fff; width: 30px; height: 30px }
.demo-who { display: flex; gap: 6px; align-items: baseline; font-size: 12px; font-weight: 600; color: var(--text); margin: 0 0 3px 2px }
.demo-who i { font-style: normal; font-weight: 400; font-size: 11px; color: var(--faint) }
.demo-msg.mine .demo-who { justify-content: flex-end; margin: 0 2px 3px 0 }
.demo-msg.mine > div { display: flex; flex-direction: column; align-items: flex-end }
.demo-react { display: inline-flex; margin-top: 4px; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text) }
.demo-typing { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding-left: 38px }
.dots { display: inline-flex; gap: 3px; padding: 7px 9px; border-radius: 10px; background: var(--card); border: 1px solid var(--border-soft) }
.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%, 60%, 100% { opacity: .3 } 30% { opacity: 1 } }
.demo-compose { display: flex; align-items: center; gap: 10px; margin: 0 14px 14px; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--border); color: var(--faint); font-size: 13px }
.auth-copy { font-size: 12px; color: var(--faint) }
@media (max-width: 1200px) { .auth-pitch h1 { font-size: 36px } .auth-show { padding: 32px 36px 24px } }
.auth-show { overflow-y: auto }

/* ---------- login hero: brand-blue panel with mascot ---------- */
.auth-show.hero { background: #5562f0; color: #fff; border-right: 0; padding: 32px 48px 24px; gap: 0; overflow: hidden }
.auth-show.hero::before { opacity: 1; background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1.5px); background-size: 22px 22px;
  mask-image: radial-gradient(ellipse at 50% 42%, transparent 22%, #000 60%) }
.hero .brand { color: #fff; font-size: 20px; font-weight: 800; letter-spacing: -.01em }
.stage { position: relative; flex: 1; min-height: 300px; display: grid; place-items: center }
.mascot { width: min(300px, 46vh); aspect-ratio: 1; border-radius: 0; filter: drop-shadow(0 30px 40px rgba(20, 25, 110, .35)); animation: bob 6s ease-in-out infinite }
@keyframes bob { 50% { transform: translateY(-8px) } }
.fcard { position: absolute; display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 10px; border-radius: 14px; background: #fff; color: #1b1e2e;
  box-shadow: 0 14px 34px rgba(20, 25, 110, .28); font-size: 13px; white-space: nowrap; animation: bob 7s ease-in-out infinite }
.fcard b { display: block; font-size: 13px; color: #10121c }
.fcard span { color: #5d6275 }
.f1 { top: 12%; left: 2% } .f2 { bottom: 14%; right: 0; animation-delay: -2s } .f3 { top: 18%; right: 4%; animation-delay: -4s }
.f4 { bottom: 22%; left: 10%; padding: 8px 12px; border-radius: 999px; gap: 6px; animation-delay: -1s } .f4 span { color: #10121c; font-weight: 700 }
.fc-av { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff !important; font-weight: 700; font-size: 12px; flex: none; border: 2px solid #fff }
.fc-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: #eceefe; color: #4c56e0 !important }
.fc-ic.green { background: #e3f6ee; color: #2f9e6f !important }
.fc-stack { display: flex; margin-left: 4px } .fc-stack .fc-av { width: 24px; height: 24px; font-size: 10px; margin-left: -8px }
.fc-emoji { font-size: 16px }
.hero-copy h1 { color: #fff; font-size: 40px; line-height: 1.1; letter-spacing: -.025em; margin-bottom: 10px }
.hero-copy p { color: rgba(255, 255, 255, .8); font-size: 15.5px; max-width: 460px; line-height: 1.5 }
.hero .auth-copy { color: rgba(255, 255, 255, .55); margin-top: 22px }
@media (max-width: 1200px) { .hero-copy h1 { font-size: 32px } .f1 { left: 0 } .f2 { right: -6% } }
@media (max-height: 700px) { .fcard.f4 { display: none } .stage { min-height: 220px } }

/* ---------- login hero: black ---------- */
.auth-show.hero { background: radial-gradient(600px 420px at 50% 42%, rgba(85, 98, 240, .22), transparent 70%), #000; border-right: 1px solid rgba(255, 255, 255, .08) }
.auth-show.hero::before { background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1.5px) }
.mascot { filter: drop-shadow(0 24px 50px rgba(85, 98, 240, .35)) }
.fcard { box-shadow: 0 14px 34px rgba(0, 0, 0, .5) }
.hero-copy p { color: rgba(255, 255, 255, .62) }
.hero .auth-copy { color: rgba(255, 255, 255, .35) }
.auth.split, .auth-panel { background: #000 }

/* =====================================================================
   CIPHER BENTO — pure black canvas, floating rounded cards with gaps,
   brand blue from the logo. Final layer: overrides everything above.
   ===================================================================== */
:root, [data-theme="dark"] {
  --bg-0: #000; --bg-1: #000; --bg-2: #0b0b0d; --bg-3: #0b0b0d; --bg-float: #141417;
  --card: #121215; --input: #0f0f12; --composer: #141417;
  --hover: rgba(255, 255, 255, .05); --active: rgba(255, 255, 255, .085);
  --text: #d9dae0; --strong: #fff; --muted: #8a8b94; --faint: #55565e;
  --border: rgba(255, 255, 255, .085); --border-soft: rgba(255, 255, 255, .05);
  --accent: #5562f0; --accent-h: #4652e0; --accent-2: #8d97ff; --app-bg: #000;
}
body { background: var(--app-bg) }
.layout { grid-template-columns: 290px 1fr auto; grid-template-rows: 60px 1fr; gap: 10px; padding: 0 10px 10px; background: var(--bg-0) }
#nav { background: transparent; border-bottom: 0; height: 60px; padding: 0 4px }
.nav-item.active .srv { background: var(--card); border-color: var(--border) }
#side, #main, #members { border: 1px solid var(--border); border-radius: 22px; background: var(--bg-2) }
#members { width: 270px }
.me-bar { border-left: 0 }
.me-bar .me-btn { background: var(--card); border: 1px solid var(--border) }

/* server card */
.srv-card { margin: 10px; border-radius: 16px; overflow: hidden; background: var(--card); border: 1px solid var(--border); flex: none }
.srv-cover { height: 64px; background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--c) 75%, #000), color-mix(in srgb, var(--c) 18%, #000) 70%) }
.srv-card-body { display: flex; align-items: flex-end; gap: 10px; padding: 0 10px 12px; margin-top: -22px }
.srv-tile { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: #fff; color: #000; font-weight: 800; font-size: 16px; border: 3px solid var(--card); flex: none }
.srv-title { color: var(--strong); font-weight: 700; font-size: 15px }
.srv-acts { display: flex; gap: 2px }
.icon-btn.sm2 { width: 28px; height: 28px; border-radius: 8px }
#side .side-scroll { padding: 2px 10px 10px }
#side .side-head { border-bottom: 0; padding: 0 18px; height: 56px; font-size: 16px }

/* channels as tiles */
#side .cat { padding: 14px 6px 6px; color: var(--muted) }
#side .item { height: 40px; border-radius: 12px; padding: 0 8px }
#side .item > .ic:first-child { width: 26px; height: 26px; padding: 5px; border-radius: 8px; background: var(--card); border: 1px solid var(--border); box-sizing: border-box }
#side .item.active { background: #fff; color: #000; box-shadow: none }
#side .item.active > .ic:first-child { background: #000; color: #fff; border-color: #000 }
#side .item.active .ic { color: inherit }
#side .item.dm, #side .item.big { height: 50px }
.voice-panel { margin: 0 10px 10px; border-radius: 14px; background: var(--card); border: 1px solid var(--border) }

/* chat column */
#main { overflow: hidden }
#main .top { height: 60px; margin: 10px 10px 0; padding: 0 10px 0 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--border) }
#main .top .icon-btn.on { color: var(--strong); background: var(--active) }
#msgs { padding: 0 max(12px, calc((100% - 880px) / 2)) 12px }
.composer { padding: 0 max(16px, calc((100% - 880px) / 2 + 8px)) 16px }
.composer-box { border-radius: 18px; background: var(--card); border: 1px solid var(--border); padding: 4px 8px 4px 14px }
.composer .send { color: #fff; background: var(--accent); border-radius: 12px; width: 36px; height: 36px; margin-bottom: 3px }
.composer .send:hover { color: #fff; background: var(--accent-h) }
.msg .text { border-radius: 6px 18px 18px 18px; background: var(--card); border-color: var(--border) }
.msg.mine .text { background: var(--accent); border-radius: 18px 6px 18px 18px }
.msg.cont .text, .msg.mine.cont .text { border-radius: 18px }
.welcome-ic { border-radius: 20px; background: #fff; color: #000 }
.day span { background: var(--card); border-color: var(--border) }
.enc { background: transparent; border: 1px solid color-mix(in srgb, var(--green) 40%, transparent) }

/* members card */
.mem-head { height: 56px; margin: 0 -10px 4px; border-bottom: 1px solid var(--border-soft); background: var(--bg-2) }
.mem-group { margin: 8px 0 0; padding: 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--border-soft) }
.mem-group + .mem-group { border-top: 1px solid var(--border-soft); padding-top: 4px }
.mem-cat { padding: 6px 8px 4px }
.member { border-radius: 10px }

/* people page + misc on black */
.pcard-mini, .add-card, .people-grid .pcard-mini { background: var(--card) }
.segs { background: var(--card) }
.seg.on { background: #fff; color: #000; border-color: #fff }
.tab.active { background: #fff; color: #000 }
.btn.secondary { background: var(--active) }
.menu, .modal { background: var(--bg-float) }
.modal-foot { background: var(--card) }
.settings, .set-main { background: var(--bg-0) }
.set-top { background: var(--bg-0); border-bottom-color: var(--border) }
.set-side { background: var(--bg-2) }
.set-nav.active { background: #fff; color: #000; box-shadow: none }
.set-nav.active .ic { color: #000 }
@media (max-width: 1100px) { .layout { grid-template-columns: 270px 1fr } }
@media (max-width: 760px) { .layout { grid-template-columns: 1fr } }
.srv-card-body > .grow { padding-top: 28px } .srv-card-body .muted.tiny { white-space: nowrap; overflow: hidden; text-overflow: ellipsis }

/* ---------- server icon / banner ---------- */
.srv-ini.has-img, .srv-tile.has-img { padding: 0; overflow: hidden; background: #000 }
.has-img img { width: 100%; height: 100%; object-fit: cover; display: block }
.srv-cover.img, .so-banner.img { background-size: cover; background-position: center }
.so-card { border-radius: 18px; overflow: hidden; background: var(--card); border: 1px solid var(--border); margin-bottom: 14px }
.so-banner { height: 130px; background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--c) 75%, #000), color-mix(in srgb, var(--c) 18%, #000) 70%) }
.so-row { display: flex; align-items: flex-end; gap: 14px; padding: 0 18px 16px; margin-top: -34px }
.so-row .grow { padding-bottom: 4px }
.srv-tile.big { width: 76px; height: 76px; border-radius: 20px; font-size: 24px; border-width: 4px }
.so-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 26px }
.so-box { padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--border) }
.so-box h3 { margin-bottom: 2px } .so-box p { margin-bottom: 12px }
.so-name { padding: 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--border); max-width: none }

/* ---------- settings: bento ---------- */
.settings { grid-template-columns: 290px 1fr; gap: 10px; padding: 0 10px 10px; grid-template-rows: 60px 1fr }
.set-top { height: 60px; border-bottom: 0; padding: 0 4px; background: transparent }
.set-side { border: 1px solid var(--border); border-radius: 22px; background: var(--bg-2) }
.set-side-inner { padding: 12px 10px 20px }
.set-me { background: var(--card); border-radius: 16px; padding: 12px }
.set-nav { height: 40px; border-radius: 12px }
.set-main { border: 1px solid var(--border); border-radius: 22px; background: var(--bg-2) }
.set-content { padding: 30px 36px 60px }
.set-content > h2:first-child { border-bottom: 0; padding-bottom: 0; font-size: 26px }
.set-x { background: var(--card); border: 1px solid var(--border); height: 36px; border-radius: 12px }
.feat, .radio, .stat, .table-wrap, .profile-card, .danger-zone, .adm-msg, .adm-fact, .adm-hero, .p-box { background: var(--card); border: 1px solid var(--border); border-radius: 16px }
.feat-ic, .stat-ic { background: #fff; color: #000; border-radius: 12px }
.radio.active { background: var(--card); box-shadow: inset 0 0 0 1px #fff }
.radio.active .radio-dot { border-color: #fff } .radio.active .radio-dot::after { background: #fff }
.toggle-row input:checked + .switch { background: #fff } .toggle-row input:checked + .switch::after { background: #000 }
.theme-card.dark i:nth-child(1) { background: #000 } .theme-card.dark i:nth-child(2) { background: #0b0b0d } .theme-card.dark i:nth-child(3) { background: #121215 }
.theme-card.active .swatch { border-color: #fff; box-shadow: 0 0 0 2px #fff }
.tag { background: var(--active); color: var(--text) }
input, textarea { background: var(--input); border: 1px solid var(--border) }
.table-wrap th { background: transparent }

/* ---------- people page: bento ---------- */
#main > .page.people { padding: 10px }
.people-hero { margin: 0 0 10px; padding: 22px 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--card) }
.people-grid { gap: 10px }
.pcard-mini { border-radius: 18px; padding: 22px 14px 16px; background: var(--card) }
.pcard-mini:hover { border-color: rgba(255, 255, 255, .25); transform: translateY(-2px) }
.pcard-mini .btn { background: #fff; color: #000 } .pcard-mini .btn:hover:not(:disabled) { background: #e6e6ea }
.pcard-mini .btn.secondary { background: var(--active); color: var(--strong) }
.add-card { max-width: none; border-radius: 18px }
.add-ic { background: #fff; color: #000 }
.empty { border: 1px dashed var(--border); border-radius: 18px; margin-top: 0 }
@media (max-width: 760px) { .settings { grid-template-columns: 1fr } .so-grid { grid-template-columns: 1fr } }
.set-content .copy-box { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 8px 8px 8px 16px; max-width: none } .set-content .copy-box .btn { background: #fff; color: #000 }

/* ---------- profile v3: centred, black bento ---------- */
.modal.profile-modal { width: min(600px, 100%); background: transparent; border: 0; box-shadow: none }
.pcard.v2 { background: #0b0b0d; border: 1px solid var(--border); border-radius: 28px; overflow: hidden; box-shadow: 0 40px 90px rgba(0, 0, 0, .7) }
.v2 .p-hero { position: relative; padding: 10px 10px 0 }
.v2 .p-banner { height: 190px; border-radius: 20px; background-size: cover; background-position: center }
.v2 .p-banner::after { display: none }
.v2.mini .p-banner { height: 110px; border-radius: 16px }
.p-close { position: absolute; top: 20px; right: 20px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; backdrop-filter: blur(6px) }
.p-close:hover { background: rgba(0, 0, 0, .8) }
.v2 .p-ring { position: absolute; left: 50%; bottom: -62px; transform: translateX(-50%); padding: 6px; border-radius: 50%; background: #0b0b0d; box-shadow: none }
.v2.mini .p-ring { bottom: -44px; padding: 5px }
.v2 .p-ring .avatar { box-shadow: none; background-color: #0b0b0d }
.v2 .p-ring .status { border: 5px solid #0b0b0d; width: 30px; height: 30px; right: 2px; bottom: 4px }
.p-idblock { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 72px 24px 6px }
.v2.mini .p-idblock { padding-top: 52px }
.v2 .p-name { font-size: 30px; font-weight: 800; letter-spacing: -.02em; color: #fff; line-height: 1.1 }
.v2.mini .p-name { font-size: 21px }
.v2 .p-user { color: var(--muted); font-size: 14px; margin-top: 4px; justify-content: center }
.p-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 12px }
.p-pills:empty { display: none }
.pill-tag { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 11px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #16161a; border: 1px solid var(--border); color: var(--text) }
.pill-tag i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint) }
.pill-tag.on { color: var(--green) } .pill-tag.on i { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent) }
.v2 .p-actions { display: flex; gap: 8px; justify-content: center; margin: 18px 0 0 }
.v2 .btn.primary { background: #fff; color: #000; height: 40px; padding: 0 18px; border-radius: 12px }
.v2 .btn.primary:hover:not(:disabled) { background: #e7e7ea }
.v2 .btn.secondary { height: 40px; border-radius: 12px; padding: 0 16px }
.v2 .icon-btn.round { width: 40px; height: 40px; border-radius: 12px; background: var(--active) }
.v2 .p-body { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 20px 14px 14px }
.v2.mini .p-body { padding: 14px 10px 10px; grid-template-columns: 1fr }
.v2 .p-body > * { grid-column: 1 / -1 }
.p-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px }
.p-tile { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 18px; background: #121215; border: 1px solid var(--border) }
.p-tile-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: #fff; color: #000; margin-bottom: 8px }
.p-tile b { color: #fff; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.p-tile span:last-child { color: var(--muted); font-size: 12px }
.v2 .p-box { padding: 16px 18px; border-radius: 18px; background: #121215; border: 1px solid var(--border) }
.v2 .p-label { font-size: 11px; letter-spacing: .1em; color: var(--muted); margin-bottom: 8px }
.v2 .p-label .ic { color: var(--muted) }
.v2 .p-bio { font-size: 14.5px; line-height: 1.55; color: var(--text) }
.v2 .p-fact b .ic { color: var(--yellow) }
.v2 .chip { background: #1a1a1f; border-color: var(--border); height: 28px; padding: 0 10px }
.v2 .p-srv { background: #1a1a1f; border-color: var(--border); padding: 4px 12px 4px 4px }
.v2 .p-srv .mini-srv { border-radius: 9px }
.mini-srv.has-img { padding: 0; overflow: hidden }
.preview .pcard.v2 { border-radius: 22px; box-shadow: none }
@media (max-width: 560px) { .p-tiles { grid-template-columns: 1fr 1fr } .v2 .p-name { font-size: 24px } }

/* ---------- admin: bento ---------- */
.stats { grid-template-columns: repeat(4, 1fr); gap: 10px }
.stat { border-radius: 18px; padding: 16px; background: var(--card); border: 1px solid var(--border) }
.stat b { color: #fff }
.admin-bar { padding: 8px; border-radius: 16px; background: var(--card); border: 1px solid var(--border) }
.admin-bar .tab { height: 34px; border-radius: 10px }
.admin-bar .tab.active .count { background: rgba(0, 0, 0, .12); color: #000 }
.admin-bar .search { height: 36px; border-radius: 10px; background: var(--bg-2) }
.table-wrap { margin-top: 10px; border-radius: 18px }
.table-wrap th { color: var(--faint); font-size: 11px; letter-spacing: .08em }
tbody tr:hover { background: rgba(255, 255, 255, .03) }
.adm-hero { padding: 20px; border-radius: 20px }
.adm-hero .mini-srv.big { background: #fff; color: #000 }
.adm-facts { gap: 10px }
.adm-fact { border-radius: 16px; padding: 14px 16px }
.adm-msg { border-radius: 16px; padding: 14px }
.adm-where, .adm-where.dm { background: #1a1a1f; border: 1px solid var(--border); color: var(--text) }
.back { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 10px; background: var(--card); border: 1px solid var(--border); text-decoration: none !important; color: var(--text); margin-bottom: 10px }
.back:hover { color: #fff }
.acts .btn.sm { border-radius: 9px }

/* ---------- new settings sections ---------- */
.set-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; margin: 14px 0 18px; border-radius: 18px; background: var(--card); border: 1px solid var(--border) }
.set-card .toggle-row + .toggle-row { padding-top: 14px; border-top: 1px solid var(--border-soft) }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center }
.swatch-dot { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--border); transition: transform .12s }
.swatch-dot:hover { transform: scale(1.08) }
.swatch-dot.on { box-shadow: 0 0 0 3px var(--bg-2), 0 0 0 5px #fff }
.select { height: 42px; padding: 0 12px; border-radius: 12px; background: var(--input); color: var(--text); border: 1px solid var(--border); font: inherit; width: 100% }
.mic-meter { flex: 1; height: 10px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--border); overflow: hidden }
.mic-meter i { display: block; height: 100%; width: 0; background: var(--green); transition: width .05s }
.kb-row { display: flex; align-items: center; gap: 12px; padding: 4px 0 }
.kb-row + .kb-row { padding-top: 12px; border-top: 1px solid var(--border-soft) }
.kb-keys { display: flex; gap: 4px }
.kb-keys kbd { min-width: 26px; text-align: center; padding: 5px 8px; background: #1a1a1f; color: var(--text) }
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation: none !important; transition: none !important }

/* ---------- profile: ID card ---------- */
.modal.profile-modal { width: min(820px, 100%); background: transparent; border: 0; box-shadow: none; overflow: visible }
.idcard { display: grid; grid-template-columns: 300px 1fr; gap: 10px; padding: 10px; border-radius: 30px; background: #0b0b0d; border: 1px solid var(--border); box-shadow: 0 40px 90px rgba(0, 0, 0, .75); max-height: calc(100vh - 40px) }
.idcard.mini { grid-template-columns: 1fr; padding: 8px; border-radius: 24px; box-shadow: none }
.id-side { position: relative; display: flex; flex-direction: column; min-height: 460px; border-radius: 22px; overflow: hidden; background-size: cover; background-position: center; padding: 18px }
.idcard.mini .id-side { min-height: 360px }
.id-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .35) 0%, transparent 30%, transparent 45%, rgba(0, 0, 0, .9) 100%) }
.id-side > :not(.id-shade) { position: relative }
.id-top { display: flex; align-items: center; gap: 8px; color: rgba(255, 255, 255, .85); font-size: 11px; font-weight: 800; letter-spacing: .18em }
.id-logo { width: 22px; height: 22px; border-radius: 7px }
.id-badge { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px; background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); letter-spacing: .02em; font-size: 11px; font-weight: 700; color: #fff }
.id-av { margin: auto 0 0; display: flex }
.id-av .avatar { box-shadow: 0 0 0 5px rgba(255, 255, 255, .95), 0 18px 40px rgba(0, 0, 0, .5); background-color: #000 }
.id-av .status { border: 5px solid #fff; width: 30px; height: 30px; right: 0; bottom: 4px }
.id-name { margin-top: 18px; color: #fff }
.id-display { font-size: 32px; font-weight: 800; letter-spacing: -.025em; line-height: 1.05; overflow-wrap: anywhere }
.idcard.mini .id-display { font-size: 24px }
.id-user { margin-top: 4px; color: rgba(255, 255, 255, .7); font-size: 14px; font-family: ui-monospace, Consolas, monospace }
.id-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; overflow-y: auto; padding: 6px 4px 4px }
.id-head { display: flex; align-items: center; gap: 8px; padding: 2px 2px 0 6px }
.id-status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--muted) }
.id-status i { width: 9px; height: 9px; border-radius: 50%; background: var(--faint) }
.id-status.on { color: var(--green) } .id-status.on i { background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 22%, transparent) }
.icon-btn.sq { width: 38px; height: 38px; border-radius: 12px; background: #16161a; border: 1px solid var(--border); color: var(--text) }
.icon-btn.sq:hover { background: #1f1f24; color: #fff }
.id-actions { display: flex; gap: 8px; flex-wrap: wrap }
.id-actions .btn { height: 42px; border-radius: 13px; padding: 0 18px }
.id-actions .btn.primary { background: #fff; color: #000; flex: 1 }
.id-actions .btn.primary:hover:not(:disabled) { background: #e7e7ea }
.id-actions .btn.secondary { background: #16161a; border: 1px solid var(--border) }
.id-actions .icon-btn.sq { width: 42px; height: 42px }
.id-sec { padding: 16px 18px; border-radius: 20px; background: #121215; border: 1px solid var(--border) }
.id-label { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px }
.id-line { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 14px }
.id-line + .id-line { border-top: 1px solid var(--border-soft) }
.id-line-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: #1c1c21; color: var(--text) }
.id-line b { color: #fff; font-weight: 600 }
.id-servers { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px }
.id-srv { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; background: #1a1a1f; border: 1px solid var(--border); font-weight: 600; color: var(--text); text-align: left }
.id-srv:hover { border-color: rgba(255, 255, 255, .3); color: #fff }
.id-srv .mini-srv { width: 32px; height: 32px; border-radius: 10px; flex: none }
.id-sec.p-box { margin: 0 }
.id-sec .chip { background: #1a1a1f; height: 28px }
.preview { width: 300px }
@media (max-width: 760px) { .idcard { grid-template-columns: 1fr } .id-side { min-height: 320px } }

/* =====================================================================
   CIPHER DOCK — navigation lives in a floating dock at the bottom,
   conversations list on the left, chat in the middle, settings use
   top pill tabs. Final layer.
   ===================================================================== */
.layout { grid-template-columns: 300px 1fr auto; grid-template-rows: 1fr 84px; gap: 10px; padding: 10px 10px 0 }
#side { grid-column: 1; grid-row: 1 } #main { grid-column: 2; grid-row: 1 } #members { grid-column: 3; grid-row: 1 }
#nav { grid-column: 1 / -1; grid-row: 2; justify-self: center; align-self: center; height: 64px; width: auto; max-width: calc(100vw - 20px);
  padding: 0 10px; gap: 6px; border-radius: 22px; background: rgba(18, 18, 22, .92); border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .06); backdrop-filter: blur(16px); overflow: visible }
.top-brand { border-right: 0; padding: 0 4px 0 2px; margin: 0; font-size: 0; gap: 0 }
.top-brand img.brand-mark { width: 44px; height: 44px; border-radius: 14px }
.nav-item { position: relative }
.srv, .nav-item:hover .srv, .nav-item.active .srv { width: 46px; height: 46px; padding: 0; justify-content: center; border-radius: 15px; background: #1c1c21; border: 1px solid rgba(255, 255, 255, .06); color: var(--text); transition: transform .18s cubic-bezier(.3, 1.6, .5, 1), background .15s }
.nav-item:hover .srv { transform: translateY(-6px) scale(1.08); background: #26262c }
.nav-item.active .srv { background: #fff; color: #000; border-color: #fff }
.nav-item.active::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: #fff }
.srv-name { display: none }
.srv-ini { width: 46px; height: 46px; border-radius: 15px; background: transparent; font-size: 14px }
.srv-ini.has-img { width: 46px; height: 46px; border-radius: 15px }
.nav-item.active .srv-ini { background: transparent; color: #000 }
.nav-item.active .srv:has(.has-img) { padding: 0; overflow: hidden; border-width: 2px }
.srv.green, .nav-item:hover .srv.green { width: 46px; color: var(--muted); background: transparent; border: 1px dashed rgba(255, 255, 255, .16) }
.nav-item:hover .srv.green { color: #fff; background: #1c1c21 }
.nav-item[data-tip]:hover::before { content: attr(data-tip); position: absolute; bottom: calc(100% + 14px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  padding: 6px 10px; border-radius: 9px; background: #fff; color: #000; font-size: 12px; font-weight: 700; pointer-events: none; z-index: 5 }
.nav-badge { position: absolute; top: -4px; right: -4px; border: 2px solid #121216 }
.dock-sep { width: 1px; height: 34px; background: rgba(255, 255, 255, .12); margin: 0 6px; flex: none }
.me-bar { padding: 0; margin: 0; height: auto; gap: 4px }
.me-bar .me-btn { height: 46px; border-radius: 15px; padding: 0 12px 0 6px; background: #1c1c21; border: 1px solid rgba(255, 255, 255, .06) }
.me-bar .icon-btn { width: 40px; height: 40px; border-radius: 13px }
.me-bar .icon-btn:hover { background: #26262c }

/* conversations list */
#side .side-scroll { padding: 4px 10px 12px }
#side .item { height: 54px; border-radius: 16px; gap: 12px; padding: 0 10px; margin: 2px 0 }
#side .item > .ic:first-child { width: 38px; height: 38px; padding: 10px; border-radius: 13px; background: #16161a; border: 1px solid var(--border) }
#side .item.active { background: #16161a; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14) }
#side .item.active > .ic:first-child { background: #fff; color: #000; border-color: #fff }
.ch-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2 }
.ch-name { font-weight: 600; color: var(--strong); font-size: 14.5px }
.ch-sub { font-size: 12px; color: var(--faint); margin-top: 2px }
#side .item.connected .ch-sub { color: var(--green) }
#side .cat { padding: 14px 8px 4px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700 }
#side .item.dm .avatar, #side .item.big > .ic:first-child { flex: none }
.voice-user { margin-left: 56px; border-radius: 10px }

/* chat */
#main .top { height: 64px; border-radius: 18px }
#main .top strong { font-size: 17px; font-weight: 800; letter-spacing: -.01em }
.composer { padding-bottom: 14px }

/* settings: pill tabs on top instead of a side menu */
.settings { grid-template-columns: 1fr; grid-template-rows: 60px auto 1fr; padding: 0 10px 10px; gap: 10px }
.set-side { grid-column: 1; border-radius: 20px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none }
.set-side::-webkit-scrollbar { display: none }
.set-side-inner { display: flex; align-items: center; gap: 6px; padding: 8px; width: max-content; min-width: 100% }
.set-side .cat, .set-side .set-sep { display: none }
.set-me { margin: 0 6px 0 0; padding: 6px 12px 6px 6px; border-radius: 14px; flex: none }
.set-me .avatar { --s: 30px !important; width: 30px; height: 30px }
.set-nav { width: auto; height: 40px; padding: 0 14px; margin: 0; border-radius: 12px; white-space: nowrap; flex: none }
.set-nav.danger { margin-left: auto }
.set-main { grid-column: 1; border-radius: 22px }
.set-content, .set-content.wide { margin: 0 auto }

/* tabs everywhere: white pill on black */
.segs, .admin-bar .tabs { background: #121215; border: 1px solid var(--border); border-radius: 14px; padding: 4px }
.seg, .tab { border-radius: 10px }

/* profile: holo card */
.id-side { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .25s ease-out; will-change: transform }
.id-holo { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light; opacity: .55;
  background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 20%), rgba(255, 255, 255, .55), transparent 40%),
    linear-gradient(115deg, transparent 30%, rgba(120, 200, 255, .35) 45%, rgba(255, 140, 230, .3) 55%, transparent 70%) }
.id-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .18) }
.id-no { font: 600 12px/1 ui-monospace, Consolas, monospace; letter-spacing: .12em; color: rgba(255, 255, 255, .75) }
.id-barcode { width: 92px; height: 26px; opacity: .85;
  background: repeating-linear-gradient(90deg, #fff 0 2px, transparent 2px 4px, #fff 4px 5px, transparent 5px 8px, #fff 8px 11px, transparent 11px 12px) }
.idcard { border-radius: 32px; background: linear-gradient(180deg, #0f0f12, #09090b) }
.id-sec { background: #111114 }
@media (max-width: 760px) { .layout { grid-template-columns: 1fr } #side { display: none } .me-bar .me-btn .grow { display: none } }

/* =====================================================================
   DOCK EVERYWHERE — every surface uses the dock look: dark glass,
   hairline border, deep shadow, rounded tiles that lift on hover,
   white = active. Final layer.
   ===================================================================== */
:root { --glass: rgba(18, 18, 22, .92); --glass-b: rgba(255, 255, 255, .1); --tile: #1c1c21; --tile-h: #26262c; --tile-b: rgba(255, 255, 255, .06);
  --dock-shadow: 0 20px 50px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .06); --spring: cubic-bezier(.3, 1.6, .5, 1) }
/* tooltips were painted over by the chat panel */
#nav { position: relative; z-index: 30 }

/* panels */
#side, #main, #members { background: var(--glass); border-color: var(--glass-b); box-shadow: var(--dock-shadow) }
#main .top { background: transparent; border-bottom: 1px solid var(--tile-b); border-radius: 22px 22px 0 0 }
#side .item:hover:not(.active) { background: var(--tile) }
#side .item:hover > .ic:first-child { transform: translateY(-2px); background: var(--tile-h) }
#side .item > .ic:first-child { transition: transform .18s var(--spring), background .15s; background: var(--tile); border-color: var(--tile-b) }
.srv-card { border-radius: 20px; border: 1px solid var(--glass-b); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06) }
.srv-card .icon-btn, #main .top .icon-btn { border-radius: 13px; background: var(--tile); border: 1px solid var(--tile-b); transition: transform .18s var(--spring), background .15s }
.srv-card .icon-btn:hover, #main .top .icon-btn:hover { transform: translateY(-3px); background: var(--tile-h) }
#main .top .icon-btn.on { background: #fff; color: #000; border-color: #fff }
.composer-box, .composer form { border-radius: 18px; background: var(--tile); border: 1px solid var(--glass-b) }
.mem-group > .item, #members .item { border-radius: 14px }
#members .item:hover { background: var(--tile) }

/* menus, modals, toasts */
.menu, .modal { background: var(--glass); border: 1px solid var(--glass-b); box-shadow: var(--dock-shadow); backdrop-filter: blur(16px) }
.menu { border-radius: 18px; padding: 6px }
.menu-item { border-radius: 12px }
.menu-item:hover, .menu-item:focus-visible { background: var(--tile-h) }
.modal { border-radius: 24px }
.modal-foot { background: transparent; border-top: 1px solid var(--tile-b) }
.btn { border-radius: 13px }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]), textarea, select { border-radius: 13px; background: var(--tile); border: 1px solid var(--tile-b) }

/* settings: content on top, tabs in a dock at the bottom (same as the app) */
.settings { grid-template-rows: 60px 1fr 84px; padding: 0 10px; gap: 10px }
.settings > .set-top { grid-row: 1 } .settings > .set-main { grid-row: 2; background: var(--glass); border: 1px solid var(--glass-b); box-shadow: var(--dock-shadow) }
.settings > .set-side { grid-row: 3; justify-self: center; align-self: center; max-width: calc(100vw - 20px); height: 64px; overflow: visible;
  background: var(--glass); border: 1px solid var(--glass-b); border-radius: 22px; box-shadow: var(--dock-shadow); backdrop-filter: blur(16px) }
.set-side-inner { height: 100%; padding: 0 9px; min-width: 0; gap: 6px }
.set-nav { position: relative; height: 46px; min-width: 46px; padding: 0 13px; justify-content: center; gap: 8px; border-radius: 15px; font-size: 0;
  background: var(--tile); border: 1px solid var(--tile-b); color: var(--text); transition: transform .18s var(--spring), background .15s }
.set-nav:hover { transform: translateY(-6px) scale(1.06); background: var(--tile-h); color: #fff }
.set-nav.active, .set-nav.active:hover { background: #fff; color: #000; border-color: #fff; font-size: 14px; font-weight: 700; padding: 0 16px }
.set-nav.active::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: #fff }
.set-nav.danger { margin-left: 0; color: var(--red) }
.set-nav[data-tip]:not(.active):hover::before, .id-srv[data-tip]:hover::before { content: attr(data-tip); position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  padding: 6px 10px; border-radius: 9px; background: #fff; color: #000; font-size: 12px; font-weight: 700; pointer-events: none; z-index: 5 }
.set-side .set-sep { display: block; width: 1px; height: 34px; margin: 0 4px; background: rgba(255, 255, 255, .12); flex: none }
.set-me { height: 46px; margin: 0; padding: 0 12px 0 6px; border-radius: 15px; background: var(--tile); border: 1px solid var(--tile-b) }
.set-me .grow { max-width: 120px }
.set-card, .so-card, .so-box { border-radius: 20px; background: var(--tile); border: 1px solid var(--tile-b) }

/* admin */
.stats { gap: 10px }
.stat { background: var(--tile); border: 1px solid var(--tile-b); border-radius: 20px; transition: transform .18s var(--spring), background .15s }
.stat:hover { transform: translateY(-4px); background: var(--tile-h) }
.stat-ic { border-radius: 13px }
.admin-bar, .segs { background: var(--glass); border: 1px solid var(--glass-b); border-radius: 18px; box-shadow: var(--dock-shadow) }
.admin-bar .tab, .seg { border-radius: 12px; transition: transform .18s var(--spring), background .15s }
.admin-bar .tab:hover:not(.active), .seg:hover:not(.active) { transform: translateY(-2px); background: var(--tile-h) }
.adm-msg, .adm-fact, .adm-hero, .p-box, .table-wrap, .feat, .radio, .danger-zone, .profile-card { background: var(--tile); border: 1px solid var(--tile-b); border-radius: 18px }
.pcard-mini { background: var(--glass); border: 1px solid var(--glass-b); border-radius: 22px; box-shadow: var(--dock-shadow); transition: transform .18s var(--spring) }
.pcard-mini:hover { transform: translateY(-4px) }

/* profile: dock-style actions and a mini dock of servers */
.idcard { border: 1px solid var(--glass-b); box-shadow: 0 30px 80px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .06) }
.id-sec { background: var(--tile); border: 1px solid var(--tile-b); border-radius: 18px }
.id-actions .btn, .id-actions .icon-btn { transition: transform .18s var(--spring), background .15s }
.id-actions .btn:hover, .id-actions .icon-btn:hover { transform: translateY(-3px) }
.id-actions .btn.secondary, .id-actions .icon-btn.sq { background: var(--tile); border: 1px solid var(--tile-b) }
.id-servers { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; width: max-content; max-width: 100%; border-radius: 20px; background: var(--glass); border: 1px solid var(--glass-b) }
.id-srv { position: relative; padding: 0; gap: 0; width: 46px; height: 46px; justify-content: center; border-radius: 15px; background: var(--tile); border: 1px solid var(--tile-b); transition: transform .18s var(--spring) }
.id-srv > .ellipsis { display: none }
.id-srv:hover { transform: translateY(-5px) scale(1.06) }
.id-srv .mini-srv { width: 44px; height: 44px; border-radius: 14px }
@media (max-width: 760px) { .set-me .grow { display: none } }

/* =====================================================================
   PROFILE SPOTLIGHT — centered hero with a glowing avatar ring
   ===================================================================== */
.modal.profile-modal { width: min(460px, 100%); background: transparent; border: 0; box-shadow: none; overflow: visible; backdrop-filter: none }
.pf { position: relative; overflow: hidden; border-radius: 30px; background: #0c0c0f; border: 1px solid var(--glass-b);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(255, 255, 255, .07); max-height: calc(100vh - 40px); overflow-y: auto; scrollbar-width: none }
.pf-cover { height: 170px; background-size: cover; background-position: center; -webkit-mask-image: linear-gradient(#000 45%, transparent); mask-image: linear-gradient(#000 45%, transparent) }
.pf-x { position: absolute; top: 14px; right: 14px; z-index: 2; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px;
  background: rgba(0, 0, 0, .45); color: #fff; border: 1px solid rgba(255, 255, 255, .15); backdrop-filter: blur(10px) }
.pf-x:hover { background: rgba(0, 0, 0, .7) }
.pf-hero { display: flex; flex-direction: column; align-items: center; text-align: center; margin-top: -92px; padding: 0 24px; position: relative }
.pf-ring { position: relative; padding: 5px; border-radius: 50%;
  background: conic-gradient(from 210deg, var(--pc), #fff, var(--pc), color-mix(in srgb, var(--pc) 30%, #000), var(--pc));
  box-shadow: 0 0 0 5px #0c0c0f, 0 14px 50px color-mix(in srgb, var(--pc) 55%, transparent) }
.pf-ring .avatar { border: 4px solid #0c0c0f; box-sizing: content-box }
.pf-ring .status { border-color: #0c0c0f }
.pf-name { margin-top: 16px; font-size: 28px; font-weight: 800; letter-spacing: -.02em; color: #fff; line-height: 1.1; word-break: break-word }
.pf-tags { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin-top: 8px }
.pf-user { color: var(--muted); font-weight: 600; margin-right: 2px }
.pf-tag { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 700;
  background: var(--tile); border: 1px solid var(--tile-b); color: var(--text) }
.pf-tag i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint) }
.pf-tag.on { color: var(--green) } .pf-tag.on i { background: var(--green); box-shadow: 0 0 8px var(--green) }
.pf-body { display: flex; flex-direction: column; gap: 12px; padding: 22px 20px 22px }
.pf-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px }
.pf-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; border-radius: 18px; background: var(--tile); border: 1px solid var(--tile-b); text-align: center }
.pf-stat b { font-size: 17px; font-weight: 800; color: #fff; white-space: nowrap }
.pf-stat span { font-size: 11.5px; color: var(--faint); font-weight: 600 }
.pf-dock { display: flex; gap: 6px; padding: 8px; border-radius: 22px; background: var(--glass); border: 1px solid var(--glass-b); box-shadow: var(--dock-shadow) }
.pf-dock .btn { flex: 1; height: 46px; border-radius: 15px; font-weight: 700; transition: transform .18s var(--spring) }
.pf-dock .btn.primary { background: #fff; color: #000 } .pf-dock .btn.primary:hover:not(:disabled) { background: #e9e9ec; transform: translateY(-3px) }
.pf-dock .btn.secondary { background: var(--tile); border: 1px solid var(--tile-b) }
.pf-tile { position: relative; flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; background: var(--tile); border: 1px solid var(--tile-b); color: var(--text);
  transition: transform .18s var(--spring), background .15s }
.pf-tile:hover { transform: translateY(-5px) scale(1.06); background: var(--tile-h); color: #fff }
.pf-tile:hover::before { content: attr(data-tip); position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  padding: 6px 10px; border-radius: 9px; background: #fff; color: #000; font-size: 12px; font-weight: 700; pointer-events: none }
.pf-bio, .pf-srvs, .pf .id-sec { padding: 14px 16px; border-radius: 18px; background: var(--tile); border: 1px solid var(--tile-b) }
.pf-bio p { margin: 6px 0 0; white-space: pre-wrap; word-break: break-word; line-height: 1.5; color: var(--text) }
.pf .id-label { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--faint) }
.pf-srvs .id-servers { margin-top: 10px; background: transparent; border: 0; padding: 0 }
.pf-srvs { overflow: visible }
.pf.mini { border-radius: 24px; box-shadow: none; padding-bottom: 20px }
.pf.mini .pf-cover { height: 120px }
.pf.mini .pf-hero { margin-top: -70px }
.pf.mini .pf-name { font-size: 22px }

/* =====================================================================
   CALL STAGE — sits above the chat while a call is on
   ===================================================================== */
#stage { flex: none; margin: 10px 12px 0; padding: 14px; border-radius: 22px; position: relative;
  background: radial-gradient(120% 120% at 50% 0%, rgba(85, 98, 240, .16), transparent 60%), #0a0a0d; border: 1px solid var(--glass-b) }
#stage[hidden] { display: none }
.st-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; min-width: 0 }
.st-head b { color: #fff; font-size: 15px }
.st-live { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 700; color: var(--green); background: rgba(35, 165, 90, .12); flex: none }
.st-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: st-pulse 1.6s infinite }
.st-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px }
.st-tile { position: relative; width: 220px; aspect-ratio: 16 / 10; display: grid; place-items: center; border-radius: 18px; overflow: hidden;
  background: var(--tile); border: 1px solid var(--tile-b); transition: box-shadow .15s }
.st-tile.has-video { width: min(420px, 100%); background: #000 }
.st-tile.speaking { box-shadow: 0 0 0 2px var(--green), 0 0 24px rgba(35, 165, 90, .35) }
.st-tile video { width: 100%; height: 100%; object-fit: contain; background: #000 }
.st-tile video.mirror { transform: scaleX(-1) }
.st-av { border-radius: 50%; transition: box-shadow .15s }
.st-tile.speaking .st-av { box-shadow: 0 0 0 3px var(--green) }
.st-tile.ringing .st-av { animation: st-ring 1.4s infinite }
.st-tile.ringing { opacity: .8 }
.st-name { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px; max-width: calc(100% - 16px); height: 26px; padding: 0 9px;
  border-radius: 9px; background: rgba(0, 0, 0, .6); backdrop-filter: blur(8px); color: #fff; font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden }
.st-ring { color: var(--muted); font-weight: 600 }
.st-dock { display: flex; justify-content: center; gap: 8px; width: max-content; margin: 14px auto 0; padding: 8px; border-radius: 20px;
  background: var(--glass); border: 1px solid var(--glass-b); box-shadow: var(--dock-shadow) }
.st-btn { position: relative; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; background: var(--tile); border: 1px solid var(--tile-b); color: var(--text);
  transition: transform .18s var(--spring), background .15s }
.st-btn:hover { transform: translateY(-4px); background: var(--tile-h); color: #fff }
.st-btn.on { background: #fff; color: #000; border-color: #fff }
.st-btn.off { color: var(--red) }
.st-btn.red { width: 62px; background: var(--red); color: #fff; border-color: transparent }
.st-btn.red:hover { background: #d23c3c }
.st-btn:hover::before { content: attr(data-tip); position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  padding: 6px 10px; border-radius: 9px; background: #fff; color: #000; font-size: 12px; font-weight: 700; pointer-events: none; z-index: 3 }
@keyframes st-pulse { 50% { opacity: .35 } }
@keyframes st-ring { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .45) } 100% { box-shadow: 0 0 0 18px rgba(255, 255, 255, 0) } }
.reduce-motion .st-live i, .reduce-motion .st-tile.ringing .st-av { animation: none }
#stage { max-height: 62%; overflow-y: auto; scrollbar-width: none }

/* avatar ring options */
.pf-ring.rainbow { background: conic-gradient(#ff5f6d, #ffc371, #f9f871, #4ade80, #22d3ee, #6366f1, #d946ef, #ff5f6d); box-shadow: 0 0 0 5px #0c0c0f, 0 14px 50px rgba(160, 110, 255, .45) }
.pf-ring.none { background: transparent; box-shadow: none; padding: 0 }
.ring-dot.rainbow { background: conic-gradient(#ff5f6d, #ffc371, #f9f871, #4ade80, #22d3ee, #6366f1, #d946ef, #ff5f6d) }
.ring-dot.none { background: repeating-linear-gradient(45deg, transparent 0 5px, rgba(255, 255, 255, .25) 5px 6px) }
.ring-dot.auto { position: relative }
.ring-dot.auto::after { content: "A"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; text-shadow: 0 1px 3px #000 }

/* settings tab bar: calmer — plain icons, soft hover, one white pill for the open tab */
.settings > .set-side { height: 62px; padding: 0; border-radius: 20px; background: rgba(16, 16, 20, .94) }
.set-side-inner { gap: 2px; padding: 0 8px }
.set-nav { height: 44px; min-width: 44px; padding: 0 12px; border-radius: 13px; background: transparent; border-color: transparent; color: var(--muted) }
.set-nav:hover { transform: none; background: rgba(255, 255, 255, .07); color: #fff }
.set-nav.active, .set-nav.active:hover { padding: 0 16px; box-shadow: 0 6px 18px rgba(255, 255, 255, .12) }
.set-nav.active::after { display: none }
.set-nav.danger { color: #f87171 } .set-nav.danger:hover { background: rgba(239, 68, 68, .14) }
.set-me { height: 44px; padding: 0 4px; margin-right: 4px; background: transparent; border: 0 }
.set-me .grow { display: none }
.set-me .avatar { --s: 34px !important; width: 34px; height: 34px }
.set-side .set-sep { height: 26px; margin: 0 6px; background: rgba(255, 255, 255, .1) }
.set-nav[data-tip]:not(.active):hover::before { bottom: calc(100% + 14px) }

/* =====================================================================
   PRESENCE, UNREAD, REPLIES, MENTIONS, TYPING, SEARCH/PINS, LOGS,
   ANIMATIONS, MOBILE DRAWER
   ===================================================================== */
:root { --idle: #f0b232; --dnd: #f23f43 }
.status.on.idle { background: var(--idle) } .status.on.dnd { background: var(--dnd) }
.pres-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--green) }
.pres-dot.idle { background: var(--idle) } .pres-dot.dnd { background: var(--dnd) } .pres-dot.invisible { background: transparent; box-shadow: inset 0 0 0 2px var(--faint) }
.pf-tag.on.idle { color: var(--idle) } .pf-tag.on.idle i { background: var(--idle); box-shadow: 0 0 8px var(--idle) }
.pf-tag.on.dnd { color: var(--dnd) } .pf-tag.on.dnd i { background: var(--dnd); box-shadow: 0 0 8px var(--dnd) }
.pf-status { margin-top: 8px; padding: 6px 12px; border-radius: 12px; background: var(--tile); border: 1px solid var(--tile-b); color: var(--text); font-size: 13px; max-width: 100%; word-break: break-word }
.member .ch-txt { min-width: 0 } .member .ch-sub { font-size: 11.5px }

/* unread */
.nav-dot { position: absolute; top: -2px; right: -2px; width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 2px solid #121216; pointer-events: none }
#side .item.unread .ch-name { color: #fff; font-weight: 800 }
#side .item.unread .ch-sub { color: var(--text) }
#side .item.unread > .ic:first-child, #side .item.unread .avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .5) }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; flex: none }
#side .item .badge { flex: none }

/* mentions + replies */
.mention { display: inline; padding: 0 4px; border-radius: 6px; font: inherit; font-weight: 700; color: #c9cdfb; background: rgba(85, 98, 240, .22); cursor: pointer }
.mention:hover { background: rgba(85, 98, 240, .4); color: #fff }
.mention.me { color: #ffd47a; background: rgba(240, 178, 50, .2) }
.msg.mentioned { background: rgba(240, 178, 50, .07); box-shadow: inset 3px 0 0 var(--idle) }
.msg.mentioned:hover { background: rgba(240, 178, 50, .11) }
.reply-ref { display: flex; align-items: center; gap: 6px; max-width: 100%; margin: 0 0 4px; padding: 3px 9px 3px 7px; border-radius: 9px; font-size: 12.5px; color: var(--muted);
  background: var(--tile); border: 1px solid var(--tile-b); text-align: left; width: fit-content }
.reply-ref b { color: var(--strong); flex: none } .reply-ref:hover { color: #fff; border-color: rgba(255, 255, 255, .2) }
.msg.mine .reply-ref { margin-left: auto }
.reply-bar { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; padding: 8px 8px 8px 12px; border-radius: 14px; font-size: 13px; background: var(--tile); border: 1px solid var(--glass-b) }
.reply-bar[hidden] { display: none }
.pin-mark { color: var(--idle); display: inline-flex; margin-left: 6px }
.msg.flash { animation: flash 1.6s ease-out }
@keyframes flash { 0%, 30% { background: rgba(85, 98, 240, .3) } 100% { background: transparent } }

/* typing */
.typing { height: 18px; padding: 4px 6px 0; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px }
.typing .dots { display: inline-flex; gap: 3px }
.typing .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: tdot 1.2s infinite }
.typing .dots i:nth-child(2) { animation-delay: .15s } .typing .dots i:nth-child(3) { animation-delay: .3s }
@keyframes tdot { 0%, 60%, 100% { transform: none; opacity: .4 } 30% { transform: translateY(-3px); opacity: 1 } }
.composer { padding-bottom: 6px }

/* search / pins panel */
.chat-panel { position: absolute; top: 74px; right: 14px; z-index: 20; width: min(400px, calc(100% - 28px)); max-height: min(520px, calc(100% - 160px)); display: flex; flex-direction: column;
  border-radius: 20px; background: var(--glass); border: 1px solid var(--glass-b); box-shadow: var(--dock-shadow); backdrop-filter: blur(16px); animation: pop .18s ease-out }
.cp-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--tile-b) }
.cp-head .search { flex: 1; height: 36px }
.cp-list { overflow-y: auto; padding: 6px }
.cp-row { display: flex; gap: 10px; width: 100%; padding: 9px; border-radius: 14px; text-align: left; color: var(--text) }
.cp-row:hover { background: var(--tile-h) }
.cp-meta { display: flex; align-items: baseline; gap: 8px } .cp-meta b { color: #fff }
.cp-text { font-size: 13.5px; line-height: 1.4; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden }

/* audit log */
.adm-log { display: flex; flex-direction: column; gap: 6px; padding: 6px }
.log-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--tile); border: 1px solid var(--tile-b) }
.log-ic { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--tile-h); flex: none }
.log-ic.red { color: #f87171; background: rgba(239, 68, 68, .14) } .log-ic.green { color: var(--green); background: rgba(35, 165, 90, .14) }
.log-row time { flex: none }

/* call stage: fullscreen hint */
.st-tile.has-video { cursor: zoom-in }
.st-full { position: absolute; top: 8px; right: 8px; z-index: 1; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: rgba(0, 0, 0, .55); color: #fff; opacity: 0; transition: opacity .15s }
.st-tile:hover .st-full { opacity: 1 }
.st-tile:fullscreen { width: 100%; border-radius: 0; border: 0; cursor: zoom-out }

/* animations */
@keyframes view-in { from { opacity: 0; transform: translateY(8px) scale(.995) } to { opacity: 1; transform: none } }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98) } to { opacity: 1; transform: none } }
#main.enter, #side.enter { animation: view-in .28s cubic-bezier(.2, .8, .2, 1) }
#side.enter { animation-duration: .22s }
.set-content { animation: view-in .25s cubic-bezier(.2, .8, .2, 1) }
.menu { animation: pop .14s ease-out } .modal { animation: pop .2s cubic-bezier(.2, .8, .2, 1) }
.reduce-motion #main.enter, .reduce-motion #side.enter, .reduce-motion .set-content, .reduce-motion .menu, .reduce-motion .modal, .reduce-motion .chat-panel, .reduce-motion .msg.flash, .reduce-motion .typing .dots i { animation: none }

/* mobile: channels open as a drawer from the dock */
.nav-item:has(> .mob-only) { display: none }
@media (max-width: 760px) {
  .nav-item:has(> .mob-only) { display: block }
  body.side-open #side { display: flex; position: fixed; z-index: 40; left: 10px; top: 10px; bottom: 94px; width: min(320px, calc(100vw - 20px)); animation: drawer .22s ease-out }
  body.side-open .layout::after { content: ""; position: fixed; inset: 0 0 84px; z-index: 39; background: rgba(0, 0, 0, .55) }
  #nav { gap: 3px; padding: 0 6px } .top-brand { display: none }
  .me-bar .icon-btn:not(:last-child) { display: none }
  .st-tile { width: 150px }
  .chat-panel { top: 70px; right: 8px; width: calc(100% - 16px) }
}
@keyframes drawer { from { transform: translateX(-30px); opacity: 0 } to { transform: none; opacity: 1 } }

/* =====================================================================
   ACCENT — active states and main buttons use the accent (blue by
   default, Settings → Appearance) instead of white
   ===================================================================== */
.nav-item.active .srv, .seg.on, .tab.active, .set-nav.active, .set-nav.active:hover, #side .item.active > .ic:first-child, #main .top .icon-btn.on, .st-btn.on,
.pf-dock .btn.primary, .id-actions .btn.primary, .v2 .btn.primary, .pcard-mini .btn, .srv-tile, .welcome-ic, .feat-ic, .stat-ic, .add-ic, .p-tile-ic, .adm-hero .mini-srv.big,
.toggle-row input:checked + .switch {
  background: var(--accent); color: var(--on-accent, #fff); border-color: var(--accent) }
.pf-dock .btn.primary:hover:not(:disabled), .pcard-mini .btn:hover:not(:disabled), .id-actions .btn.primary:hover:not(:disabled) { background: var(--accent-h, var(--accent)); filter: brightness(1.1) }
.toggle-row input:checked + .switch::after { background: #fff }
.nav-item.active .srv-ini { color: #fff }
.nav-item.active::after, .set-nav.active::after, .nav-dot, .unread-dot { background: var(--accent) }
.set-nav.active, .set-nav.active:hover { box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 40%, transparent) }
.radio.active .radio-dot { border-color: var(--accent) } .radio.active .radio-dot::after { background: var(--accent) }

/* call events in the chat */
.call-msg { display: flex; align-items: center; gap: 12px; margin: 8px auto; padding: 10px 12px; width: min(420px, calc(100% - 24px)); border-radius: 18px;
  background: var(--tile); border: 1px solid var(--glass-b) }
.call-ic { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 13px; flex: none; color: #fff; background: var(--green) }
.call-msg.ringing .call-ic { animation: st-ring 1.4s infinite } .call-msg.active .call-ic { background: var(--green) }
.call-msg.missed .call-ic { background: var(--red) } .call-msg.ended .call-ic { background: var(--tile-h); color: var(--muted) }
.call-msg.missed:not(.mine) .strong { color: #f87171 }
.reduce-motion .call-msg.ringing .call-ic { animation: none }

/* @ autocomplete */
.composer { position: relative }
.mention-pop { position: absolute; left: 12px; right: 12px; bottom: calc(100% - 4px); z-index: 15; max-width: 380px; padding: 6px; border-radius: 18px;
  background: var(--glass); border: 1px solid var(--glass-b); box-shadow: var(--dock-shadow); backdrop-filter: blur(16px); animation: pop .14s ease-out }
.mention-pop[hidden] { display: none }
.mp-head { padding: 4px 8px 6px; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--faint) }
.mp-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border-radius: 12px; text-align: left; color: var(--text) }
.mp-row b { color: #fff; min-width: 0 } .mp-row .muted { margin-left: auto; flex: none }
.mp-row.on, .mp-row:hover { background: var(--accent); } .mp-row.on .muted { color: rgba(255, 255, 255, .75) }

.btn:not(.secondary):not(.danger):not(.ok), .mp-row.on, .mp-row:hover { color: var(--on-accent, #fff) }

/* =====================================================================
   SMOOTH NAVIGATION (View Transitions): dock + settings tabs glide,
   panels cross-fade with a slight lift
   ===================================================================== */
#main.enter, #side.enter { animation: none }
.set-content { animation: none }
.nav-item.active .srv { view-transition-name: dock-active }
.set-nav.active { view-transition-name: set-active }
#nav { view-transition-name: dock } .settings > .set-side { view-transition-name: dock-settings } .settings > .set-top { view-transition-name: set-top }
#side { view-transition-name: side } #main { view-transition-name: main } #members { view-transition-name: members }
.settings > .set-main { view-transition-name: set-main }
::view-transition-group(*) { animation-duration: .32s; animation-timing-function: cubic-bezier(.22, 1, .36, 1) }
::view-transition-group(dock-active), ::view-transition-group(set-active) { animation-duration: .42s; animation-timing-function: cubic-bezier(.34, 1.4, .5, 1) }
::view-transition-old(main), ::view-transition-old(side), ::view-transition-old(set-main) { animation: vt-out .18s ease-in both }
::view-transition-new(main), ::view-transition-new(side), ::view-transition-new(set-main) { animation: vt-in .32s cubic-bezier(.22, 1, .36, 1) both }
::view-transition-old(dock), ::view-transition-new(dock), ::view-transition-old(dock-settings), ::view-transition-new(dock-settings), ::view-transition-old(set-top), ::view-transition-new(set-top) { animation: none; mix-blend-mode: normal }
::view-transition-new(dock), ::view-transition-new(dock-settings) { z-index: 1 }
@keyframes vt-out { to { opacity: 0; transform: scale(.99) } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px) scale(.995) } }
.reduce-motion * { view-transition-name: none !important }

/* while settings are open, the app behind must not get its own transition layers (they were painted over settings) */
.settings { view-transition-name: settings }
/* settings fade in / out only when opening or closing (only one side exists); tab switches inside keep it still */
::view-transition-old(settings), ::view-transition-new(settings) { animation: none }
/* settings sit on their own layer above the app (appended last), so the app stays perfectly still behind them */
::view-transition-new(settings):only-child { animation: set-open .42s cubic-bezier(.16, 1, .3, 1) both }
::view-transition-old(settings):only-child { animation: set-close .26s cubic-bezier(.4, 0, .6, 1) both }
@keyframes set-open { from { opacity: 0; transform: translateY(14px) scale(.965); filter: blur(4px) } }
@keyframes set-close { to { opacity: 0; transform: translateY(10px) scale(.975); filter: blur(3px) } }
::view-transition-group(settings) { animation-duration: .42s }

/* chat <-> chat / server / home: the side list stays put when you only change channel; its highlight glides */
html.vt-same-side::view-transition-old(side), html.vt-same-side::view-transition-new(side) { animation: none }
html.vt-same-side::view-transition-old(side) { display: none }
#side .item.active { view-transition-name: side-active }
::view-transition-group(side-active) { animation-duration: .38s; animation-timing-function: cubic-bezier(.34, 1.3, .5, 1) }
::view-transition-old(members):only-child { animation: vt-out .18s ease-in both }
::view-transition-new(members):only-child { animation: vt-in .3s cubic-bezier(.22, 1, .36, 1) both }
html.vt-settings::view-transition-old(*), html.vt-settings::view-transition-new(*) { animation: none }
html.vt-settings::view-transition-old(main), html.vt-settings::view-transition-old(side), html.vt-settings::view-transition-old(members), html.vt-settings::view-transition-old(dock),
html.vt-settings::view-transition-old(dock-active), html.vt-settings::view-transition-old(side-active), html.vt-settings::view-transition-old(root) { display: none }
html.vt-settings::view-transition-new(settings):only-child { animation: set-open .42s cubic-bezier(.16, 1, .3, 1) both }
html.vt-settings::view-transition-old(settings):only-child { display: block; animation: set-close .26s cubic-bezier(.4, 0, .6, 1) both }
html.vt-settings::view-transition-old(set-main) { display: block; animation: vt-out .16s ease-in both }
html.vt-settings::view-transition-new(set-main) { animation: vt-in .32s cubic-bezier(.22, 1, .36, 1) both }
/* Keep the bar and pill in sync; fade snapshots so labels never stack. */
html.vt-settings::view-transition-group(dock-settings), html.vt-settings::view-transition-group(set-active) {
  animation-duration: .36s; animation-timing-function: cubic-bezier(.22, 1, .36, 1) }
html.vt-settings::view-transition-old(dock-settings), html.vt-settings::view-transition-old(set-active) { animation: vt-fade-out .14s ease-out both }
html.vt-settings::view-transition-new(dock-settings), html.vt-settings::view-transition-new(set-active) { animation: vt-fade-in .24s ease-out both }
/* opening / closing: every settings layer (panel, tab bar, header, active tab) moves as one */
html.vt-settings::view-transition-new(*):only-child { animation: set-open .42s cubic-bezier(.16, 1, .3, 1) both }
html.vt-settings::view-transition-old(*):only-child { display: block; animation: set-close .26s cubic-bezier(.4, 0, .6, 1) both }

/* =====================================================================
   DOCK -> SETTINGS BAR: the bottom dock stretches into the settings tab
   bar (and back) — they share one transition name, only one at a time
   ===================================================================== */
body:has(.settings) #nav { view-transition-name: none }
::view-transition-group(dock) { overflow: clip; border-radius: 22px; animation-duration: .45s; animation-timing-function: cubic-bezier(.22, 1, .36, 1) }
::view-transition-old(dock), ::view-transition-new(dock) { height: 100%; object-fit: none; object-position: center }
html.vt-settings::view-transition-old(dock) { display: block; animation: vt-fade-out .25s ease-out both }
html.vt-settings::view-transition-new(dock) { animation: vt-fade-in .35s ease-out both }
@keyframes vt-fade-out { to { opacity: 0 } } @keyframes vt-fade-in { from { opacity: 0 } }
/* the settings window enters / leaves like every other window */
html.vt-settings::view-transition-new(*):only-child { animation: vt-in .34s cubic-bezier(.22, 1, .36, 1) both }
html.vt-settings::view-transition-old(*):only-child { display: block; animation: vt-out .2s ease-in both }
/* settings window uses the same enter / leave motion as every other window */
@keyframes set-open { from { opacity: 0; transform: translateY(10px) scale(.995) } }
@keyframes set-close { to { opacity: 0; transform: scale(.99) } }
body:has(.settings) .nav-item.active .srv, body:has(.settings) #side .item.active { view-transition-name: none }

/* settings open / close (CSS only) */
.settings.opening > .set-main, .settings.opening > .set-top { animation: vt-in .34s cubic-bezier(.22, 1, .36, 1) both }
.settings.opening > .set-side { animation: bar-grow .46s cubic-bezier(.22, 1, .36, 1) both }
.settings.opening .set-side-inner { animation: vt-fade-in .3s .08s ease-out both }
.settings.closing { animation: vt-out .2s ease-in both; pointer-events: none }
@keyframes bar-grow { from { clip-path: inset(0 max(0px, calc(50% - var(--dock-w, 400px) / 2)) round 22px) } to { clip-path: inset(0 0 round 22px) } }
.settings.opening { animation: vt-fade-in .2s ease-out both }

/* ---------- settings workspace: the dock's quiet, rounded surfaces ---------- */
.settings { grid-template-rows: 60px minmax(0, 1fr) 84px; background: var(--bg-0); color: var(--text);
  --set-surface: var(--glass); --set-inset: color-mix(in srgb, var(--tile) 60%, var(--bg-0)) }
[data-theme="light"] .settings {
  --bg-0: #eef0f4; --bg-1: #e4e7ec; --bg-2: #f6f7f9; --bg-3: #fff; --bg-float: #fff;
  --strong: #1b1c24; --text: #343640; --muted: #656978; --faint: #7a7f8e;
  --card: #fff; --border: rgba(0, 0, 0, .1); --border-soft: rgba(0, 0, 0, .06);
  --glass: #f6f7f9; --glass-b: rgba(0, 0, 0, .1); --tile: #fff; --tile-h: #e6e9ef; --tile-b: rgba(0, 0, 0, .1) }
.settings > .set-top { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 22px; background: transparent }
.settings .top-brand { display: flex }
.settings .top-brand img.brand-mark { width: 32px; height: 32px; border-radius: 10px }
.settings .set-crumb { gap: 8px; color: var(--muted); font-size: 13px; font-weight: 500 }
.settings .set-crumb > .ic { width: 14px; height: 14px }
.settings .set-x { height: 34px; padding: 0 9px; gap: 8px; border: 1px solid var(--tile-b); border-radius: 11px; background: var(--set-surface) }
.settings .set-x kbd { border: 0; background: transparent; padding: 0; font-size: 10px }
.settings > .set-main { display: block; min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto;
  background: transparent; border: 0; border-radius: 0; box-shadow: none; scrollbar-gutter: stable }
.settings .set-content, .settings .set-content.wide { width: 100%; max-width: 1240px; margin: 0 auto; padding: 30px 32px 38px }
.settings .set-page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 28px }
.settings .set-page-icon { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 15px;
  color: var(--strong); background: var(--tile); border: 1px solid var(--tile-b) }
.settings .set-page-icon .ic { width: 22px; height: 22px; stroke-width: 1.7 }
.settings .set-page-title { min-width: 0 }
.settings .set-page-title h2 { margin: 0; color: var(--strong); font-size: 27px; line-height: 1.2; font-weight: 650; letter-spacing: -.035em }
.settings .set-page-title p { margin: 6px 0 0; max-width: 760px; font-size: 13px; line-height: 1.6; color: var(--muted) }
.settings .set-page-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start }
.settings .set-block { min-width: 0; padding: 24px; border: 1px solid var(--tile-b); border-radius: 20px; background: var(--set-surface) }
.settings .set-block:only-child, .settings .set-content.wide .set-block,
.settings .set-block.set-identity, .settings .set-block:has(> .profile-edit),
.settings .set-block:has(> .feature-list), .settings .set-block:has(> .danger-zone) { grid-column: 1 / -1 }
.settings .set-block > h3 { margin: 0 0 18px; font-size: 15px; line-height: 1.4; font-weight: 600; letter-spacing: -.015em }
.settings .set-body > p { font-size: 13px; line-height: 1.65; margin: 0 0 16px }
.settings .set-body > :last-child { margin-bottom: 0 }
.settings .set-body > .set-card { margin: 0; padding: 0; background: transparent; border: 0; border-radius: 0; gap: 0 }
.settings .set-body > .set-card + div, .settings .set-body > .set-card + p { margin-top: 20px }
.settings .set-body > .set-card + p { margin-bottom: 0 }
.settings .set-block .narrow { max-width: none; width: 100% }
.settings .set-block .stack { gap: 16px }
.settings .field { gap: 8px; min-width: 0 }
.settings .field > span, .settings .info .cat { font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text) }
.settings .field small { font-size: 12px; line-height: 1.55; color: var(--muted) }
.settings input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]), .settings textarea, .settings select {
  min-width: 0; min-height: 44px; padding: 11px 13px; border: 1px solid var(--tile-b); border-radius: 12px;
  background: var(--set-inset); color: var(--strong); font-size: 14px; transition: border-color .15s, box-shadow .15s }
.settings textarea { line-height: 1.6 }
.settings input::placeholder, .settings textarea::placeholder { color: var(--faint) }
.settings :is(button, input, textarea, select):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px }
.settings input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]):focus-visible,
.settings textarea:focus-visible, .settings select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent) }
.settings .btn { min-height: 38px; height: auto; padding: 10px 15px; border-radius: 11px; font-size: 13px; font-weight: 600; box-shadow: none }
.settings .btn.sm { min-height: 34px; padding: 8px 12px; font-size: 12px }
.settings .btn:not(.secondary):not(.danger):not(.ok) { background: var(--strong); color: var(--bg-0) }
.settings .btn:not(.secondary):not(.danger):not(.ok):hover:not(:disabled) { background: color-mix(in srgb, var(--strong) 86%, var(--bg-0)); filter: none }
.settings .btn.secondary { background: var(--tile); border: 1px solid var(--tile-b); color: var(--text) }
.settings .btn.secondary:hover:not(:disabled) { background: var(--tile-h); color: var(--strong) }
.settings .btn.danger { background: color-mix(in srgb, var(--red) 12%, transparent); border: 1px solid color-mix(in srgb, var(--red) 24%, transparent); color: #ef858b }
.settings .btn.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--red) 22%, transparent) }
[data-theme="light"] .settings .btn.danger { color: #b51b32 }
.settings .link { height: auto; min-height: 34px; padding: 6px 10px; color: var(--muted); font-size: 13px; border-radius: 9px }
.settings .link:hover { color: var(--strong) }
.settings .link.inline { min-height: 0; padding: 0 }
.settings .form-err { font-size: 13px; line-height: 1.5 }
.settings .toggle-row { padding: 10px 0; gap: 18px }
.settings .toggle-row .strong { font-size: 14px; font-weight: 500 }
.settings .toggle-row .muted { font-size: 12px; line-height: 1.6; margin-top: 3px }
.settings .set-card .toggle-row + .toggle-row { margin-top: 12px; padding-top: 20px; border-top-color: var(--tile-b) }
.settings .toggle-row input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 3px; box-shadow: none }
.settings .switch { width: 38px; height: 22px; background: var(--tile-h); border: 1px solid var(--glass-b) }
.settings .switch::after { top: 3px; left: 3px; width: 14px; height: 14px; background: var(--muted) }
.settings .toggle-row input:checked + .switch::after { background: var(--on-accent, #fff); transform: translateX(16px) }
.settings .set-identity { padding: 0; overflow: hidden }
.settings .set-identity .profile-card { display: grid; grid-template-columns: 1fr 1fr; border: 0; border-radius: 0; background: transparent }
.settings .set-identity .banner { grid-column: 1 / -1; height: 3px; background: color-mix(in srgb, var(--accent) 55%, var(--tile)) }
.settings .set-identity .profile-row { margin: 0; padding: 24px; align-items: center; gap: 16px }
.settings .set-identity .profile-row .avatar { --s: 58px !important; width: 58px !important; height: 58px !important; box-shadow: none }
.settings .set-identity .profile-row .grow { flex-direction: column; align-items: flex-start; gap: 6px; padding: 0 }
.settings .set-identity .profile-name { font-size: 20px; letter-spacing: -.02em; overflow-wrap: anywhere }
.settings .set-identity .profile-info { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-content: center; gap: 20px;
  margin: 0; padding: 24px; border-left: 1px solid var(--tile-b); border-radius: 0; background: transparent }
.settings .info .cat { margin-bottom: 4px; padding: 0; font-size: 12px; color: var(--muted) }
.settings .info > :last-child { color: var(--strong); font-size: 13px; overflow-wrap: anywhere }
.settings .set-block:has(> .danger-zone) { border-color: color-mix(in srgb, var(--red) 16%, var(--tile-b)) }
.settings .danger-zone { padding: 0; gap: 18px; background: transparent; border: 0; border-radius: 0 }
.settings .danger-zone p { max-width: 740px; font-size: 13px; line-height: 1.6 }
.settings .set-block:has(> .feature-list) { padding: 0; background: transparent; border: 0 }
.settings .feature-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px }
.settings .feat { min-width: 0; padding: 20px; gap: 12px; border-radius: 17px; background: var(--set-surface); border-color: var(--tile-b) }
.settings .feat-ic { width: 34px; height: 34px; border-radius: 11px; background: var(--tile); color: var(--muted) }
.settings .feat .strong { font-size: 13px; font-weight: 600 }
.settings .feat p { margin-top: 6px; font-size: 12px; line-height: 1.65 }
.settings .themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px }
.settings .theme-card { min-width: 0; padding: 9px; gap: 12px; align-items: stretch; background: transparent; border: 1px solid var(--tile-b); border-radius: 14px }
.settings .theme-card:hover { background: var(--tile); border-color: var(--glass-b) }
.settings .theme-card.active { background: var(--tile); border-color: var(--muted) }
.settings .theme-card .swatch, .settings .theme-card.active .swatch { position: relative; display: block; width: 100%; height: 90px; border: 0; border-radius: 9px; box-shadow: none; overflow: hidden }
.settings .theme-card.dark .swatch { background: #232329 }
.settings .theme-card.midnight .swatch { background: #050507 }
.settings .theme-card.light .swatch { background: #ececf0 }
.settings .theme-card .swatch i { position: absolute; display: block; border-radius: 3px; background: #34343d }
.settings .theme-card .swatch i:nth-child(1) { top: 12px; left: 10px; right: 10px; height: 7px; background: #464650 }
.settings .theme-card .swatch i:nth-child(2) { top: 27px; left: 10px; width: 27%; height: 26px; background: #2d2d35 }
.settings .theme-card .swatch i:nth-child(3) { top: 27px; right: 10px; width: 49%; height: 26px; background: #2d2d35 }
.settings .theme-card.midnight .swatch i { background: #17171c }
.settings .theme-card.light .swatch i { background: #d7d7e0 }
.settings .theme-card .swatch::before { content: ""; position: absolute; bottom: 10px; left: 13px; right: 13px; height: 16px; border-radius: 5px; background: #151519; border: 1px solid rgba(255, 255, 255, .09) }
.settings .theme-card.light .swatch::before { background: #fff; border-color: rgba(0, 0, 0, .08) }
.settings .theme-card .swatch::after { content: ""; position: absolute; bottom: 14px; left: calc(50% - 9px); width: 18px; height: 8px; border-radius: 3px; background: #d9dae0 }
.settings .theme-card.light .swatch::after { background: #303038 }
.settings .theme-card > .row { justify-content: center; font-size: 12px; gap: 5px }
.settings .swatches { gap: 12px; padding: 3px }
.settings .swatch-dot { width: 28px; height: 28px; border: 2px solid var(--tile-b) }
.settings .swatch-dot.on { box-shadow: 0 0 0 3px var(--set-surface), 0 0 0 4px var(--muted) }
.settings .color { width: 52px; height: 36px; border: 1px solid var(--tile-b); border-radius: 10px; background: var(--set-inset) }
.settings .segs { padding: 4px; border-radius: 12px; background: var(--set-inset); border-color: var(--tile-b); box-shadow: none; flex-wrap: wrap }
.settings .seg { min-height: 34px; flex: 1; padding: 6px 10px; border-radius: 8px; font-size: 12px }
.settings .seg:hover:not(.on) { transform: none }
.settings .seg.on { background: var(--tile-h); border-color: var(--glass-b); color: var(--strong); box-shadow: none }
.settings .radio-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; margin: 0 }
.settings .radio { min-width: 0; min-height: 70px; padding: 18px; border-radius: 14px; border-color: var(--tile-b); background: var(--tile) }
.settings .radio.active { border-color: var(--muted); box-shadow: none; background: var(--set-inset) }
.settings .radio .muted { font-size: 12px }
.settings .kb-row { min-height: 50px; padding: 12px 0; gap: 20px; font-size: 13px }
.settings .kb-row + .kb-row { padding-top: 12px; border-top-color: var(--tile-b) }
.settings .kb-keys { flex-wrap: wrap; justify-content: flex-end }
.settings .kb-keys kbd { min-height: 26px; padding: 6px 9px; border-color: var(--tile-b); background: var(--tile); font-size: 11px }
.settings .profile-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 360px); gap: 40px; align-items: start }
.settings .profile-edit > .stack { width: 100%; max-width: none }
.settings .preview { width: 100%; min-width: 0; position: sticky; top: 16px }
.settings .preview .pf { max-height: none; box-shadow: none; border-radius: 20px }
.settings .preview .pf-ring { box-shadow: 0 0 0 4px #0c0c0f }
.settings .save-bar { z-index: 3; bottom: 14px; margin-top: 20px; padding: 12px 14px 12px 18px; gap: 12px;
  background: var(--tile); border-color: var(--glass-b); border-radius: 16px; box-shadow: 0 8px 30px rgba(0, 0, 0, .18); font-size: 13px }
.settings .so-card { margin-bottom: 18px; border-color: var(--tile-b); border-radius: 16px; box-shadow: none }
.settings .so-grid { gap: 14px; margin-bottom: 20px }
.settings .so-box { padding: 20px; border-radius: 15px; background: var(--set-inset); border-color: var(--tile-b) }
.settings .so-name { padding: 20px; border-radius: 15px; background: var(--set-inset); border-color: var(--tile-b) }
.settings .role-list { padding: 8px; border: 1px solid var(--tile-b); border-radius: 14px; background: var(--set-inset) }
.settings .role-item { border-radius: 9px; font-size: 13px; height: 38px }
.settings .role-item.active { background: var(--tile-h) }
.settings .table-wrap { min-width: 0; overflow-x: auto; border-radius: 14px; border-color: var(--tile-b); background: transparent }
.settings .table-wrap th { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted) }
.settings .set-content .copy-box { border-radius: 12px; background: var(--set-inset); border-color: var(--tile-b) }
.settings > .set-side { display: flex; min-width: 0; border-color: var(--glass-b); box-shadow: 0 12px 32px rgba(0, 0, 0, .25) }
.settings .set-nav.active, .settings .set-nav.active:hover { box-shadow: none }
.settings .set-nav.active .ic { color: inherit }
.settings .set-nav:not(.active):not(.danger):hover { background: var(--tile-h); color: var(--strong) }
[data-theme="light"] .settings > .set-side { background: var(--glass); box-shadow: 0 8px 26px rgba(30, 35, 55, .1) }
[data-theme="light"] .settings .set-nav.danger { color: #b51b32 }

@media (max-width: 900px) {
  .settings .set-content, .settings .set-content.wide { padding: 24px 24px 32px }
  .settings .set-page-grid { grid-template-columns: minmax(0, 1fr) }
  .settings .profile-edit { grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); gap: 24px }
  .settings .set-identity .profile-info { gap: 16px; grid-template-columns: minmax(0, 1fr) }
}
@media (max-width: 760px) {
  .settings { grid-template-columns: minmax(0, 1fr); grid-template-rows: 56px minmax(0, 1fr) 80px; gap: 6px; padding: 0 8px }
  .settings > .set-top { height: 56px; padding: 0 9px; gap: 10px }
  .settings .set-crumb { font-size: 12px }
  .settings .set-x kbd { display: none }
  .settings .set-content, .settings .set-content.wide { padding: 20px 8px 28px }
  .settings .set-page-head { gap: 12px; margin-bottom: 22px }
  .settings .set-page-icon { width: 42px; height: 42px; border-radius: 13px }
  .settings .set-page-title h2 { font-size: 24px }
  .settings .set-block { padding: 20px; border-radius: 17px }
  .settings .set-identity { padding: 0 }
  .settings .set-identity .profile-card { grid-template-columns: minmax(0, 1fr) }
  .settings .set-identity .profile-row { padding: 20px }
  .settings .set-identity .profile-info { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 18px 20px; border-left: 0; border-top: 1px solid var(--tile-b) }
  .settings .profile-edit { grid-template-columns: minmax(0, 1fr); gap: 28px }
  .settings .preview { position: static; max-width: 360px; margin: 0 auto }
  .settings .roles-layout { flex-direction: column; gap: 20px }
  .settings .role-list, .settings .role-edit { width: 100% }
  .settings .role-list { position: static }
  .settings .so-grid { grid-template-columns: minmax(0, 1fr) }
  .settings .save-bar { flex-wrap: wrap; bottom: 8px; padding: 12px; gap: 8px }
  .settings .save-bar > .grow { flex-basis: 100% }
  .settings > .set-side { display: flex; width: max-content; max-width: 100%; height: 62px; overflow-x: auto; overflow-y: hidden;
    justify-self: center; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch }
  .settings .set-side-inner { min-width: max-content; padding: 0 7px }
  .settings .set-nav { flex: none; min-width: 42px; height: 42px; padding: 0 11px }
  .settings .set-nav.active { padding: 0 14px; font-size: 12px }
  .settings .set-nav[data-tip]:not(.active):hover::before { display: none }
}
@media (max-width: 420px) {
  .settings .set-block { padding: 17px }
  .settings .set-identity { padding: 0 }
  .settings .themes { gap: 6px }
  .settings .theme-card { padding: 6px; gap: 9px; border-radius: 11px }
  .settings .theme-card .swatch { height: 76px }
  .settings .set-identity .profile-info { grid-template-columns: minmax(0, 1fr); gap: 14px }
  .settings .kb-row { gap: 12px }
  .settings .set-body > .row, .settings .set-card > .row { flex-wrap: wrap }
  .settings .mic-meter { min-width: 70px }
}

/* ---------- administration controls ---------- */
.settings .admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px }
.settings .admin-head h2 { margin: 0 }
.settings .admin-bar { flex-wrap: wrap; gap: 12px; box-shadow: none }
.settings .admin-bar .tabs { flex-wrap: wrap; gap: 4px; background: transparent; border: 0; padding: 0 }
.settings .admin-bar .tab { gap: 5px; font-size: 13px }
.settings .admin-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 18px 0 12px }
.settings .admin-tools .search { width: auto; min-width: 160px; flex: 1 1 220px }
.settings .admin-tools select { width: auto; max-width: 240px; flex: 0 1 auto }
.settings .admin-pagination { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 16px 0 0; font-size: 12px; color: var(--muted) }
.settings .admin-pagination .btn { min-width: 34px }
.settings .admin-system-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start }
.settings .set-content .admin-system-grid > .set-block { grid-column: auto }
.settings .admin-system-facts { margin: 0 }
.settings .admin-system-facts > div { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--tile-b) }
.settings .admin-system-facts > div:last-child { padding-bottom: 0; border-bottom: 0 }
.settings .admin-system-facts dt { color: var(--muted); font-size: 12px }
.settings .admin-system-facts dd { margin: 0; color: var(--strong); font-size: 13px; font-weight: 500; text-align: right; overflow-wrap: anywhere }
.settings .admin-registration > p { font-size: 13px; line-height: 1.6; margin-bottom: 16px }
@media (max-width: 900px) { .settings .admin-system-grid { grid-template-columns: minmax(0, 1fr) } }
@media (max-width: 520px) {
  .settings .admin-head { align-items: flex-start; gap: 10px }
  .settings .admin-tools select { flex: 1 1 140px; max-width: none }
  .settings .admin-tools > .btn { flex: 1 }
  .settings .admin-pagination > .grow { flex-basis: 100% }
}

/* ---------- light theme: complete palette after the dark dock layers ---------- */
[data-theme="light"] {
  color-scheme: light;
  --bg-0: #eef0f4; --bg-1: #e7eaf0; --bg-2: #f6f7fa; --bg-3: #fff; --bg-float: #fff;
  --app-bg: #eef0f4; --card: #fff; --input: #f2f4f8; --composer: #f6f7fa;
  --text: #343c4b; --strong: #192130; --muted: #626d7e; --faint: #737d8c;
  --hover: rgba(32, 45, 70, .055); --active: rgba(32, 45, 70, .09);
  --border: rgba(32, 45, 70, .13); --border-soft: rgba(32, 45, 70, .075);
  --glass: rgba(255, 255, 255, .95); --glass-b: rgba(32, 45, 70, .12);
  --tile: #f2f4f8; --tile-h: #e7ebf2; --tile-b: rgba(32, 45, 70, .09);
  --shadow: 0 8px 26px rgba(32, 45, 70, .1);
  --dock-shadow: 0 10px 32px rgba(32, 45, 70, .09), inset 0 1px 0 rgba(255, 255, 255, .8);
  --green: #18764b; --red: #c53249; --red-h: #a9253b; --yellow: #986700; --idle: #986700;
  --accent-ink: color-mix(in srgb, var(--accent) 70%, #192130);
}
[data-theme="light"] ::selection { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--strong) }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: #c8cfda }
[data-theme="light"] :is(input, textarea)::placeholder { color: var(--faint) }
[data-theme="light"] :is(h1, h2, h3, .strong, .author, .pm-name) { color: var(--strong) }
[data-theme="light"] .link, [data-theme="light"] .att-name, [data-theme="light"] .adm-file { color: var(--accent-ink) }
[data-theme="light"] .btn.secondary { background: var(--tile); color: var(--text); border: 1px solid var(--tile-b) }
[data-theme="light"] .btn.secondary:hover:not(:disabled) { background: var(--tile-h); color: var(--strong) }
[data-theme="light"] .btn:not(.secondary):not(.danger):not(.ok) { border: 1px solid color-mix(in srgb, var(--accent) 75%, var(--strong)); color: var(--on-accent, #fff) }
[data-theme="light"] .icon-btn:hover, [data-theme="light"] .round-btn:hover { background: var(--tile-h); color: var(--strong) }
[data-theme="light"] .tag:not(.green):not(.red):not(.on), [data-theme="light"] .pf-tag:not(.on) { background: var(--tile); color: var(--text) }
[data-theme="light"] .tag.green, [data-theme="light"] .tag.on { color: var(--green) }
[data-theme="light"] .tag.red, [data-theme="light"] .danger-text, [data-theme="light"] .form-err { color: var(--red) }
[data-theme="light"] .badge { color: #fff }

/* Floating navigation and conversations. */
[data-theme="light"] #nav { background: var(--glass); border-color: var(--glass-b); box-shadow: var(--dock-shadow) }
[data-theme="light"] .srv, [data-theme="light"] .nav-item:hover .srv { background: var(--tile); border-color: var(--tile-b); color: var(--text) }
[data-theme="light"] .nav-item:hover .srv { background: var(--tile-h) }
[data-theme="light"] .nav-item.active .srv { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff) }
[data-theme="light"] .nav-item.active .srv-ini { color: inherit }
[data-theme="light"] .srv.green, [data-theme="light"] .nav-item:hover .srv.green { background: transparent; border-color: var(--border); color: var(--muted) }
[data-theme="light"] .nav-item:hover .srv.green { background: var(--tile-h); color: var(--strong) }
[data-theme="light"] .dock-sep { background: var(--border) }
[data-theme="light"] .nav-badge, [data-theme="light"] .nav-dot { border-color: #fff }
[data-theme="light"] .me-bar .me-btn { background: var(--tile); border-color: var(--tile-b) }
[data-theme="light"] .me-bar .icon-btn:hover { background: var(--tile-h) }
[data-theme="light"] #side .item.active { background: var(--tile-h); color: var(--strong); box-shadow: inset 0 0 0 1px var(--border-soft) }
[data-theme="light"] #side .item.active > .ic:first-child { background: var(--accent); color: var(--on-accent, #fff); border-color: var(--accent) }
[data-theme="light"] #side .item.unread .ch-name { color: var(--strong) }
[data-theme="light"] #side .item.unread > .ic:first-child, [data-theme="light"] #side .item.unread .avatar { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent) }
[data-theme="light"] .mem-head { background: transparent }
[data-theme="light"] .srv-card { box-shadow: none }
[data-theme="light"] .srv-cover:not(.img), [data-theme="light"] .so-banner:not(.img) { background: color-mix(in srgb, var(--c, var(--accent)) 14%, var(--bg-2)) }
[data-theme="light"] .srv-tile { color: var(--on-accent, #fff) }

/* Message surfaces, tools and the composer. Media keeps its own backdrop. */
[data-theme="light"] .msg .text { background: var(--tile); border-color: var(--tile-b); color: var(--text) }
[data-theme="light"] .msg.mine .text { background: var(--accent); color: var(--on-accent, #fff) }
[data-theme="light"] .msg.mine .edited { color: color-mix(in srgb, var(--on-accent, #fff) 78%, transparent) }
[data-theme="light"] .msg-tools { background: var(--bg-float); border-color: var(--border); box-shadow: var(--shadow) }
[data-theme="light"] .composer textarea { background: transparent; border-color: transparent; color: var(--text) }
[data-theme="light"] .composer .send, [data-theme="light"] .composer .send:hover { background: var(--accent); color: var(--on-accent, #fff) }
[data-theme="light"] .mention { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 12%, transparent) }
[data-theme="light"] .mention:hover { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 22%, transparent) }
[data-theme="light"] .mention.me { color: #845600; background: #fff0cc }
[data-theme="light"] .reply-ref:hover { color: var(--strong); border-color: var(--border) }
[data-theme="light"] .reaction.mine { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 10%, transparent) }
[data-theme="light"] .cp-meta b, [data-theme="light"] .mp-row b { color: var(--strong) }
[data-theme="light"] .mp-row:hover b, [data-theme="light"] .mp-row.on b { color: var(--on-accent, #fff) }
[data-theme="light"] .mp-row.on .muted { color: var(--on-accent, #fff) }
[data-theme="light"] .day span { background: var(--bg-2) }
[data-theme="light"] .call-msg.missed:not(.mine) .strong { color: var(--red) }
[data-theme="light"] .call-ic { color: #fff }

/* People, tabs, menus and dialogs. */
[data-theme="light"] .pcard-mini:hover { border-color: var(--border) }
[data-theme="light"] .segs, [data-theme="light"] .admin-bar .tabs { background: var(--bg-2); border-color: var(--border) }
[data-theme="light"] .seg.on, [data-theme="light"] .tab.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff) }
[data-theme="light"] .tab.active .count, [data-theme="light"] .admin-bar .tab.active .count { color: inherit; background: transparent }
[data-theme="light"] .tab.add.active { color: var(--green); background: transparent }
[data-theme="light"] .menu-item:hover, [data-theme="light"] .menu-item:focus-visible { color: var(--strong) }
[data-theme="light"] .menu-item.accent, [data-theme="light"] .menu-item.accent:hover, [data-theme="light"] .menu-item.accent .ic { color: var(--accent-ink) }
[data-theme="light"] .menu-item.danger { color: var(--red) }
[data-theme="light"] .menu-item.danger:hover { background: var(--red); color: #fff }
[data-theme="light"] .modal-bg { background: rgba(25, 33, 48, .3) }
[data-theme="light"] .modal.bare { background: transparent; border: 0; box-shadow: none }
[data-theme="light"] .lightbox a { color: #fff }
[data-theme="light"] .back:hover { color: var(--strong); background: var(--tile-h) }
[data-theme="light"] .nav-item[data-tip]:hover::before, [data-theme="light"] .set-nav[data-tip]:not(.active):hover::before,
[data-theme="light"] .pf-tile:hover::before, [data-theme="light"] .st-btn[data-tip]:hover::before, [data-theme="light"] .id-srv[data-tip]:hover::before {
  color: #fff; background: #253044; box-shadow: var(--shadow) }

/* Sign in / registration: both panels follow the selected appearance. */
[data-theme="light"] .auth, [data-theme="light"] .auth.split, [data-theme="light"] .auth-panel { background: var(--bg-0) }
[data-theme="light"] .auth-show.hero { color: var(--text); border-right-color: var(--border); background: radial-gradient(600px 420px at 50% 42%, rgba(85, 98, 240, .1), transparent 70%), #f5f6fc }
[data-theme="light"] .auth-show.hero::before { background-image: radial-gradient(rgba(60, 73, 110, .1) 1px, transparent 1.5px) }
[data-theme="light"] .hero .brand, [data-theme="light"] .hero-copy h1 { color: var(--strong) }
[data-theme="light"] .hero .auth-copy, [data-theme="light"] .hero-copy p, [data-theme="light"] .auth-foot { color: var(--muted) }
[data-theme="light"] .hero .mascot { filter: brightness(0) opacity(.8) drop-shadow(0 20px 36px rgba(85, 98, 240, .12)) }
[data-theme="light"] .fcard { box-shadow: 0 10px 28px rgba(35, 44, 75, .12); border: 1px solid rgba(35, 44, 75, .06) }
[data-theme="light"] .auth-form .btn { background: var(--accent); color: var(--on-accent, #fff) }
[data-theme="light"] .auth-form .btn:hover:not(:disabled) { background: var(--accent-h) }
[data-theme="light"] .auth-form input { background: #fff; border-color: var(--border); color: var(--strong) }
[data-theme="light"] .auth-form .seg.on { color: var(--on-accent, #fff) }
[data-theme="light"] .demo-msg.mine p { color: var(--on-accent, #fff) }

/* Profile chrome is light; uploaded banners and avatars retain their colors. */
[data-theme="light"] .pf, [data-theme="light"] .pcard.v2, [data-theme="light"] .idcard { background: var(--bg-float); border-color: var(--border); box-shadow: var(--shadow) }
[data-theme="light"] .pf-name, [data-theme="light"] .pf-stat b, [data-theme="light"] .v2 .p-name,
[data-theme="light"] .p-tile b, [data-theme="light"] .id-line b { color: var(--strong) }
[data-theme="light"] .pf-ring:not(.none) { box-shadow: 0 0 0 5px var(--bg-float), 0 8px 25px color-mix(in srgb, var(--pc, var(--accent)) 15%, transparent) }
[data-theme="light"] .pf-ring .avatar, [data-theme="light"] .pf-ring .status, [data-theme="light"] .v2 .p-ring .status { border-color: var(--bg-float) }
[data-theme="light"] .settings .preview .pf-ring { box-shadow: 0 0 0 4px var(--bg-float) }
[data-theme="light"] .pf-ring.none, [data-theme="light"] .settings .preview .pf-ring.none { box-shadow: none }
[data-theme="light"] .pf-tile:hover, [data-theme="light"] .id-srv:hover { color: var(--strong); border-color: var(--border) }
[data-theme="light"] .pill-tag, [data-theme="light"] .p-tile, [data-theme="light"] .v2 .p-box,
[data-theme="light"] .v2 .chip, [data-theme="light"] .v2 .p-srv, [data-theme="light"] .id-sec,
[data-theme="light"] .id-line-ic, [data-theme="light"] .id-sec .chip { background: var(--tile); border-color: var(--tile-b) }
[data-theme="light"] .v2 .p-ring, [data-theme="light"] .v2 .p-ring .avatar { background-color: var(--bg-float) }
[data-theme="light"] .icon-btn.sq, [data-theme="light"] .id-actions .btn.secondary { background: var(--tile); border-color: var(--tile-b) }
[data-theme="light"] .icon-btn.sq:hover { background: var(--tile-h); color: var(--strong) }
[data-theme="light"] .id-srv { background: var(--tile); border-color: var(--tile-b) }
[data-theme="light"] .id-side { color: #fff }
[data-theme="light"] .ring-dot.none { background: repeating-linear-gradient(45deg, transparent 0 5px, rgba(25, 33, 48, .2) 5px 6px) }

/* Call controls and administrative tables share the same light surfaces. */
[data-theme="light"] #stage { background: var(--bg-2); border-color: var(--border) }
[data-theme="light"] .st-head b { color: var(--strong) }
[data-theme="light"] .st-btn:not(.on):not(.red):hover { color: var(--strong) }
[data-theme="light"] .st-btn.on { color: var(--on-accent, #fff) }
[data-theme="light"] .stat b, [data-theme="light"] .adm-fact b { color: var(--strong) }
[data-theme="light"] .adm-where, [data-theme="light"] .adm-where.dm { color: var(--text); background: var(--tile); border-color: var(--tile-b) }
[data-theme="light"] .table-wrap th { color: var(--muted) }
[data-theme="light"] tbody tr:hover { background: var(--hover) }
[data-theme="light"] .admin-bar { box-shadow: none }
[data-theme="light"] .admin-bar .search { background: var(--input) }
[data-theme="light"] .log-ic.red { color: var(--red) }
[data-theme="light"] .kb-keys kbd { background: var(--tile); color: var(--text) }
[data-theme="light"] .settings .btn:not(.secondary):not(.danger):not(.ok) { background: var(--strong); color: var(--bg-0); border-color: var(--strong) }
[data-theme="light"] .settings .seg.on { background: var(--tile-h); border-color: var(--glass-b); color: var(--strong) }

/* ===== HOME: stats + side column ===== */
.home-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px }
.home-stat { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--border); text-align: left; transition: border-color .15s, transform .15s }
.home-stat:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); transform: translateY(-1px) }
.home-stat-ic { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 12px; color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent) }
.home-stat-n { font-size: 20px; font-weight: 700; color: var(--strong); line-height: 1.1 }
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 10px; align-items: start }
.home-main { min-width: 0 }
.home-main > .empty { margin: 0 }
.home-aside { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0 }
.home-card { padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--border) }
.home-card h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; font-weight: 700 }
.home-quick, .home-dm { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 11px; color: var(--text); text-align: left; font-weight: 500; transition: background .12s }
.home-quick:hover, .home-dm:hover { background: var(--hover, rgba(255, 255, 255, .05)); color: var(--strong) }
.home-quick > .ic:last-child { color: var(--muted); transform: rotate(-90deg) }
.home-quick-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(255, 255, 255, .05); color: var(--strong) }
.home-lock { display: flex; align-items: center; gap: 12px }
.home-note { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); color: var(--muted); margin-bottom: 14px }
.home-note-ic { color: var(--accent); display: grid }
.home-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 4px 2px 10px }
@media (max-width: 1100px) { .home-layout { grid-template-columns: 1fr } .home-aside { position: static } }
@media (max-width: 700px) { .home-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) } }


/* ===== SETTINGS SECTIONS: grouped list look ===== */
.settings .set-content, .settings .set-content:not(.wide) { max-width: 760px }
.settings .set-page-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 26px }
.settings .set-page-icon { width: 44px; height: 44px; border-radius: 14px; border: 0; color: #fff;
  background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000)); box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 35%, transparent) }
.settings .set-page-title h2 { font-size: 28px; letter-spacing: -.03em }
.settings .set-page-grid { display: flex; flex-direction: column; gap: 26px }
.settings .set-block:not(.set-identity) { padding: 0; border: 0; background: transparent; border-radius: 0 }
.settings .set-block > h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted) }
.settings .set-body { padding: 20px 22px; border-radius: 18px; background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .06) }
.settings .set-body > :last-child { margin-bottom: 0 }
.settings .set-body .stack { gap: 14px }
.settings .set-body .toggle-row { padding: 14px 0; margin: 0; border-bottom: 1px solid rgba(255, 255, 255, .05) }
.settings .set-body .toggle-row:first-child { padding-top: 0 }
.settings .set-body .toggle-row:last-child { padding-bottom: 0; border-bottom: 0 }
.settings .field input, .settings .field select, .settings .field textarea { border-radius: 12px; border: 1px solid rgba(255, 255, 255, .07); background: rgba(0, 0, 0, .35); transition: border-color .15s, box-shadow .15s }
.settings .field input:focus, .settings .field select:focus, .settings .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); outline: 0 }
.settings .set-body form .btn:last-child, .settings .set-body form > div:last-child .btn { align-self: flex-start }
.settings .btn:not(.secondary):not(.danger):not(.ghost):not(.ok) { background: var(--accent); color: var(--on-accent, #fff); border-color: transparent }
.settings .btn { border-radius: 12px; transition: transform .12s, filter .15s }
.settings .btn:hover { filter: brightness(1.1) }
.settings .btn:active { transform: scale(.97) }
.settings .is-danger > h3 { color: #f87171 }
.settings .is-danger .set-body { background: rgba(239, 68, 68, .05); border-color: rgba(239, 68, 68, .18) }
/* identity: gradient hero card */
.settings .set-identity { padding: 0; border: 0; border-radius: 22px; overflow: hidden;
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 38%, #0d0d12), #121218 70%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07) }
.settings .set-identity .set-body { padding: 0; border: 0; background: transparent; border-radius: 0 }
.settings .set-identity .banner { display: none }
.settings .set-identity .profile-card { background: transparent }
.settings .set-identity .profile-row { padding: 26px }
.settings .set-page-grid > * { width: 100%; align-self: stretch; max-width: none }

/* ===== HOME v2 (calm) ===== */
.home-stat-ic, .home-stat .home-stat-ic { color: var(--strong); background: rgba(255, 255, 255, .06) }
.home-stat-n { font-size: 22px }
.home-invite { display: flex; align-items: center; gap: 18px; margin-top: 12px; padding: 18px 20px; border-radius: 16px; background: var(--card); border: 1px solid var(--border) }
.home-invite img { width: 52px; height: 52px; flex: none }
.home-invite h3 { font-size: 15px; margin: 0 0 3px; color: var(--strong) }
.home-invite p { margin: 0; font-size: 13px }
@media (max-width: 700px) { .home-invite { flex-wrap: wrap } }
.chip { white-space: nowrap } .chip.add { width: auto; padding: 0 10px; gap: 5px; border-style: dashed; background: transparent }
.pf-dock .btn:hover:not(:disabled), .pf-dock .btn.primary:hover:not(:disabled) { transform: none } .pf-dock .btn:active:not(:disabled) { transform: scale(.98) }

/* ===== FEATURES: voice notes, polls, view-once, threads, embeds, emoji, receipts ===== */
.voice-note { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 8px 12px 8px 8px; width: min(320px, 100%); border-radius: 999px; background: var(--card); border: 1px solid var(--border) }
.vn-play { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--on-accent, #fff) }
.vn-play .ic { fill: currentColor; stroke: none }
.vn-bars { position: relative; flex: 1; height: 26px; cursor: pointer; border-radius: 6px; overflow: hidden;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .22) 0 3px, transparent 3px 6px); mask: linear-gradient(transparent 20%, #000 20% 80%, transparent 80%) }
.vn-bars i { position: absolute; inset: 0 auto 0 0; width: 0; background: repeating-linear-gradient(90deg, var(--accent) 0 3px, transparent 3px 6px) }
.vn-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right }
.mic-rec.on { color: #fff; background: #ef4444; border-radius: 50% }
.rec-info { display: flex; align-items: center; gap: 10px; flex: 1; min-height: 40px; padding: 0 6px }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; animation: rec-pulse 1s ease-in-out infinite }
.rec-time { font-weight: 600; font-variant-numeric: tabular-nums }
@keyframes rec-pulse { 50% { opacity: .3 } }
.poll { margin-top: 6px; padding: 14px; width: min(420px, 100%); border-radius: 14px; background: var(--card); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px }
.poll-q { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--strong) }
.poll-opt { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); overflow: hidden; text-align: left; color: var(--text) }
.poll-opt > i { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--accent) 22%, transparent); transition: width .4s ease }
.poll-opt > * { position: relative }
.poll-opt:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)) }
.poll-opt.mine { border-color: var(--accent) }
.poll-check { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--muted); flex: none }
.poll-opt.mine .poll-check { background: var(--accent); border-color: var(--accent); color: #fff }
.once { display: flex; align-items: center; gap: 12px; margin-top: 6px; padding: 10px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); text-align: left; color: var(--text); width: fit-content; max-width: 100% }
button.once:hover { border-color: #f59e0b }
.once > .ic { color: #f59e0b; flex: none }
.once.used > .ic, .once.mine > .ic { color: var(--muted) }
.once-view img, .once-view video { max-width: 90vw; max-height: 80vh; user-select: none; -webkit-user-drag: none }
.once-note { display: flex; align-items: center; gap: 6px; margin-top: 10px; color: #fff; font-size: 13px; justify-content: center }
.sys-msg { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 10px 0; color: var(--muted); font-size: 12.5px }
.thread-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 4px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent) }
.thread-link:hover { background: color-mix(in srgb, var(--accent) 18%, transparent) }
.thread-panel { position: absolute; top: 64px; right: 10px; bottom: 10px; z-index: 20; width: min(380px, calc(100% - 20px)); display: flex; flex-direction: column; border-radius: 18px; background: var(--bg-2, #111); border: 1px solid var(--border); box-shadow: 0 20px 50px rgba(0, 0, 0, .5); animation: vt-in .25s ease both }
.thread-panel .cp-head { padding: 12px 14px; border-bottom: 1px solid var(--border-soft) }
.th-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px }
.th-msg { display: flex; gap: 10px } .th-msg .text { white-space: pre-wrap; word-break: break-word }
.th-root { padding-bottom: 10px; border-bottom: 1px solid var(--border-soft) }
.th-compose { display: flex; gap: 8px; align-items: flex-end; padding: 10px; border-top: 1px solid var(--border-soft) }
.th-compose textarea { flex: 1; resize: none; min-height: 40px; max-height: 120px }
.embed { display: flex; gap: 12px; margin-top: 6px; padding: 12px 14px; max-width: 460px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--accent); color: var(--text); text-decoration: none }
.embed:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)) }
.em-site { font-size: 12px; color: var(--muted) } .em-title { font-weight: 600; color: var(--accent); margin: 2px 0 } .em-desc { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden }
.em-img { width: 80px; height: 80px; flex: none; object-fit: cover; border-radius: 8px }
.text a.link { color: var(--accent); word-break: break-all } .text a.link:hover { text-decoration: underline }
.cemoji { width: var(--s, 22px); height: var(--s, 22px); object-fit: contain; vertical-align: -5px; display: inline-block }
.emoji-admin { display: flex; flex-direction: column; gap: 4px } .emoji-row { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 10px } .emoji-row:hover { background: rgba(255, 255, 255, .04) }
.receipt { display: flex; align-items: center; justify-content: flex-end; gap: 4px; padding: 0 16px 4px; font-size: 11.5px; color: var(--muted) }
.receipt.seen { color: var(--accent) }
.e2e-badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: #22c55e; background: rgba(34, 197, 94, .12) }
.e2e-badge.off { color: var(--muted); background: rgba(255, 255, 255, .06) }
.e2e-badge.ttl { color: #f59e0b; background: rgba(245, 158, 11, .12) }
.text.locked { display: flex; align-items: center; gap: 4px; font-style: italic }
.cat-toggle { display: flex; align-items: center; gap: 4px; width: 100%; text-align: left; cursor: pointer }
.cat-toggle > .ic { transition: transform .15s } .cat-toggle.shut > .ic { transform: rotate(-90deg) }
.menu-head { padding: 6px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted) }
.devices { display: flex; flex-direction: column; gap: 6px }
.device { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid var(--border) }
.device-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, .06) }
.device .tag { margin-left: 8px }
.totp-key { font-size: 15px; letter-spacing: .08em }
/* Ctrl+K */
.modal.qs-modal { width: min(560px, 92vw); padding: 0; overflow: hidden }
.qs { display: flex; flex-direction: column; max-height: 70vh }
.qs-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border-soft) }
.qs-head input { flex: 1; border: 0 !important; background: transparent !important; box-shadow: none !important; font-size: 16px; padding: 4px 0 }
.qs-list { overflow-y: auto; padding: 8px }
.qs-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px; text-align: left; color: var(--text) }
.qs-row.on { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--strong) }
.qs-row .muted { text-align: right }
.qs-srv { width: 24px; height: 24px; border-radius: 7px; font-size: 10px }
.msg.mine .text a.link { color: inherit; text-decoration: underline; text-underline-offset: 2px }
.poll, .embed, .voice-note, .once, .poll-opt { text-align: left }
.poll-opt > .grow { text-align: left }

/* ===== batch 2 ===== */
.vprev .btn.sm { display: inline-flex; gap: 6px; align-items: center; }
.fwd-label { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); font-style: italic; margin-bottom: 2px; }
.msg.blocked-msg { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; padding: 6px 16px; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
.codes code { padding: 8px 10px; border-radius: 8px; background: var(--bg-3, rgba(255,255,255,.05)); text-align: center; font-size: 14px; letter-spacing: .5px; }
.rules-modal { text-align: center; }
.rules-modal .srv-tile { margin: 0 auto 8px; }
.rules-text { text-align: left; white-space: pre-wrap; max-height: 300px; overflow: auto; padding: 12px; border-radius: 10px; background: var(--bg-3, rgba(255,255,255,.05)); font-size: 14px; line-height: 1.5; }
.composer-box.locked .btn.sm { flex: none; }
.composer-box .mic-rec { align-self: center; width: 34px; height: 34px; flex: none; display: grid; place-items: center; padding: 0; border-radius: 50% }
.composer-box .mic-rec:hover { color: var(--text) }
/* profile card: "More" expands inline under the dock */
.pf-more { display: grid; grid-template-rows: 0fr; opacity: 0; margin-top: -12px; transition: grid-template-rows .28s cubic-bezier(.2, .8, .2, 1), opacity .2s ease, margin-top .28s cubic-bezier(.2, .8, .2, 1) }
.pf-more.open { grid-template-rows: 1fr; opacity: 1; margin-top: 0 }
.pf-more-in { overflow: hidden; min-height: 0; border-radius: 18px; background: var(--glass); border: 1px solid var(--glass-b); padding: 0 6px; transition: padding .28s cubic-bezier(.2, .8, .2, 1) }
.pf-more.open .pf-more-in { padding: 6px }
.pf-tile svg { transition: transform .28s cubic-bezier(.2, .8, .2, 1) }
.pf-tile.open svg { transform: rotate(180deg) }
.pf-tile.open { background: var(--tile-h); color: #fff }
.pf-tile.open:hover::before { display: none }
@media (prefers-reduced-motion: reduce) { .pf-more, .pf-more-in, .pf-tile svg { transition: none } }
/* custom status: speech bubble on the avatar's top-right */
.pf-ring .pf-status { position: absolute; left: 82%; bottom: 92%; margin: 0; z-index: 2; width: max-content; max-width: 150px; padding: 7px 12px; border-radius: 16px 16px 16px 4px;
  background: #fff; color: #111; border: 0; font-size: 12.5px; font-weight: 600; line-height: 1.3; text-align: left; box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; animation: pop .25s cubic-bezier(.2, .8, .2, 1) }

/* ===== chat background, PTT ===== */
.has-chat-bg #main:has(#msgs) { background: linear-gradient(rgba(0, 0, 0, var(--chat-dim)), rgba(0, 0, 0, var(--chat-dim))), var(--chat-bg) center / cover no-repeat }
.bg-picks { display: flex; flex-wrap: wrap; gap: 10px }
.bg-pick { width: 72px; height: 52px; border-radius: 12px; border: 2px solid var(--border); background: var(--b, var(--tile)); display: grid; place-items: center; color: var(--muted); font-size: 12px; transition: border-color .15s, transform .15s }
.bg-pick:hover { transform: translateY(-2px) } .bg-pick.on { border-color: var(--accent) }
.kb-pick { min-width: 90px; font-family: ui-monospace, monospace }

/* ===== activity, timeout, stats, connections ===== */
.pf-activity { padding: 12px 14px; border-radius: 16px; background: var(--tile); border: 1px solid var(--tile-b) }
.pf-act-row { display: flex; align-items: center; gap: 12px; margin-top: 6px }
.pf-act-ic { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--active, rgba(255,255,255,.06)); color: var(--text) }
.pf-activity.spotify .pf-act-ic, .conn-ic.spotify { background: #1db954; color: #000 }
.to-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px }
.ss-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px }
.ss-tile { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 14px; background: var(--tile); border: 1px solid var(--tile-b) }
.ss-tile b { font-size: 24px; color: var(--strong, #fff) }
.ss-bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding: 10px; border-radius: 14px; background: var(--tile); border: 1px solid var(--tile-b) }
.ss-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0 }
.ss-bar i { width: 100%; max-width: 26px; height: var(--h); min-height: 2px; border-radius: 4px 4px 0 0; background: var(--accent); transition: height .3s }
.ss-bar span { height: 14px; white-space: nowrap; font-size: 10px }
.ss-list { display: flex; flex-direction: column; gap: 6px }
.ss-row { display: flex; align-items: center; gap: 6px; font-size: 14px }
.conn-row { display: flex; align-items: center; gap: 12px }
.conn-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--active, rgba(255,255,255,.06)) }
.toggle-row.bare { padding: 0; border: 0; background: none }
@media (max-width: 700px) { .st-tiles { grid-template-columns: repeat(2, 1fr) } .to-grid { grid-template-columns: repeat(2, 1fr) } }

/* ===== badges, deleted ===== */
.pf-tag.badge-tag { color: var(--bc); border-color: color-mix(in srgb, var(--bc) 40%, transparent); background: color-mix(in srgb, var(--bc) 12%, transparent) }
.badge-icons { display: inline-flex; gap: 3px; margin-left: 2px; vertical-align: middle }
.badge-ic { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; color: var(--bc); background: color-mix(in srgb, var(--bc) 14%, transparent) }
.badge-chip { gap: 6px } .badge-chip.on { color: var(--bc); border-color: var(--bc); background: color-mix(in srgb, var(--bc) 14%, transparent) }
.adm-img { display: block; max-width: 260px; max-height: 200px; border-radius: 10px; margin-top: 6px; object-fit: cover }
.settings .back { gap: 6px; height: 34px; padding: 0 14px 0 10px; font-size: 14px; font-weight: 600; border-radius: 10px; transition: background .15s, color .15s }
.settings .back svg { transform: rotate(90deg) }
.settings .back:hover { background: var(--tile-h, var(--active)); color: var(--strong, #fff) }

/* badge icons v2 */
.badge-svg { flex: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)) }
.badge-ic { width: auto; height: auto; background: none; border-radius: 0; transition: transform .15s }
.badge-ic:hover { transform: translateY(-1px) scale(1.12) }
.pf-tag.badge-tag { gap: 5px; padding-left: 4px }
.badge-chip:not(.on) .badge-svg { filter: grayscale(1) opacity(.6) }
/* message toolbar sits on the right, away from the name and badges */
.msg-tools { left: auto; right: 12px }
.msg.mine .msg-tools { right: auto; left: 12px }
/* instant badge tooltip */
.badge-ic { position: relative; cursor: default }
.badge-ic::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translate(-50%, 4px); white-space: nowrap; pointer-events: none;
  padding: 5px 9px; border-radius: 8px; background: #000; color: #fff; font-size: 12px; font-weight: 600; box-shadow: 0 6px 18px rgba(0, 0, 0, .5); opacity: 0; transition: opacity .12s, transform .12s; z-index: 30 }
.badge-ic:hover::after { opacity: 1; transform: translate(-50%, 0) }
.badge-ic:hover { transform: none }
.badge-ic:hover .badge-svg { transform: scale(1.12) } .badge-svg { transition: transform .15s }
[data-theme="light"] .badge-ic::after { background: #fff; color: #000 }
/* admin badge tag: gradient border + gradient text */
.msg-head .badge-icons { align-self: center; position: relative; top: 1px; margin: 0 2px; line-height: 0 }
.pf-tag.badge-tag.b-admin { color: #fff; border-color: rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .06); font-weight: 700 }
[data-theme="light"] .pf-tag.badge-tag.b-admin { color: #111; border-color: rgba(0, 0, 0, .12); background: rgba(0, 0, 0, .04) }

/* ===== reports, site banner ===== */
.report-why { margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: color-mix(in srgb, #ef4444 10%, transparent); font-size: 13px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap }
.adm-msg.report.done { opacity: .55 }
.site-banner { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; align-items: center; gap: 10px; max-width: min(720px, calc(100vw - 24px));
  padding: 10px 10px 10px 16px; border-radius: 14px; font-size: 14px; font-weight: 600; color: #fff; background: #1f2937; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 14px 40px rgba(0,0,0,.5); animation: pop .25s ease-out }
.site-banner.info { background: color-mix(in srgb, var(--accent) 85%, #000) }
.site-banner.warn { background: #b45309 } .site-banner.ok { background: #15803d }
.site-banner .icon-btn { color: #fff }

/* ===== translate ===== */
.translated { margin-top: 4px; padding: 6px 10px; border-left: 2px solid var(--accent); border-radius: 0 8px 8px 0; background: color-mix(in srgb, var(--accent) 8%, transparent); font-size: 14px; white-space: pre-wrap }
.tr-label { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); margin-bottom: 2px }
.gif-hint { align-self: center }
.fx-picks { flex-wrap: wrap }

/* ===== profile effects: avatar frames ===== */
@property --fxa { syntax: '<angle>'; inherits: false; initial-value: 0deg }
@keyframes fx-spin { to { --fxa: 360deg } }
@keyframes fx-rot { to { transform: rotate(360deg) } }
@keyframes fx-pulse { 50% { box-shadow: 0 0 0 5px #0c0c0f, 0 0 34px 8px color-mix(in srgb, var(--pc, #5562f0) 80%, transparent) } }
@keyframes fx-flick { 0%, 100% { opacity: .85; transform: scale(1) } 50% { opacity: 1; transform: scale(1.04) } }
@keyframes fx-twinkle { 0%, 100% { opacity: .25 } 50% { opacity: 1 } }
.pf-ring.fx-glow { animation: fx-pulse 2.4s ease-in-out infinite }
.pf-ring.fx-neon { background: conic-gradient(from var(--fxa), #00f0ff, #7c3aed, #ff2bd6, #00f0ff); animation: fx-spin 3s linear infinite; box-shadow: 0 0 0 5px #0c0c0f, 0 0 24px #7c3aed, 0 0 46px rgba(0, 240, 255, .35) }
.pf-ring.fx-fire { background: conic-gradient(from var(--fxa), #ff3d00, #ffb300, #ff6d00, #ff1744, #ff3d00); animation: fx-spin 2.2s linear infinite }
.pf-ring.fx-fire::before { content: ''; position: absolute; inset: -8px; border-radius: 50%; background: radial-gradient(circle, transparent 58%, rgba(255, 120, 0, .55) 66%, transparent 74%); filter: blur(4px); animation: fx-flick .9s ease-in-out infinite; pointer-events: none }
.pf-ring.fx-sparkle::before { content: ''; position: absolute; inset: -14px; border-radius: 50%; pointer-events: none; animation: fx-rot 9s linear infinite, fx-twinkle 1.6s ease-in-out infinite;
  background: radial-gradient(circle at 50% 2%, #fff 0 2px, transparent 3px), radial-gradient(circle at 95% 40%, #ffe9a3 0 1.5px, transparent 2.5px), radial-gradient(circle at 80% 92%, #fff 0 2px, transparent 3px),
    radial-gradient(circle at 12% 80%, #ffe9a3 0 1.5px, transparent 2.5px), radial-gradient(circle at 4% 30%, #fff 0 1.5px, transparent 2.5px) }
.pf-ring.fx-orbit::before { content: ''; position: absolute; inset: -12px; border-radius: 50%; border: 1px dashed rgba(255, 255, 255, .18); pointer-events: none }
.pf-ring.fx-orbit::after { content: ''; position: absolute; inset: -12px; border-radius: 50%; pointer-events: none; animation: fx-rot 4s linear infinite;
  background: radial-gradient(circle at 50% 0, #fff 0 4px, color-mix(in srgb, var(--pc, #5562f0) 80%, transparent) 5px 7px, transparent 8px) }

/* ===== profile effects: animated card backgrounds ===== */
@keyframes fx-drift { 0% { transform: translate(-10%, -6%) rotate(0deg) } 50% { transform: translate(8%, 6%) rotate(180deg) } 100% { transform: translate(-10%, -6%) rotate(360deg) } }
@keyframes fx-fall { to { background-position: 0 300px, 40px 300px, 80px 300px } }
@keyframes fx-wave { to { background-position: 400px 0, -400px 0 } }
.pf[class*="card-"]::before { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0 }
.pf[class*="card-"] > * { position: relative; z-index: 1 }
.pf[class*="card-"] > .pf-x { position: absolute; z-index: 3 }
.pf.card-aurora::before { inset: -40%; background: radial-gradient(closest-side at 30% 40%, rgba(124, 58, 237, .45), transparent), radial-gradient(closest-side at 70% 60%, rgba(16, 185, 129, .35), transparent), radial-gradient(closest-side at 50% 80%, rgba(14, 165, 233, .3), transparent); filter: blur(30px); animation: fx-drift 18s ease-in-out infinite }
.pf.card-stars::before { background-image: radial-gradient(1.5px 1.5px at 20px 30px, #fff, transparent), radial-gradient(1px 1px at 120px 80px, #fff, transparent), radial-gradient(1.5px 1.5px at 200px 150px, #fff, transparent), radial-gradient(1px 1px at 60px 200px, #fff, transparent), radial-gradient(1.2px 1.2px at 260px 40px, #fff, transparent); background-size: 300px 260px; animation: fx-twinkle 3s ease-in-out infinite }
.pf.card-snow::before { background-image: radial-gradient(2px 2px at 20px 20px, rgba(255, 255, 255, .9), transparent), radial-gradient(1.5px 1.5px at 60px 90px, rgba(255, 255, 255, .7), transparent), radial-gradient(2.5px 2.5px at 110px 50px, rgba(255, 255, 255, .8), transparent); background-size: 140px 300px, 160px 300px, 180px 300px; animation: fx-fall 9s linear infinite }
.pf.card-waves::before { top: auto; height: 55%; opacity: .5; background-image: radial-gradient(120px 40px at 50% 100%, color-mix(in srgb, var(--accent) 70%, transparent), transparent), radial-gradient(160px 50px at 50% 100%, rgba(14, 165, 233, .5), transparent); background-size: 400px 100%, 400px 100%; background-repeat: repeat-x; animation: fx-wave 12s linear infinite }
@media (prefers-reduced-motion: reduce) { .pf-ring[class*="fx-"], .pf-ring[class*="fx-"]::before, .pf-ring[class*="fx-"]::after, .pf[class*="card-"]::before { animation: none } }
.reduce-motion .pf-ring[class*="fx-"], .reduce-motion .pf-ring[class*="fx-"]::before, .reduce-motion .pf-ring[class*="fx-"]::after, .reduce-motion .pf[class*="card-"]::before { animation: none }

/* ===== stage ===== */
.stage-wrap { position: relative }
.stage-mini { position: absolute; top: 6px; right: 6px; z-index: 2; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: rgba(0, 0, 0, .6); color: #fff; opacity: 0; transition: opacity .15s }
.stage-wrap:hover .stage-mini, .stage-mini:focus-visible { opacity: 1 }
.stage-aud { padding: 6px 4px 0 }
.stage-people { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px }
.stage-person { position: relative; width: 64px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center }
.stage-person .tiny { max-width: 64px }
.stage-person.hand .avatar { box-shadow: 0 0 0 2px #f5b301 }
.hand-ic { position: absolute; top: -4px; right: 6px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: #f5b301; color: #000 }
.stage-person .stage-mini { top: -4px; right: 2px }
/* ===== watch together ===== */
.watch { margin: 10px 10px 0; border-radius: 16px; overflow: hidden; background: #000; border: 1px solid var(--border) }
.watch-frame { position: relative; aspect-ratio: 16 / 9; max-height: 52vh; margin: 0 auto }
.watch-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none }
.watch-bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: var(--card) }
.watch-bar input[type=range] { width: 90px }
.role-move { display: inline-flex; gap: 2px; margin-left: 4px; opacity: 0; transition: opacity .15s }
.role-item:hover .role-move, .role-item.active .role-move { opacity: 1 }
.role-mv { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; color: var(--muted) }
.role-mv:hover { background: var(--tile-h, rgba(255,255,255,.08)); color: var(--text) }
.role-mv.off { opacity: .25; pointer-events: none }
.role-hint { margin: 6px 2px 0 }
/* Administrator tag v3: soft gradient pill, no border */
.pf-tag.badge-tag.b-admin { color: #fff; border: 0; background: linear-gradient(120deg, rgba(255, 90, 110, .28), rgba(192, 59, 240, .28) 55%, rgba(91, 43, 245, .32)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); padding: 4px 10px 4px 5px; font-weight: 700 }
[data-theme="light"] .pf-tag.badge-tag.b-admin { color: #3b0764; background: linear-gradient(120deg, rgba(255, 90, 110, .18), rgba(192, 59, 240, .18) 55%, rgba(91, 43, 245, .2)) }

.srv-stats { display: flex; flex-direction: column; gap: 12px; width: 100% }
.srv-stats h3 { margin: 8px 0 0 }
.srv-stats .so-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px }
.ss-bars { width: 100%; box-sizing: border-box }
/* badges: plain tag like the others, only the icon is colored */
.pf-tag.badge-tag, .pf-tag.badge-tag.b-admin, [data-theme="light"] .pf-tag.badge-tag.b-admin { color: var(--text); background: var(--tile); border: 1px solid var(--tile-b); box-shadow: none; padding: 4px 10px 4px 6px; font-weight: 600 }

/* ===== download page ===== */
.dl { text-align: center }
.dl-logo { width: 64px; height: 64px; margin: 0 auto 6px; display: block }
.dl-list { display: flex; flex-direction: column; gap: 8px; margin: 16px 0 10px; text-align: left }
.dl-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--tile); border: 1px solid var(--tile-b) }
.dl-card.mine { border-color: color-mix(in srgb, var(--accent) 60%, transparent) }
.dl-card .strong { display: flex; align-items: center; gap: 8px }
.dl-ic { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--active, rgba(255,255,255,.06)); color: var(--text) }
.dl-card .btn { display: inline-flex; gap: 6px; align-items: center; text-decoration: none }

.dl-modal .modal-body { text-align: center }

.pf-act-ic.art { position: relative; display: block; width: 64px; height: 64px; padding: 0; background: none; border-radius: 50% }
.pf-act-ic.art img { display: block; width: 64px; height: 64px; aspect-ratio: 1; object-fit: cover; border-radius: 50%; box-shadow: 0 0 0 2px rgba(29,185,84,.55), 0 4px 14px rgba(0,0,0,.35) }
.pf-act-dot { position: absolute; right: -3px; bottom: -3px; box-sizing: border-box; width: 24px; height: 24px; min-width: 24px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: #1db954; color: #000; border: 3px solid var(--tile-solid, #17171c); box-shadow: 0 2px 6px rgba(0,0,0,.4); font-style: normal; line-height: 0 }
.pf-act-dot svg { display: block; stroke-width: 2.6 }
.pf-act-artist { color: var(--muted) }

.dl-app { position: relative; width: 96px; height: 96px; margin: 4px auto 4px; animation: dl-pop .5s cubic-bezier(.2,1.4,.4,1) both }
.dl-app img { width: 96px; height: 96px; border-radius: 26px; box-shadow: 0 12px 32px color-mix(in srgb, var(--accent) 40%, transparent) }
.dl-arrow { position: absolute; right: -6px; bottom: -6px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: #22c55e; color: #fff; border: 3px solid var(--bg-float, #111); animation: dl-bob 1.2s ease-in-out infinite }
.dl-steps { text-align: left; margin: 4px 0 0; padding-left: 22px; display: grid; gap: 6px; color: var(--text) }
@keyframes dl-pop { from { transform: scale(.6); opacity: 0 } }
@keyframes dl-bob { 50% { transform: translateY(3px) } }
.reduce-motion .dl-app, .reduce-motion .dl-arrow { animation: none }

/* in-app notifications */
#notifs { position: fixed; top: 16px; right: 16px; z-index: 90; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 32px)) }
.notif { position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: 12px; padding: 12px 36px 14px 12px; border-radius: 16px; cursor: pointer;
  background: color-mix(in srgb, var(--bg-float) 88%, transparent); backdrop-filter: blur(18px) saturate(1.4); border: 1px solid var(--border, rgba(255,255,255,.08));
  box-shadow: 0 16px 40px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.04); color: var(--text); animation: notif-in .32s cubic-bezier(.2,1.2,.4,1) both; transition: opacity .25s, transform .25s }
.notif:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent) }
.notif:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.notif.out { opacity: 0; transform: translateX(24px) }
.notif.mention { border-color: color-mix(in srgb, #f0b232 55%, transparent) }
.notif .avatar, .notif-logo { flex: none; width: 40px; height: 40px; border-radius: 50% }
.notif-logo { border-radius: 12px }
.notif-body { min-width: 0; flex: 1 }
.notif-head { display: flex; align-items: baseline; gap: 6px; min-width: 0 }
.notif-head b { color: var(--strong, var(--text)); font-size: 14px }
.notif-where { color: var(--muted); font-size: 12px }
.notif-at { margin-left: auto; flex: none; padding: 0 6px; border-radius: 999px; background: #f0b232; color: #000; font-size: 11px; font-weight: 700 }
.notif-text { margin-top: 2px; font-size: 13.5px; color: var(--text); opacity: .85; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word }
.notif-x { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; border: 0; background: none; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .15s }
.notif:hover .notif-x, .notif:focus-within .notif-x { opacity: 1 }
.notif-x:hover { background: var(--tile, rgba(255,255,255,.06)); color: var(--text) }
.notif-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--accent); transform-origin: left; animation: notif-bar 6s linear both }
.notif:hover .notif-bar { animation-play-state: paused }
@keyframes notif-in { from { opacity: 0; transform: translateX(40px) scale(.96) } }
@keyframes notif-bar { to { transform: scaleX(0) } }
.reduce-motion .notif, .reduce-motion .notif-bar { animation: none }
