/* Happer: dark, rounded floating panels, honey accent. */
:root {
  --bg-0: #0b0c10;
  --bg-1: #111318;
  --bg-2: #15171d;
  --bg-3: #1c1f27;
  --bg-4: #252934;
  --bg-5: #313644;
  --line: rgba(255, 255, 255, .06);
  --line-2: rgba(255, 255, 255, .1);
  --text: #eceef3;
  --text-2: #aab0bd;
  --text-3: #6d7380;
  --accent: #ffb224;
  --accent-2: #ff8a3d;
  --accent-ink: #241800;
  --accent-soft: rgba(255, 178, 36, .12);
  --green: #3ddc84;
  --idle: #f5c451;
  --red: #ff4d5e;
  --pink: #ff5c8a;
  --blue: #5aa9ff;
  --shadow: 0 16px 48px rgba(0, 0, 0, .5);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ring: var(--bg-1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg-0); color: var(--text); font: 15px/1.45 var(--font); overflow: hidden; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
#app { height: 100%; }
@supports (height: 100dvh) { #app { height: 100dvh; } }
.mobile-only { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.25; }
p { margin: 0; }
img { display: block; }
::selection { background: rgba(255, 178, 36, .35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--bg-5); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #3c4252; }
::-webkit-scrollbar-track { background: transparent; }

.muted { color: var(--text-3); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.spacer { flex: 1; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; }
.row.gap { gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.pad { padding: 16px; }
.lead { margin: 6px 0 22px; }
.dot { margin: 0 6px; color: var(--text-3); }
.dotc { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin: 0 5px 1px 0; vertical-align: middle; }
.ic { flex: none; }
.ic.muted { color: var(--text-3); }
.link { color: var(--accent); font-weight: 600; }
.link:hover { text-decoration: underline; }
.link-like:hover { text-decoration: underline; }
code.code-inline { background: var(--bg-0); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font: 13px/1.5 ui-monospace, 'Cascadia Code', Consolas, monospace; }

/* ------------------------------------------------------------ boot */
.boot { height: 100%; display: grid; place-content: center; justify-items: center; gap: 22px; }
.boot .logo-mark { animation: bob 1.6s ease-in-out infinite; }
.boot-dots { display: flex; gap: 6px; }
.boot-dots i, .typing-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite; }
.boot-dots i:nth-child(2), .typing-dots i:nth-child(2) { animation-delay: .2s; }
.boot-dots i:nth-child(3), .typing-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ------------------------------------------------------------ buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 10px; padding: 9px 16px; font-weight: 650; font-size: 14px; background: var(--bg-4); color: var(--text); transition: filter .12s, background .12s, transform .06s; white-space: nowrap; text-align: center; }
.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.success { background: var(--green); color: #052712; }
.btn.danger { background: var(--red); color: #fff; }
.btn.ghost { background: var(--bg-4); }
.btn.danger-ghost { background: rgba(255, 77, 94, .12); color: var(--red); }
.btn.danger-ghost:hover:not(:disabled) { background: var(--red); color: #fff; filter: none; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn.lg { padding: 12px 20px; font-size: 15px; }
.btn.block { width: 100%; }
.btn.grow { flex: 1; }

.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: var(--text-2); flex: none; transition: background .12s, color .12s; }
.icon-btn:hover:not(:disabled) { background: var(--bg-4); color: var(--text); }
.icon-btn.on { color: var(--accent); }
.icon-btn.sm { width: 24px; height: 24px; border-radius: 7px; }
.icon-btn.xs { width: 22px; height: 22px; border-radius: 6px; }
.icon-btn.danger:hover { color: var(--red); }
.round-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--bg-1); color: var(--text-2); }
.round-btn:hover { color: var(--text); background: var(--bg-0); }
.round-btn.ok:hover { color: var(--green); }
.round-btn.no:hover { color: var(--red); }

input:not([type=checkbox]):not([type=color]):not([type=file]), textarea, select {
  width: 100%; background: var(--bg-0); border: 1px solid var(--line-2); color: var(--text); border-radius: 10px;
  padding: 10px 12px; font: inherit; font-size: 14.5px; outline: none; transition: border-color .12s, box-shadow .12s;
}
input:focus, textarea:focus, select:focus { border-color: rgba(255, 178, 36, .6); box-shadow: 0 0 0 3px rgba(255, 178, 36, .12); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
textarea { resize: vertical; line-height: 1.45; }
input:disabled, textarea:disabled { opacity: .55; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; min-width: 0; flex: 1; }
.field > span { font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
.field-err { font-size: 13px; color: var(--red); font-weight: 600; }
.hint { font-size: 13px; color: var(--text-3); }
.input-prefix { display: flex; align-items: center; gap: 8px; background: var(--bg-0); border: 1px solid var(--line-2); border-radius: 10px; padding-left: 12px; color: var(--text-3); }
.input-prefix:focus-within { border-color: rgba(255, 178, 36, .6); box-shadow: 0 0 0 3px rgba(255, 178, 36, .12); }
.input-prefix input { border: 0 !important; box-shadow: none !important; padding-left: 0 !important; background: transparent !important; }

.switch { appearance: none; width: 42px; height: 24px; border-radius: 12px; background: var(--bg-5); position: relative; cursor: pointer; flex: none; transition: background .15s; margin: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }
.switch:disabled { opacity: .45; cursor: not-allowed; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.toggle-row > span { display: flex; flex-direction: column; gap: 2px; }
.toggle-row b { font-weight: 650; display: inline-flex; align-items: center; gap: 6px; }
.toggle-row small { color: var(--text-3); font-size: 13px; }

.search-box { display: flex; align-items: center; gap: 8px; background: var(--bg-0); border: 1px solid var(--line-2); border-radius: 10px; padding: 0 12px; color: var(--text-3); margin-bottom: 14px; }
.search-box input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 9px 0 !important; }
.search-box:focus-within { border-color: rgba(255, 178, 36, .5); }

.alert { display: flex; gap: 12px; align-items: flex-start; background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; font-size: 14px; }
.alert > div { display: flex; flex-direction: column; gap: 2px; }
.alert.danger { background: rgba(255, 77, 94, .1); border-color: rgba(255, 77, 94, .35); color: #ffc3c9; }
.alert.danger .ic { color: var(--red); }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 750; letter-spacing: .03em; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; background: var(--bg-4); color: var(--text-2); white-space: nowrap; }
.pill.ok { background: rgba(61, 220, 132, .14); color: var(--green); }
.pill.gold { background: var(--accent-soft); color: var(--accent); }
.pill.bad { background: rgba(255, 77, 94, .14); color: var(--red); }
.pill.warn { background: rgba(245, 196, 81, .14); color: var(--idle); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: var(--bg-3); border: 1px solid var(--line-2); font-weight: 600; font-size: 13.5px; }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.count-badge { position: absolute; right: -4px; bottom: -4px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--red); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 3px var(--bg-0); }
.count-badge.inline { position: static; box-shadow: none; margin-left: auto; min-width: 18px; height: 18px; font-size: 11px; }

/* ------------------------------------------------------------ avatars, status, badges */
.avatar { position: relative; width: var(--size); height: var(--size); flex: none; display: inline-block; }
.avatar > img, .avatar > .avatar-fallback, .avatar > .logo-mark { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar > .logo-mark { border-radius: 30%; }
.avatar > .avatar-fallback { display: grid; place-items: center; color: #fff; font-weight: 800; font-size: calc(var(--size) * .36); letter-spacing: .02em; user-select: none; }
.status-dot { position: absolute; right: -1px; bottom: -1px; width: max(10px, calc(var(--size) * .3)); height: max(10px, calc(var(--size) * .3)); border-radius: 50%; box-shadow: 0 0 0 max(2.5px, calc(var(--size) * .06)) var(--ring); }
.s-online { background: var(--green); }
.s-idle { background: radial-gradient(circle at 26% 26%, var(--ring) 0 34%, var(--idle) 35%); }
.s-dnd { background: linear-gradient(var(--ring), var(--ring)) center / 56% 24% no-repeat, var(--red); }
.s-offline, .s-invisible { background: radial-gradient(circle, var(--ring) 0 36%, var(--text-3) 37%); }

.badge-icon { display: inline-grid; place-items: center; width: var(--bs); height: var(--bs); color: var(--bc); flex: none; vertical-align: middle; }
.badge-emoji { font-size: calc(var(--bs) * .8); line-height: 1; filter: drop-shadow(0 0 4px color-mix(in srgb, var(--bc) 60%, transparent)); }
.tag-system { display: inline-flex; align-items: center; gap: 2px; font-size: 10px; font-weight: 800; letter-spacing: .04em; padding: 1px 5px; border-radius: 5px; background: var(--accent); color: var(--accent-ink); vertical-align: middle; margin-left: 4px; }

.server-icon { width: var(--size); height: var(--size); border-radius: calc(var(--size) * .32); object-fit: cover; flex: none; display: grid; place-items: center; overflow: hidden; }
.server-icon.fallback { color: #fff; font-weight: 800; font-size: calc(var(--size) * .34); }
.server-icon.hq { background: linear-gradient(140deg, #2a2112, #1a1b22); color: var(--accent); font-weight: 900; font-size: calc(var(--size) * .3); letter-spacing: .02em; box-shadow: inset 0 0 0 1.5px rgba(255, 178, 36, .45); }

/* ------------------------------------------------------------ shell layout */
.shell { display: flex; height: 100%; }
.panels { flex: 1; min-width: 0; display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 8px; padding: 8px 8px 8px 0; }
.panels.has-side { grid-template-columns: 252px minmax(0, 1fr) 264px; }
.sidebar, .main, .members { background: var(--bg-1); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.main { background: var(--bg-2); --ring: var(--bg-2); position: relative; }
.conn-banner { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); background: var(--idle); color: #2a1d00; font-weight: 700; font-size: 13px; padding: 6px 14px; border-radius: 99px; display: flex; gap: 6px; align-items: center; z-index: 90; box-shadow: var(--shadow); }

/* rail */
.rail { width: 72px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; --ring: var(--bg-0); }
.rail-servers { display: flex; flex-direction: column; align-items: center; gap: 8px; overflow-y: auto; overflow-x: hidden; width: 100%; padding: 0 0 12px; scrollbar-width: none; }
.rail-servers::-webkit-scrollbar { display: none; }
.rail-item { position: relative; width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; flex: none; transition: transform .12s; }
.rail-item .server-icon, .rail-item > .logo-mark { width: 48px; height: 48px; border-radius: 16px; transition: border-radius .15s, box-shadow .15s; }
.rail-item:hover .server-icon, .rail-item:hover > .logo-mark { border-radius: 13px; }
.rail-item.active .server-icon, .rail-item.active > .logo-mark { box-shadow: 0 0 0 2px var(--bg-0), 0 0 0 4px var(--accent); border-radius: 13px; }
.rail-pill { position: absolute; left: -12px; top: 50%; width: 4px; height: 0; border-radius: 0 4px 4px 0; background: var(--text); transform: translateY(-50%); transition: height .15s; }
.rail-item.unread .rail-pill { height: 8px; }
.rail-item:hover .rail-pill { height: 18px; }
.rail-item.active .rail-pill { height: 36px; background: var(--accent); }
.rail-item.add { background: var(--bg-2); color: var(--green); border: 1px dashed var(--line-2); }
.rail-item.add:hover { background: var(--green); color: #052712; border-color: transparent; border-radius: 13px; }
.rail-item.dm .avatar img, .rail-item.dm .avatar-fallback { border-radius: 50%; }
.rail-sep { width: 32px; height: 2px; border-radius: 2px; background: var(--line-2); flex: none; }

/* sidebar */
.sidebar-head { display: flex; align-items: center; gap: 8px; height: 54px; padding: 0 14px 0 16px; border-bottom: 1px solid var(--line); flex: none; font-weight: 750; font-size: 15.5px; width: 100%; }
button.sidebar-head:hover { background: rgba(255, 255, 255, .03); }
.sidebar-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.sidebar-head.search { padding: 0 10px; }
.hq-pill { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); flex: none; }
.fake-search { width: 100%; background: var(--bg-0); border-radius: 9px; padding: 8px 10px; font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 8px; font-weight: 500; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 10px 8px 16px; }
.server-blurb { margin: 2px 6px 10px; padding: 10px 12px; border-radius: 12px; background: linear-gradient(135deg, rgba(255, 178, 36, .14), rgba(255, 106, 61, .08)); border: 1px solid rgba(255, 178, 36, .18); font-size: 13px; color: var(--text-2); }
.cat { margin-top: 12px; }
.cat:first-child { margin-top: 2px; }
.cat-head { display: flex; align-items: center; padding: 0 4px 4px 2px; }
.cat-toggle { display: flex; align-items: center; gap: 3px; flex: 1; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 4px 0; }
.cat-toggle:hover { color: var(--text-2); }
.cat-add { color: var(--text-3); display: grid; place-items: center; }
.cat-add:hover { color: var(--text); }
.chan, .nav-item { position: relative; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; color: var(--text-3); font-weight: 550; margin: 1px 0; text-decoration: none !important; }
.chan:hover, .nav-item:hover { background: var(--bg-3); color: var(--text-2); }
.chan.active, .nav-item.active { background: var(--bg-4); color: var(--text); }
.chan.unread { color: var(--text); font-weight: 700; }
.chan.unread::before { content: ''; position: absolute; left: -8px; top: 50%; width: 4px; height: 8px; border-radius: 0 4px 4px 0; background: var(--text); transform: translateY(-50%); }
.chan-icon { display: grid; place-items: center; opacity: .8; }
.chan-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.chan-gear { display: none; color: var(--text-3); padding: 2px; }
.chan-gear:hover { color: var(--text); }
.chan:hover .chan-gear, .chan.active .chan-gear { display: grid; }
.nav-item { font-size: 15px; padding: 9px 10px; gap: 12px; }
.section-label { display: flex; align-items: center; justify-content: space-between; padding: 16px 6px 6px 10px; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.dm-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; color: var(--text-3); margin: 1px 0; text-decoration: none !important; }
.dm-item:hover { background: var(--bg-3); color: var(--text-2); --ring: var(--bg-3); }
.dm-item.active { background: var(--bg-4); color: var(--text); --ring: var(--bg-4); }
.dm-item.unread b { color: var(--text); }
.dm-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dm-text b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-text small { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); }
.empty-note { padding: 12px 10px; color: var(--text-3); font-size: 13px; }

.user-panel { flex: none; display: flex; align-items: center; gap: 4px; padding: 8px; margin: 0 8px 8px; background: var(--bg-0); border-radius: 14px; --ring: var(--bg-0); }
.user-chip { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 4px 6px; border-radius: 10px; }
.user-chip:hover { background: var(--bg-3); --ring: var(--bg-3); }
.user-chip-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.user-chip-text b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-text small { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------ chat */
.chat-head { flex: none; height: 54px; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 18px; border-bottom: 1px solid var(--line); min-width: 0; }
.chat-icon { color: var(--text-3); display: grid; }
.chat-title { font-weight: 750; font-size: 16px; white-space: nowrap; }
.chat-topic { color: var(--text-3); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 12px; border-left: 1px solid var(--line-2); min-width: 0; }
.head-sep { width: 1px; height: 22px; background: var(--line-2); margin: 0 4px; }
.tabs { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.tab { padding: 5px 12px; border-radius: 8px; color: var(--text-2); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.tab:hover { background: var(--bg-3); color: var(--text); }
.tab.active { background: var(--bg-4); color: var(--text); }
.tab.add { background: var(--accent); color: var(--accent-ink); }
.tab.add.active { background: transparent; color: var(--accent); }

.chat-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.messages { flex: 1; overflow-y: auto; overflow-x: hidden; overflow-anchor: none; }
.messages-inner { min-height: 100%; display: flex; flex-direction: column; justify-content: flex-end; padding: 12px 0 10px; }
.load-older { text-align: center; padding: 14px; color: var(--text-3); font-size: 13px; }
.intro { padding: 24px 20px 8px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.intro h1 { font-size: 30px; font-weight: 800; letter-spacing: -.01em; }
.intro p { color: var(--text-2); }
.intro-icon { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-4); color: var(--text); }
.day-div { display: flex; align-items: center; gap: 10px; margin: 18px 20px 4px; color: var(--text-3); font-size: 12px; font-weight: 700; }
.day-div::before, .day-div::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }

.msg { position: relative; padding: 3px 20px 3px 18px; margin-top: 14px; }
.msg.grouped { margin-top: 0; padding-top: 1px; padding-bottom: 1px; }
.msg:hover { background: rgba(255, 255, 255, .025); }
.msg.mentioned { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.msg.mentioned:hover { background: rgba(255, 178, 36, .16); }
.msg.editing { background: rgba(255, 255, 255, .03); }
.msg.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { background: rgba(255, 178, 36, .22); } 100% { background: transparent; } }
.msg-row { display: flex; gap: 14px; }
.msg-gutter { width: 40px; flex: none; display: flex; justify-content: flex-end; }
.msg-avatar { height: 40px; margin-top: 2px; border-radius: 50%; }
.msg-avatar:active { transform: translateY(1px); }
.msg-side-time { font-size: 11px; color: var(--text-3); opacity: 0; padding-top: 4px; white-space: nowrap; }
.msg:hover .msg-side-time { opacity: 1; }
.msg-main { flex: 1; min-width: 0; }
.msg-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; line-height: 1.35; }
.msg-author { font-weight: 700; color: var(--text); }
.msg-author:hover { text-decoration: underline; }
.msg-head time { font-size: 12px; color: var(--text-3); font-weight: 500; margin-left: 2px; }
.msg-content { color: #dfe2ea; word-wrap: break-word; overflow-wrap: anywhere; white-space: normal; }
.msg-content.jumbo { font-size: 44px; line-height: 1.2; }
.msg-content strong { font-weight: 750; color: var(--text); }
.msg-content .quote, .pcard-bio .quote { display: block; border-left: 4px solid var(--bg-5); padding-left: 10px; margin: 2px 0; }
.msg-content .quote + br { display: none; }
.code-block { background: var(--bg-0); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 6px 0; overflow-x: auto; font: 13px/1.5 ui-monospace, 'Cascadia Code', Consolas, monospace; white-space: pre; }
.spoiler { background: var(--bg-5); color: transparent; border-radius: 4px; padding: 0 3px; cursor: pointer; transition: color .1s, background .1s; }
.spoiler:hover, .spoiler:focus { background: rgba(255, 255, 255, .08); color: inherit; outline: none; }
.mention { background: rgba(255, 178, 36, .16); color: var(--accent); border-radius: 5px; padding: 0 3px; font-weight: 600; cursor: pointer; }
.mention:hover { background: var(--accent); color: var(--accent-ink); }
.edited { font-size: 11px; color: var(--text-3); margin-left: 4px; }
.attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.attachment { border-radius: 12px; overflow: hidden; background: var(--bg-3); max-width: min(420px, 100%); }
.attachment img { max-width: 100%; max-height: 320px; object-fit: contain; }
.reactions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.reaction { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 9px; background: var(--bg-3); border: 1px solid transparent; font-size: 14px; }
.reaction b { font-size: 13px; font-weight: 700; color: var(--text-2); }
.reaction:hover { border-color: var(--line-2); }
.reaction.mine { background: var(--accent-soft); border-color: rgba(255, 178, 36, .5); }
.reaction.mine b { color: var(--accent); }
.reaction.add { color: var(--text-3); opacity: 0; }
.msg:hover .reaction.add { opacity: 1; }
.msg-actions { position: absolute; right: 18px; top: -16px; display: none; background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 10px; padding: 2px; box-shadow: 0 6px 16px rgba(0, 0, 0, .3); z-index: 2; }
.msg:hover .msg-actions { display: flex; }
.msg-actions button { width: 32px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: var(--text-2); }
.msg-actions button:hover { background: var(--bg-4); color: var(--text); }
.msg-actions button.danger:hover { color: var(--red); }
.reply-ref { display: flex; align-items: center; gap: 6px; margin: 0 0 3px 30px; font-size: 13px; color: var(--text-2); cursor: pointer; min-width: 0; position: relative; }
.reply-ref b { font-weight: 650; white-space: nowrap; }
.reply-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); min-width: 0; }
.reply-text br { display: none; }
.reply-ref:hover .reply-text { color: var(--text); }
.reply-spine { position: absolute; left: -28px; top: 50%; width: 26px; height: 12px; border: 2px solid var(--bg-5); border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.edit-box textarea { background: var(--bg-3) !important; resize: none; margin: 4px 0; }
.edit-box small { font-size: 12px; }

.invite-embed { margin-top: 8px; background: var(--bg-1); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; max-width: 430px; }
.invite-embed > small { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.invite-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.invite-row > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.invite-row b { font-size: 16px; }
.invite-row small { color: var(--text-3); font-size: 13px; }

.skeleton { padding: 20px; display: flex; flex-direction: column; gap: 22px; }
.sk-row { display: flex; gap: 14px; }
.sk-row > div { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.sk-av { width: 40px; height: 40px; border-radius: 50%; background: var(--bg-3); flex: none; }
.sk-line { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--bg-3), var(--bg-4), var(--bg-3)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* composer */
.composer-wrap { flex: none; padding: 0 16px 4px; position: relative; }
.composer { background: var(--bg-3); border: 1px solid var(--line); border-radius: 16px; position: relative; }
.composer:focus-within { border-color: var(--line-2); }
.composer.locked { display: flex; align-items: center; gap: 8px; padding: 14px 16px; color: var(--text-3); font-size: 14px; }
.composer-row { display: flex; align-items: flex-end; gap: 2px; padding: 5px 6px; }
.composer-row .icon-btn { width: 38px; height: 38px; }
#composer { flex: 1; resize: none; background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 9px 6px !important; max-height: 40vh; line-height: 1.4; font-size: 15px; }
.composer.as-happer { border-color: rgba(255, 178, 36, .55); box-shadow: 0 0 0 3px rgba(255, 178, 36, .1); }
.composer-as { display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 14px; font-size: 13px; color: var(--text-2); border-bottom: 1px solid rgba(255, 178, 36, .2); background: linear-gradient(90deg, rgba(255, 178, 36, .1), transparent); border-radius: 15px 15px 0 0; }
.composer-as b { color: var(--accent); }
.composer-as .tag-system { margin-left: 0; }
.composer-as .link { margin-left: auto; font-size: 12.5px; }
.as-happer-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; flex: none; opacity: .45; filter: grayscale(1); transition: opacity .12s, filter .12s, background .12s; }
.as-happer-btn:hover { opacity: .9; filter: none; background: var(--bg-4); }
.as-happer-btn.on { opacity: 1; filter: none; background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px rgba(255, 178, 36, .55); }
.composer-reply { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 8px 14px; font-size: 13px; color: var(--text-2); border-bottom: 1px solid var(--line); }
.pending-files { display: flex; gap: 10px; padding: 12px 12px 4px; overflow-x: auto; }
.pending-file { position: relative; width: 150px; flex: none; background: var(--bg-1); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.pending-file img { width: 100%; height: 100px; object-fit: cover; border-radius: 8px; }
.pending-file small { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pending-file .icon-btn { position: absolute; top: 4px; right: 4px; background: var(--bg-3); }
.pending-file.uploading img { opacity: .45; }
.pending-file.failed small { color: var(--red); }
.typing { height: 22px; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); padding: 0 6px; }
.typing b { font-weight: 700; color: var(--text); }
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots i { width: 5px; height: 5px; background: var(--text-2); }
.mention-pop { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 14px; padding: 8px; box-shadow: var(--shadow); z-index: 5; animation: pop .1s ease; }
.mention-pop > small { display: block; padding: 2px 8px 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.mention-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border-radius: 8px; }
.mention-item small { color: var(--text-3); }
.mention-item.sel, .mention-item:hover { background: var(--bg-4); }

/* ------------------------------------------------------------ member list & DM panel */
.members { overflow-y: auto; padding: 8px 8px 16px; display: block; }
.mem-group h4 { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 16px 8px 6px; }
.member { display: flex; align-items: center; gap: 10px; width: 100%; padding: 5px 8px; border-radius: 10px; }
.member:hover { background: var(--bg-3); --ring: var(--bg-3); }
.member.offline { opacity: .42; }
.member.offline:hover { opacity: 1; }
.mem-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.mem-name { display: flex; align-items: center; gap: 4px; font-weight: 650; font-size: 14.5px; min-width: 0; }
.mem-text small { font-size: 12px; color: var(--text-3); }
.mem-text small b { font-weight: 700; color: var(--text-2); }
.owner-crown { color: var(--accent); display: grid; }
.dm-panel { padding: 0; }
.dm-panel .pcard { border-radius: 0; }
.panel-block { padding: 12px 16px; border-top: 1px solid var(--line); }
.panel-block h4 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); margin-bottom: 8px; }
.mutual-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; border-radius: 10px; font-weight: 600; }
.mutual-row:hover { background: var(--bg-3); }

/* ------------------------------------------------------------ friends */
.friends-layout { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 330px; min-height: 0; }
.friends-main { overflow-y: auto; padding: 18px 22px; }
.list-label { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 4px 0 8px; }
.friend-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-top: 1px solid var(--line); border-radius: 12px; }
.friend-row:hover { background: var(--bg-3); border-top-color: transparent; --ring: var(--bg-3); }
.friend-row:hover + .friend-row { border-top-color: transparent; }
.friend-who { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.friend-who > span { display: flex; flex-direction: column; min-width: 0; }
.friend-who b { font-weight: 700; }
.friend-who .uname { display: none; font-size: 13px; }
.friend-row:hover .uname { display: inline; }
.friend-who small { color: var(--text-3); font-size: 13px; }
.friend-actions { display: flex; gap: 8px; }
.add-friend h3 { font-size: 18px; margin-bottom: 4px; }
.add-friend-form { display: flex; gap: 10px; margin: 16px 0 28px; background: var(--bg-0); border: 1px solid var(--line-2); border-radius: 14px; padding: 6px 6px 6px 14px; }
.add-friend-form:focus-within { border-color: rgba(255, 178, 36, .6); }
.add-friend-form input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 8px 0 !important; }
.add-friend-art { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 30px; }
.active-now { border-left: 1px solid var(--line); padding: 18px 16px; overflow-y: auto; }
.active-now h3 { font-size: 19px; font-weight: 800; margin-bottom: 14px; }
.quiet { background: var(--bg-3); border-radius: 14px; padding: 18px; text-align: center; }
.quiet b { display: block; margin-bottom: 6px; }
.quiet p { color: var(--text-2); font-size: 13.5px; }
.active-card { background: var(--bg-3); border-radius: 14px; padding: 12px; margin-bottom: 10px; --ring: var(--bg-3); }
.active-who { display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 8px; }
.active-who > span { display: flex; flex-direction: column; min-width: 0; }
.active-who small { color: var(--text-3); font-size: 12px; }
.active-card .act-card { background: var(--bg-1); }
.empty-state { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; color: var(--text-2); padding: 40px; }
.empty-state.small { padding: 40px 10px; }
.empty-state h3 { color: var(--text); }

/* ------------------------------------------------------------ activity cards */
.act-card { background: var(--bg-2); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.act-label { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); margin-bottom: 8px; }
.act-body { display: flex; gap: 12px; align-items: center; }
.act-art { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; background: var(--bg-4); display: grid; place-items: center; color: var(--text-3); }
.act-art.wide { width: 96px; height: 36px; border-radius: 6px; }
.act-card.compact .act-art { width: 48px; height: 48px; }
.act-card.compact .act-art.wide { width: 84px; height: 32px; }
.act-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.act-title { font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-sub { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-sub.muted { color: var(--text-3); }
.act-progress { display: flex; align-items: center; gap: 8px; margin-top: 10px; font: 11.5px/1 ui-monospace, Consolas, monospace; color: var(--text-2); }
.act-progress .bar { flex: 1; height: 4px; border-radius: 4px; background: var(--bg-5); overflow: hidden; }
.act-progress .bar i { display: block; height: 100%; background: var(--text); border-radius: 4px; transition: width 1s linear; }
.act-card.spotify .act-progress .bar i { background: #1ed760; }

/* ------------------------------------------------------------ profile card */
.pcard { --card-bg: var(--bg-3); --ring: var(--card-bg); background: var(--card-bg); border-radius: 18px; overflow: hidden; position: relative; width: 100%; }
.pcard.themed { --card-bg: color-mix(in srgb, var(--tp) 22%, #101116); background: linear-gradient(165deg, color-mix(in srgb, var(--tp) 70%, #0d0e12), color-mix(in srgb, var(--ta) 70%, #0d0e12)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.pcard-banner { height: 110px; position: relative; overflow: hidden; }
.pcard-banner img { width: 100%; height: 100%; object-fit: cover; }
.pcard-banner.draggable { cursor: grab; }
.pcard-banner.draggable:active { cursor: grabbing; }
.drag-hint { position: absolute; right: 8px; top: 8px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 8px; background: rgba(0, 0, 0, .55); color: #fff; pointer-events: none; }
.pcard-head { position: relative; height: 44px; }
.pcard-avatar { position: absolute; left: 14px; top: -46px; border-radius: 50%; }
.pcard-avatar .avatar > img, .pcard-avatar .avatar > .avatar-fallback, .pcard-avatar .avatar > .logo-mark { box-shadow: 0 0 0 6px var(--card-bg); }
.pcard.themed .pcard-avatar .avatar > img, .pcard.themed .pcard-avatar .avatar > .avatar-fallback { box-shadow: 0 0 0 6px rgba(14, 15, 20, .9); }
.pcard.themed { --ring: rgba(14, 15, 20, .95); }
button.pcard-avatar[data-action]:hover::after { content: 'View profile'; position: absolute; inset: 0; border-radius: 50%; background: rgba(0, 0, 0, .5); display: grid; place-items: center; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.status-bubble { position: absolute; left: 108px; top: 6px; right: 12px; width: fit-content; max-width: calc(100% - 120px); background: var(--bg-0); color: var(--text); border-radius: 14px; padding: 7px 12px; font-size: 13px; box-shadow: 0 4px 12px rgba(0, 0, 0, .3); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.status-bubble::before { content: ''; position: absolute; left: -6px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg-0); }
.pcard-body { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.pcard.themed .pcard-body { background: rgba(10, 11, 15, .55); margin: 0 6px 6px; border-radius: 0 0 14px 14px; padding-top: 6px; }
.pcard.themed .pcard-head { margin: 0 6px; background: rgba(10, 11, 15, .55); border-radius: 14px 14px 0 0; }
.pcard-names h2 { font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 4px; overflow-wrap: anywhere; }
.pcard-sub { font-size: 14px; color: var(--text-2); margin-top: 2px; }
.badge-row { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; padding: 4px 6px; background: rgba(0, 0, 0, .25); border-radius: 10px; }
.pcard-banned { display: flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; color: var(--red); background: rgba(255, 77, 94, .1); padding: 6px 10px; border-radius: 10px; }
.pcard section h4, .pm-content section h4 { font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); margin-bottom: 6px; }
.pcard-bio { font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.v-popout .pcard-bio { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.since { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; font-size: 13.5px; color: var(--text-2); }
.since span { display: inline-flex; align-items: center; gap: 6px; }
.role-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.role-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 7px; border-radius: 8px; background: rgba(0, 0, 0, .25); font-size: 12.5px; font-weight: 600; }
.role-chip i, .role-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.conn-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.conn-chip { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: rgba(0, 0, 0, .25); }
.conn-chip:hover { background: rgba(0, 0, 0, .45); }
.pcard-actions { display: flex; gap: 8px; }
.pcard .act-card { background: rgba(0, 0, 0, .25); }
.v-panel .pcard-banner, .v-preview .pcard-banner { height: 120px; }
.v-panel .pcard-head, .v-preview .pcard-head { height: 50px; }
.v-panel .pcard-avatar, .v-preview .pcard-avatar { top: -50px; }
.v-panel .status-bubble, .v-preview .status-bubble { left: 118px; }
.v-full .pcard-banner { height: 150px; }
.v-full .pcard-head { height: 70px; }
.v-full .pcard-avatar { top: -64px; left: 18px; }
.v-full .status-bubble { left: 150px; top: 10px; max-width: calc(100% - 160px); }
.v-full .pcard-names h2 { font-size: 24px; }

.popout { position: fixed; z-index: 60; width: 320px; border-radius: 18px; box-shadow: var(--shadow); animation: pop .12s ease; }

/* ------------------------------------------------------------ menus, pickers, tooltips, toasts, lightbox */
.menu { position: fixed; z-index: 70; min-width: 200px; background: #0f1014; border: 1px solid var(--line-2); border-radius: 12px; padding: 6px; box-shadow: var(--shadow); animation: pop .1s ease; --ring: #0f1014; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; font-size: 14px; font-weight: 550; color: var(--text-2); }
.menu-item:hover { background: var(--bg-4); color: var(--text); --ring: var(--bg-4); }
.menu-item.danger { color: var(--red); }
.menu-item.danger:hover { background: var(--red); color: #fff; }
.menu-item .status-dot { position: static; width: 12px; height: 12px; flex: none; margin: 0 2px; box-shadow: none; }
.menu-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.menu-text small { font-size: 12px; color: var(--text-3); }
.menu-check { color: var(--accent); }
.menu-sep { height: 1px; background: var(--line-2); margin: 5px 6px; }
.picker { position: fixed; z-index: 70; width: 300px; background: #0f1014; border: 1px solid var(--line-2); border-radius: 14px; padding: 8px; box-shadow: var(--shadow); animation: pop .1s ease; }
.picker-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.picker-grid button { font-size: 22px; height: 34px; border-radius: 8px; text-align: center; }
.picker-grid button:hover { background: var(--bg-4); transform: scale(1.1); }
.tooltip { position: fixed; z-index: 100; background: #050608; color: var(--text); font-size: 13px; font-weight: 650; padding: 6px 10px; border-radius: 8px; pointer-events: none; max-width: 280px; box-shadow: 0 6px 18px rgba(0, 0, 0, .4); animation: fade .1s ease; }
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 110; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; background: #050608; border: 1px solid var(--line-2); padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow); animation: pop .15s ease; max-width: min(560px, 90vw); }
.toast .ic { color: var(--green); }
.toast.error .ic { color: var(--red); }
.toast.warn .ic { color: var(--idle); }
.lightbox { position: fixed; inset: 0; z-index: 95; background: rgba(0, 0, 0, .85); display: grid; place-items: center; animation: fade .12s ease; cursor: zoom-out; }
.lightbox img { max-width: 90vw; max-height: 84vh; border-radius: 10px; }
.lightbox-open { position: absolute; bottom: 24px; color: var(--text-2); font-weight: 600; }

/* ------------------------------------------------------------ modals */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(4, 5, 8, .7); display: grid; place-items: center; padding: 16px; animation: fade .12s ease; }
.modal { position: relative; width: 480px; max-width: 100%; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: var(--shadow); animation: pop .15s ease; --ring: var(--bg-2); }
.modal.sm { width: 420px; }
.modal.lg { width: 720px; }
.modal.xl { width: 920px; }
.modal-x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--text-3); z-index: 3; }
.modal-x:hover { background: var(--bg-4); color: var(--text); }
.modal-head { padding: 24px 56px 6px 24px; }
.modal-head h2 { font-size: 21px; font-weight: 800; }
.modal-head p { color: var(--text-2); margin-top: 6px; font-size: 14px; }
.modal-body { padding: 14px 24px 8px; }
.modal-body > p { color: var(--text-2); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; background: var(--bg-1); border-top: 1px solid var(--line); margin-top: 12px; border-radius: 0 0 20px 20px; }
.add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.add-card { background: var(--bg-3); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.add-card h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.add-card .field { margin: 0; flex: none; }
.icon-picker { width: 76px; height: 76px; border-radius: 24px; border: 2px dashed var(--line-2); display: grid; place-content: center; justify-items: center; gap: 2px; color: var(--text-3); align-self: center; overflow: hidden; }
.icon-picker:hover { border-color: var(--accent); color: var(--accent); }
.icon-picker img { width: 76px; height: 76px; object-fit: cover; }
.icon-picker small { font-size: 10px; font-weight: 800; }
.hq-card { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 14px 16px; border-radius: 16px; background: linear-gradient(135deg, rgba(255, 178, 36, .14), rgba(255, 106, 61, .08)); border: 1px solid rgba(255, 178, 36, .22); }
.hq-card > div { flex: 1; display: flex; flex-direction: column; }
.hq-card small { color: var(--text-2); }
.copy-field { display: flex; gap: 8px; margin-bottom: 16px; }
.invite-join { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 32px 28px 24px; }
.invite-join h2 { font-size: 24px; font-weight: 800; }
.invite-stats { color: var(--text-2); font-size: 14px; margin-bottom: 10px; }
.pick-list { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow-y: auto; }
.pick-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; width: 100%; }
.pick-row:hover { background: var(--bg-3); --ring: var(--bg-3); }
.pick-row > span { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.pick-row small { color: var(--text-3); font-size: 13px; }
.check-list { display: flex; flex-direction: column; gap: 2px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 10px; cursor: pointer; font-weight: 600; }
.check-row:hover { background: var(--bg-3); }
.check-row.disabled { opacity: .55; cursor: not-allowed; }
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.check-row small { margin-left: auto; font-size: 12px; font-weight: 500; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.badge-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px; border-radius: 14px; background: var(--bg-3); border: 2px solid transparent; text-align: center; }
.badge-tile small { color: var(--text-3); font-size: 12px; }
.badge-tile:hover { border-color: var(--line-2); }
.badge-tile.on { border-color: var(--accent); background: var(--accent-soft); }
.badge-tile.on small { color: var(--accent); }

.profile-modal { display: grid; grid-template-columns: 340px minmax(0, 1fr); min-height: 520px; }
.pm-left { padding: 14px; border-right: 1px solid var(--line); }
.pm-left .pcard { height: 100%; }
.pm-right { display: flex; flex-direction: column; min-width: 0; }
.pm-right .tabs { padding: 16px 60px 12px 20px; border-bottom: 1px solid var(--line); }
.pm-content { padding: 18px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; max-height: 70vh; }
.conn-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.conn-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--bg-3); border: 1px solid var(--line); color: var(--text); text-decoration: none !important; }
.conn-row:hover { border-color: var(--line-2); background: var(--bg-4); }
.conn-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.conn-row-text b { display: inline-flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn-row-text small { color: var(--text-3); font-size: 12.5px; }
.verified { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--green); color: #052712; }
.recent-games { display: flex; flex-direction: column; gap: 8px; }
.recent-game { display: flex; align-items: center; gap: 12px; background: var(--bg-3); border-radius: 12px; padding: 8px; }
.recent-game img { width: 120px; height: 45px; border-radius: 8px; object-fit: cover; background: var(--bg-4); }
.recent-game span { display: flex; flex-direction: column; }
.recent-game small { color: var(--text-3); font-size: 12.5px; }

/* ------------------------------------------------------------ fullscreen settings */
.fullscreen { position: fixed; inset: 0; z-index: 40; display: grid; grid-template-columns: minmax(230px, 1fr) minmax(0, 2.4fr); background: var(--bg-2); animation: fade .15s ease; --ring: var(--bg-2); }
.fs-nav { background: var(--bg-1); display: flex; justify-content: flex-end; overflow-y: auto; border-right: 1px solid var(--line); }
.fs-nav-inner { width: 230px; padding: 56px 12px 24px; display: flex; flex-direction: column; gap: 2px; }
.fs-nav h5 { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 14px 10px 6px; }
.fs-nav h5:first-child { padding-top: 0; }
.fs-tab { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--text-2); font-weight: 600; width: 100%; }
.fs-tab:hover { background: var(--bg-3); color: var(--text); }
.fs-tab.active { background: var(--bg-4); color: var(--text); }
.fs-tab.active .ic { color: var(--accent); }
.fs-tab.danger { color: var(--red); }
.fs-sep { height: 1px; background: var(--line-2); margin: 10px 8px; }
.fs-version { display: flex; align-items: center; gap: 8px; padding: 10px; color: var(--text-3); font-size: 12px; }
.fs-content { overflow-y: auto; position: relative; }
.fs-content-inner { max-width: 820px; padding: 56px 72px 80px 40px; }
.fs-content-inner > h2 { font-size: 22px; font-weight: 800; margin-bottom: 18px; }
.fs-close { position: fixed; top: 52px; right: max(24px, calc(50vw - 640px)); display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text-3); font-size: 11px; font-weight: 800; }
.fs-close .ic { width: 38px; height: 38px; padding: 8px; border-radius: 50%; border: 2px solid var(--bg-5); }
.fs-close:hover { color: var(--text); }
.fs-close:hover .ic { border-color: var(--text-2); }
.settings-form { padding: 18px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.settings-form h5, .sp-block h5, .role-editor h5 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
.settings-form .row, .settings-form .stack { width: 100%; }
.settings-form .row input { flex: 1; }
.settings-form input.narrow { flex: 0 0 140px; }
.settings-profile { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 36px; align-items: start; }
.settings-profile .save-bar { grid-column: 1 / -1; }
.sp-form h2 { font-size: 22px; font-weight: 800; margin-bottom: 18px; }
.sp-block { padding: 14px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.sp-block .field { margin: 0; }
.sp-preview { position: sticky; top: 0; display: flex; flex-direction: column; gap: 10px; }
.sp-preview h5 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 34px; height: 34px; border-radius: 10px; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); position: relative; display: grid; place-items: center; color: #fff; cursor: pointer; flex: none; }
.swatch.on { border-color: var(--text); }
.swatch.custom { overflow: hidden; }
.swatch.custom .ic { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); pointer-events: none; }
.swatch input[type=color] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: 0; padding: 0; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.theme-tile { height: 52px; border-radius: 12px; padding: 6px 9px; display: flex; align-items: flex-end; font-size: 12px; font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); border: 2px solid transparent; }
.theme-tile.none { background: var(--bg-3); color: var(--text-2); text-shadow: none; border: 2px dashed var(--line-2); }
.theme-tile.on { border-color: var(--text); }
.theme-custom { margin-top: 4px; }
.save-bar { position: sticky; bottom: 18px; display: flex; align-items: center; gap: 10px; background: #050608; border: 1px solid var(--line-2); border-radius: 14px; padding: 10px 12px 10px 18px; box-shadow: var(--shadow); font-weight: 650; animation: pop .15s ease; margin-top: 18px; z-index: 5; }
.account-card { background: var(--bg-1); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; margin-bottom: 8px; --ring: var(--bg-1); }
.account-banner { height: 96px; overflow: hidden; }
.account-banner img { width: 100%; height: 100%; object-fit: cover; }
.account-id { display: flex; align-items: center; gap: 14px; padding: 0 18px 16px; margin-top: -26px; }
.account-id > div { flex: 1; display: flex; flex-direction: column; margin-top: 24px; }
.account-id b { font-size: 18px; }
.account-id small { color: var(--text-2); }
.account-id .btn { margin-top: 24px; }
.account-id .avatar > img, .account-id .avatar > .avatar-fallback { box-shadow: 0 0 0 6px var(--bg-1); }

.conn-cards { display: flex; flex-direction: column; gap: 14px; }
.conn-card { background: var(--bg-1); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.cc-head { display: flex; align-items: center; gap: 14px; }
.cc-title { flex: 1; display: flex; flex-direction: column; }
.cc-title b { font-size: 16px; }
.cc-title small { color: var(--text-2); font-size: 13.5px; }
.cc-account { margin-top: 14px; background: var(--bg-2); border-radius: 12px; padding: 4px 14px; }
.cc-who { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cc-who img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.cc-who a { color: var(--text); }
.cc-account .toggle-row:last-child { border-bottom: 0; }
.cc-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--bg-2); color: var(--text-2); font-size: 13.5px; }
.cc-note .ic { color: var(--blue); margin-top: 2px; }
.inline-form { display: flex; gap: 8px; margin-top: 10px; }

.int-card { background: var(--bg-1); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 10px; }
.int-card h3 { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.int-card p { color: var(--text-2); }
.int-card .field { margin: 0; }
.int-card .copy-field { margin: 0; }
.int-card .copy-field input { font: 13px/1.4 ui-monospace, 'Cascadia Code', Consolas, monospace; }
.int-card .alert { margin: 0; }
.steps { margin: 0; padding-left: 20px; color: var(--text-2); display: flex; flex-direction: column; gap: 6px; }
.steps b { color: var(--text); }
.test-result { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; padding: 8px 12px; border-radius: 10px; }
.test-result.ok { background: rgba(61, 220, 132, .1); color: var(--green); }
.test-result.bad { background: rgba(255, 77, 94, .1); color: var(--red); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 22px; }
.stat-tile { background: var(--bg-1); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.stat-tile .ic { color: var(--accent); }
.stat-tile small { color: var(--text-2); font-weight: 600; margin-top: 6px; }
.stat-tile b { font-size: 28px; font-weight: 800; }
.admin-tools { margin-bottom: 4px; }
.admin-tools .search-box { margin: 0; }
.seg { display: flex; background: var(--bg-0); border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; }
.seg button { padding: 6px 12px; border-radius: 7px; font-weight: 600; font-size: 13px; color: var(--text-2); }
.seg button.on { background: var(--bg-4); color: var(--text); }
.admin-list { display: flex; flex-direction: column; margin-top: 12px; }
.admin-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.admin-row:hover { background: rgba(255, 255, 255, .02); }
.admin-who { display: flex; align-items: center; gap: 12px; flex: 1 1 260px; min-width: 0; }
.admin-who > span { display: flex; flex-direction: column; min-width: 0; }
.admin-who small { color: var(--text-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-flags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.admin-actions { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.badge-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-bottom: 8px; }
.badge-card { display: flex; align-items: center; gap: 12px; background: var(--bg-1); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.badge-card > div { flex: 1; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; min-width: 0; }
.badge-card small { color: var(--text-3); font-size: 12.5px; }
.badge-form .row { width: 100%; }

.ss-overview { display: flex; gap: 32px; align-items: flex-start; }
.ss-icon-col { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 140px; text-align: center; }
.roles-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.roles-list { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; }
.roles-list > .btn { margin-bottom: 10px; }
.role-item { display: flex; align-items: center; border-radius: 9px; }
.role-item:hover { background: var(--bg-3); }
.role-item.active { background: var(--bg-4); }
.role-pick { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; padding: 8px 10px; font-weight: 600; }
.role-pick small { margin-left: auto; color: var(--text-3); font-size: 12px; }
.role-move { display: flex; padding-right: 4px; }
.role-editor { display: flex; flex-direction: column; gap: 10px; }
.perm-list { display: flex; flex-direction: column; }

/* ------------------------------------------------------------ auth */
.auth { display: grid; grid-template-columns: 1.15fr 1fr; height: 100%; }
.auth-art { position: relative; overflow: hidden; padding: 48px 56px; display: flex; flex-direction: column; justify-content: center; gap: 18px;
  background: radial-gradient(1200px 600px at -10% -10%, rgba(255, 178, 36, .28), transparent 60%), radial-gradient(900px 500px at 110% 110%, rgba(255, 92, 138, .22), transparent 60%), var(--bg-1); border-right: 1px solid var(--line); }
.auth-brand { position: absolute; top: 36px; left: 56px; display: flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.auth-art h1 { font-size: clamp(36px, 4.6vw, 64px); font-weight: 800; letter-spacing: -.03em; line-height: 1.02; }
.auth-art h1 em { font-style: italic; color: var(--accent); }
.auth-art > p { max-width: 460px; color: var(--text-2); font-size: 16.5px; }
.auth-bubbles { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; align-items: flex-start; }
.bubble { display: flex; align-items: center; gap: 8px; background: rgba(12, 13, 18, .7); border: 1px solid var(--line-2); backdrop-filter: blur(8px); padding: 10px 14px; border-radius: 16px 16px 16px 4px; font-size: 14px; font-weight: 600; animation: bob 4s ease-in-out infinite; }
.bubble .dotc { width: 10px; height: 10px; margin: 0; }
.bubble.b2 { margin-left: 48px; animation-delay: -1.3s; }
.bubble.b3 { margin-left: 18px; animation-delay: -2.6s; }
.auth-panel { display: grid; place-items: center; padding: 24px; overflow-y: auto; }
.auth-card { width: 400px; max-width: 100%; display: flex; flex-direction: column; }
.auth-card h2 { font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.auth-card > p.muted { margin: 4px 0 22px; }
.auth-card .btn { margin-top: 8px; }
.auth-switch { margin-top: 16px; font-size: 14px; color: var(--text-2); }
.auth-invite { display: flex; align-items: center; gap: 12px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 12px; margin-bottom: 22px; }
.auth-invite > div { display: flex; flex-direction: column; }
.auth-invite small { color: var(--text-3); font-size: 12.5px; }
.auth-invite b { font-size: 16px; }

/* ------------------------------------------------------------ calls */
.icon-btn.alert-on { color: var(--red); }
.icon-btn.hangup { color: var(--red); }
.icon-btn.hangup:hover { background: var(--red); color: #fff; }
.voice-panel { flex: none; display: flex; align-items: center; gap: 2px; margin: 0 8px 6px; padding: 8px 6px 8px 10px; background: var(--bg-0); border-radius: 14px; border: 1px solid rgba(61, 220, 132, .18); }
.vp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.vp-status { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 750; color: var(--idle); }
.vp-status.ok { color: var(--green); }
.vp-info small { font-size: 12px; color: var(--text-3); }
.vp-info:hover small { color: var(--text-2); text-decoration: underline; }
.chan.voice.joined .chan-icon { color: var(--green); opacity: 1; }
.chan-count { font-size: 11px; font-weight: 800; color: var(--text-3); background: var(--bg-3); border-radius: 8px; padding: 1px 6px; }
.voice-members { display: flex; flex-direction: column; gap: 1px; margin: 0 0 4px 28px; }
.voice-member { display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 8px; font-size: 13.5px; color: var(--text-2); min-width: 0; }
.voice-member:hover { background: var(--bg-3); color: var(--text); }
.voice-member .ic { flex: none; color: var(--text-3); }
.voice-member .ic.off { color: var(--red); }
.voice-member .avatar img, .voice-member .avatar .avatar-fallback { transition: box-shadow .12s; }
.voice-member.speaking .avatar > img, .voice-member.speaking .avatar > .avatar-fallback { box-shadow: 0 0 0 2px var(--green); }
.dm-call { color: var(--green); display: grid; }

.call-stage { flex: none; display: flex; flex-direction: column; gap: 14px; padding: 16px; background: #0d0e12; border-bottom: 1px solid var(--line); --ring: #0d0e12; }
.main > .call-stage:not(.compact) { flex: 1; min-height: 0; border-bottom: 0; }
.call-stage.compact { max-height: 46vh; }
.call-stage.idle { align-items: center; justify-content: center; text-align: center; }
.call-idle { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px; }
.call-idle h2 { font-size: 22px; font-weight: 800; }
.call-idle-icon { width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; background: var(--bg-3); color: var(--green); }
.call-faces { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.call-idle-actions { justify-content: center; margin-top: 6px; }
.tiles { flex: 1; min-height: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); grid-auto-rows: minmax(140px, 1fr); overflow-y: auto; align-content: center; }
.call-stage.compact .tiles { grid-auto-rows: minmax(110px, 180px); }
.tile { position: relative; border-radius: 16px; background: var(--bg-3); overflow: hidden; display: grid; place-items: center; min-height: 0; box-shadow: inset 0 0 0 2px transparent; transition: box-shadow .12s; --ring: var(--bg-3); }
.tile.speaking { box-shadow: inset 0 0 0 3px var(--green); }
.tile video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.tile video.contain { object-fit: contain; }
.tile video.mirror { transform: scaleX(-1); }
.tile-avatar { display: grid; place-items: center; }
.tile.speaking .tile-avatar .avatar > img, .tile.speaking .tile-avatar .avatar > .avatar-fallback { box-shadow: 0 0 0 4px var(--green); }
.tile-label { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); display: flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 9px; background: rgba(0, 0, 0, .6); font-size: 13px; font-weight: 650; }
.tile-label small { color: var(--idle); font-weight: 600; }
.tile-label .ic.off { color: var(--red); }
.call-ringing { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 18px; }
.call-ringing .avatar { animation: ring-pulse 1.4s ease-out infinite; border-radius: 50%; }
@keyframes ring-pulse { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, .5); } 100% { box-shadow: 0 0 0 22px rgba(61, 220, 132, 0); } }
.call-controls { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.cc-btn { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-4); color: var(--text); transition: background .12s, transform .06s; }
.cc-btn:hover { background: var(--bg-5); }
.cc-btn:active { transform: scale(.96); }
.cc-btn.off { background: #fff; color: #1a1b22; }
.cc-btn.on { background: var(--green); color: #052712; }
.cc-btn.hangup { background: var(--red); color: #fff; }
.incoming-call { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 12px; width: min(440px, calc(100vw - 24px));
  background: #0f1014; border: 1px solid rgba(61, 220, 132, .35); border-radius: 20px; box-shadow: var(--shadow); animation: pop .15s ease; --ring: #0f1014; }
.ic-avatar .avatar { border-radius: 50%; animation: ring-pulse 1.4s ease-out infinite; }
.ic-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ic-text small { color: var(--green); font-weight: 750; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.ic-text b { font-size: 17px; }
.ic-actions { display: flex; gap: 8px; }
.round-btn.big { width: 46px; height: 46px; }
.round-btn.decline { background: var(--red); color: #fff; }
.round-btn.accept { background: var(--green); color: #052712; }
.round-btn.decline:hover, .round-btn.accept:hover { filter: brightness(1.1); color: inherit; }
.type-pick { display: grid; gap: 8px; margin-bottom: 16px; }
.type-opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--bg-3); border: 2px solid transparent; cursor: pointer; color: var(--text-2); }
.type-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.type-opt input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.type-opt span { display: flex; flex-direction: column; }
.type-opt small { color: var(--text-3); font-size: 12.5px; }

/* Touch screens have no hover: show message actions for the tapped message instead. */
@media (hover: none) {
  .msg:hover { background: none; }
  .msg:hover .msg-actions { display: none; }
  .msg.active { background: rgba(255, 255, 255, .04); }
  .msg.active .msg-actions { display: flex; }
  .msg-actions button { width: 40px; height: 38px; }
  .msg-side-time { opacity: .55; }
  .reaction.add { opacity: 1; }
}

/* ------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .panels.has-side { grid-template-columns: 236px minmax(0, 1fr); }
  .panels.has-side > .members { display: none; }
  .friends-layout { grid-template-columns: minmax(0, 1fr); }
  .active-now { display: none; }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .settings-profile { grid-template-columns: minmax(0, 1fr); }
  .sp-preview { position: static; order: -1; }
  .profile-modal { grid-template-columns: minmax(0, 1fr); }
  .pm-left { border-right: 0; border-bottom: 1px solid var(--line); }
  .roles-layout { grid-template-columns: minmax(0, 1fr); }
  .fullscreen { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .fs-nav { justify-content: flex-start; border-right: 0; border-bottom: 1px solid var(--line); }
  .fs-nav-inner { width: 100%; flex-direction: row; flex-wrap: wrap; padding: 12px 64px 12px 12px; }
  .fs-nav-inner h5, .fs-version, .fs-sep { display: none; }
  .fs-tab { width: auto; }
  .fs-content-inner { padding: 24px 16px 60px; }
  .fs-close { top: 12px; right: 12px; }
  .add-grid, .stat-grid { grid-template-columns: 1fr; }
}
/* Phones: one pane at a time. "nav" shows the server rail + channel list, "main" shows the conversation. */
@media (max-width: 720px) {
  .mobile-only { display: inline-grid !important; }
  .panels, .panels.has-side { grid-template-columns: minmax(0, 1fr) !important; padding: 0; gap: 0; }
  .sidebar, .main, .members { border-radius: 0; border: 0; }
  .rail { width: 64px; padding-top: max(12px, env(safe-area-inset-top)); }
  .shell.mview-main .rail, .shell.mview-main .panels > .sidebar { display: none; }
  .shell.mview-nav .panels > .main { display: none; }
  .panels > .members { display: none; }
  .shell.mobile-members .panels > .members { display: block; position: fixed; top: 0; right: 0; bottom: 0; width: min(320px, 86vw); z-index: 35; box-shadow: var(--shadow); }
  .mobile-backdrop { position: fixed; inset: 0; z-index: 34; background: rgba(0, 0, 0, .55); }
  .chat-head { padding: 0 6px; gap: 6px; padding-top: env(safe-area-inset-top); height: calc(54px + env(safe-area-inset-top)); }
  .chat-topic, .head-sep { display: none; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .msg { padding-left: 10px; padding-right: 10px; }
  .msg-row { gap: 10px; }
  .msg-actions { right: 8px; top: -18px; }
  .composer-wrap { padding: 0 8px max(4px, env(safe-area-inset-bottom)); }
  .user-panel { margin-bottom: max(8px, env(safe-area-inset-bottom)); }
  .friends-main { padding: 12px; }
  .add-friend-form { flex-direction: column; padding: 8px; }
  .popout { left: 8px !important; right: 8px; width: auto; top: auto !important; bottom: max(8px, env(safe-area-inset-bottom)); max-height: 82dvh; overflow-y: auto; }
  .incoming-call { top: max(10px, env(safe-area-inset-top)); flex-wrap: wrap; }
  .call-stage { padding: 10px; }
  .call-stage.compact { max-height: 52dvh; }
  .tiles { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); grid-auto-rows: minmax(120px, 1fr); }
  .cc-btn { width: 56px; height: 56px; }
  /* iOS zooms the page when a focused input's text is smaller than 16px. */
  input:not([type=checkbox]):not([type=radio]):not([type=color]), textarea, select, #composer { font-size: 16px !important; }
  .modal-backdrop { padding: 8px; }
  .modal { max-height: calc(100dvh - 16px); }
}
