/* Gabble app styles. Discord-style dark by default, with a light theme. */
:root {
  --font: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Nunito', var(--font);
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --accent: #ffc531;
  --accent-hover: #ffd35a;
  --accent-soft: rgba(255, 197, 49, 0.14);
  --accent-text: #231a00;
  --bg: #1f2025;
  --bg-2: #18191d;
  --bg-3: #2a2c33;
  --bg-hover: rgba(255, 255, 255, 0.045);
  --bg-active: rgba(255, 255, 255, 0.085);
  --bg-float: #26282e;
  --rail: #111215;
  --text: #eceae6;
  --text-2: #b4b5bc;
  --text-3: #80828b;
  --border: #2c2e35;
  --border-strong: #3c3e46;
  --mention-bg: rgba(255, 197, 49, 0.07);
  --mention-bar: #ffc531;
  --link: #6fb7ff;
  --green: #3dcc7e;
  --yellow: #f2a93b;
  --red: #f2555a;
  --gray: #80828b;
  --code-bg: #16171a;
  --icon-cut: var(--bg-3);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  --radius: 8px;
  --radius-lg: 14px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --accent: #f0b100; --accent-hover: #e0a400; --accent-soft: rgba(240, 177, 0, 0.16); --accent-text: #1f1700;
  --bg: #ffffff; --bg-2: #f3f2ef; --bg-3: #e7e6e2; --bg-hover: rgba(25, 24, 20, 0.05); --bg-active: rgba(25, 24, 20, 0.09);
  --bg-float: #ffffff; --rail: #e3e2dd; --text: #1d1c1a; --text-2: #55554f; --text-3: #8b8a83;
  --border: #e2e1dc; --border-strong: #cfcec8; --mention-bg: rgba(240, 177, 0, 0.12); --mention-bar: #f0b100; --link: #1f6fd1;
  --code-bg: #f1f0ec; --shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    --accent: #f0b100; --accent-hover: #e0a400; --accent-soft: rgba(240, 177, 0, 0.16); --accent-text: #1f1700;
    --bg: #ffffff; --bg-2: #f3f2ef; --bg-3: #e7e6e2; --bg-hover: rgba(25, 24, 20, 0.05); --bg-active: rgba(25, 24, 20, 0.09);
    --bg-float: #ffffff; --rail: #e3e2dd; --text: #1d1c1a; --text-2: #55554f; --text-3: #8b8a83;
    --border: #e2e1dc; --border-strong: #cfcec8; --mention-bg: rgba(240, 177, 0, 0.12); --mention-bar: #f0b100; --link: #1f6fd1;
    --code-bg: #f1f0ec; --shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: 15px; line-height: 1.375; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; overflow: hidden; overscroll-behavior: none;
}
body.font-small { font-size: 14px; } body.font-large { font-size: 17px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; }
[hidden] { display: none !important; }
::selection { background: rgba(255, 197, 49, 0.35); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.scroll { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--bg-3) transparent; }
.scroll::-webkit-scrollbar { width: 8px; } .scroll::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
.ico { width: 20px; height: 20px; flex: none; fill: currentColor; }
.ico.sm { width: 16px; height: 16px; } .ico.lg { width: 24px; height: 24px; }
.muted { color: var(--text-3); } .small { font-size: 0.86em; } .bold { font-weight: 700; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mascot { display: block; }
.mascot svg, .mascot img { width: 100%; height: 100%; display: block; object-fit: contain; }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 6px; font-weight: 600; font-size: 14px; background: var(--bg-3); color: var(--text); transition: background .12s, filter .12s; white-space: nowrap; }
.btn:hover { background: var(--border-strong); }
.btn.primary { background: var(--accent); color: var(--accent-text); } .btn.primary:hover { background: var(--accent-hover); }
.btn.danger { background: var(--red); color: #fff; } .btn.danger:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; } .btn.ghost:hover { background: var(--bg-hover); text-decoration: underline; }
.btn.green { background: var(--green); color: #06210f; }
.btn.sm { height: 30px; padding: 0 12px; font-size: 13px; border-radius: 5px; }
.btn.block { width: 100%; height: 42px; font-size: 15px; }
.btn:disabled { opacity: .5; pointer-events: none; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; color: var(--text-2); }
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn.on { color: var(--text); }
.icon-btn.red { color: var(--red); }
.field { display: grid; gap: 7px; margin-bottom: 18px; }
.field > label:not(.row), .label { font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--text-2); }
.input, .textarea, .select { width: 100%; height: 40px; padding: 0 12px; border-radius: 6px; border: 1px solid transparent; background: var(--bg-2); outline: none; transition: border-color .12s; }
.textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); }
.hint { font-size: 13px; color: var(--text-3); }
.error-text { color: var(--red); font-size: 13px; min-height: 18px; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.switch { position: relative; width: 40px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 99px; transition: background .15s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:disabled + span { opacity: .4; cursor: not-allowed; }
.toggle-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.toggle-row .grow > div:first-child { font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; background: var(--bg-3); font-size: 13px; font-weight: 600; color: var(--text-2); }
.chip.on { background: var(--accent); color: var(--accent-text); }
.badge-count { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; line-height: 1; }
.kbd { font-family: var(--mono); font-size: 12px; padding: 1px 6px; border-radius: 4px; background: var(--bg-3); border: 1px solid var(--border); }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.empty { display: grid; justify-items: center; text-align: center; color: var(--text-3); padding: 40px 24px; gap: 10px; }
.empty .art { width: 120px; height: 120px; opacity: .95; }
.empty .art.sm { width: 72px; height: 72px; }
.empty .art-icon { width: 56px; height: 56px; border-radius: 18px; background: var(--bg-3); display: grid; place-items: center; color: var(--text-2); }
.empty .art-icon .ico { width: 28px; height: 28px; }
.empty b { color: var(--text); font-size: 16px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--bg-3); border-top-color: var(--accent); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- avatars ---------- */
.avatar { position: relative; flex: none; border-radius: 50%; width: 40px; height: 40px; }
.avatar > img, .avatar > .avatar-fallback { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; aspect-ratio: 1; }
.avatar-fallback { display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 0.4em; user-select: none; }
.avatar-fallback .ico { width: 60%; height: 60%; }
.avatar.s16 { width: 16px; height: 16px; font-size: 16px; } .avatar.s20 { width: 20px; height: 20px; font-size: 20px; } .avatar.s24 { width: 24px; height: 24px; font-size: 24px; }
.avatar.s32 { width: 32px; height: 32px; font-size: 32px; } .avatar.s40 { width: 40px; height: 40px; font-size: 40px; }
.avatar.s48 { width: 48px; height: 48px; font-size: 48px; } .avatar.s56 { width: 56px; height: 56px; font-size: 56px; } .avatar.s80 { width: 80px; height: 80px; font-size: 80px; }
.avatar.s96 { width: 96px; height: 96px; font-size: 96px; } .avatar.s120 { width: 120px; height: 120px; font-size: 120px; }
/* Discord-style status: a dot, a moon for idle, a bar for do-not-disturb, a ring for offline. */
.status-dot { position: absolute; right: -3px; bottom: -3px; width: 38%; height: 38%; min-width: 11px; min-height: 11px; max-width: 18px; max-height: 18px; border-radius: 50%; border: 3px solid var(--status-ring, var(--bg-2)); background: var(--gray); box-sizing: content-box; }
.status-dot.online { background: var(--green); }
.status-dot.idle { background: radial-gradient(circle at 28% 28%, var(--status-ring, var(--bg-2)) 0 34%, var(--yellow) 35%); }
.status-dot.dnd { background: linear-gradient(var(--red), var(--red)); }
.status-dot.dnd::after { content: ''; position: absolute; left: 22%; right: 22%; top: 42%; height: 18%; border-radius: 2px; background: var(--status-ring, var(--bg-2)); }
.status-dot.offline { background: radial-gradient(circle, var(--status-ring, var(--bg-2)) 0 34%, var(--gray) 35%); }
.avatar.speaking > img, .avatar.speaking > .avatar-fallback { box-shadow: 0 0 0 2px var(--status-ring, var(--bg-2)), 0 0 0 4px var(--green); }
.avatar .deco { position: absolute; inset: -17%; pointer-events: none; z-index: 1; }
.avatar .deco svg { width: 100%; height: 100%; display: block; overflow: visible; }

/* ---------- app layout ---------- */
:root { --rail-w: 72px; --side-w: 240px; --members-w: 240px; }
@media (min-width: 1500px) { :root { --side-w: 264px; --members-w: 264px; } body { font-size: 15.5px; } }
@media (min-width: 1900px) { :root { --side-w: 288px; --members-w: 288px; } body { font-size: 16px; } }
#app { display: flex; height: 100dvh; width: 100vw; overflow: hidden; background: var(--rail); }
.nav-drawer { display: flex; flex: none; }
.rail { width: var(--rail-w); flex: none; background: var(--rail); display: flex; flex-direction: column; align-items: center; padding: 12px 0; gap: 8px; overflow-y: auto; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail-item { position: relative; width: 48px; height: 48px; flex: none; }
.rail-btn { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); color: var(--text); overflow: hidden; transition: border-radius .18s ease, background .15s, color .15s; font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.rail-btn img { width: 100%; height: 100%; object-fit: cover; }
.rail-item:hover .rail-btn, .rail-item.active .rail-btn { border-radius: 15px; }
.rail-btn.home { background: var(--bg); padding: 11px; color: var(--text-2); }
.rail-item.active .rail-btn.home, .rail-item:hover .rail-btn.home { background: linear-gradient(#ffc23a, #ff9a1a); color: #fff; }
.rail-btn.add, .rail-btn.compass { color: var(--green); }
.rail-item:hover .rail-btn.add, .rail-item:hover .rail-btn.compass, .rail-item.active .rail-btn.compass { background: var(--green); color: #06210f; }
.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 .18s; }
.rail-item.unread .rail-pill { height: 8px; } .rail-item:hover .rail-pill { height: 20px; } .rail-item.active .rail-pill { height: 40px; }
.rail-item .badge-count { position: absolute; right: -4px; bottom: -4px; border: 4px solid var(--rail); height: 24px; min-width: 24px; font-size: 12px; box-sizing: border-box; }
.rail-sep { width: 32px; height: 2px; border-radius: 2px; background: var(--border); flex: none; }
.rail-voice { position: absolute; right: -3px; bottom: -3px; width: 20px; height: 20px; border-radius: 50%; background: var(--green); color: #06210f; display: grid; place-items: center; border: 3px solid var(--rail); box-sizing: content-box; }
.rail-voice .ico { width: 12px; height: 12px; }
.rail-item.dragover .rail-btn { box-shadow: 0 0 0 3px var(--accent); border-radius: 15px; }
.folder { width: 48px; border-radius: 15px; background: var(--bg-active); display: flex; flex-direction: column; align-items: center; gap: 8px; padding-bottom: 6px; flex: none; }
.folder-head { width: 48px; height: 48px; border-radius: 15px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 7px; background: color-mix(in srgb, var(--folder-color, var(--text-3)) 22%, transparent); cursor: pointer; position: relative; }
.folder-head .mini { width: 15px; height: 15px; border-radius: 50%; overflow: hidden; background: var(--bg); font-size: 7px; font-weight: 700; display: grid; place-items: center; }
.folder-head .mini img { width: 100%; height: 100%; object-fit: cover; }
.folder-head.open { display: grid; place-items: center; grid-template-columns: 1fr; color: var(--folder-color, var(--text-2)); }
.folder-head.open .ico { width: 26px; height: 26px; }

.sidebar { width: var(--side-w); flex: none; background: var(--bg-2); display: flex; flex-direction: column; min-height: 0; border-radius: 10px 0 0 0; overflow: hidden; }
.sidebar-head { height: 48px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 16px; box-shadow: 0 1px 0 rgba(0,0,0,.25); font-weight: 700; font-size: 15px; position: relative; z-index: 1; }
.sidebar-head.clickable:hover { background: var(--bg-hover); cursor: pointer; }
.sidebar-head .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.find-btn { width: 100%; height: 30px; border-radius: 5px; background: var(--rail); color: var(--text-3); font-size: 13px; text-align: left; padding: 0 8px; }
.server-banner { height: 136px; background-size: cover; background-position: center; position: relative; flex: none; cursor: pointer; }
.server-banner .sidebar-head { position: absolute; inset: 0 0 auto 0; box-shadow: none; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.6); background: linear-gradient(rgba(0,0,0,.5), transparent); }
.sidebar-body { flex: 1; min-height: 0; padding: 8px 8px 16px; }
.events-row { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px; margin: 0 0 4px; border-radius: 6px; color: var(--text-2); cursor: pointer; font-weight: 600; font-size: 14px; }
.events-row:hover { background: var(--bg-hover); color: var(--text); }
.events-row.live { color: var(--green); }
.cat { display: flex; align-items: center; gap: 2px; padding: 16px 2px 4px; font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--text-3); cursor: pointer; user-select: none; }
.cat:hover { color: var(--text-2); } .cat .ico { width: 12px; height: 12px; transition: transform .15s; } .cat.collapsed .ico.chev { transform: rotate(-90deg); }
.cat .cat-add { margin-left: auto; opacity: 0; } .cat:hover .cat-add { opacity: 1; }
.chan { position: relative; display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px; margin: 1px 0; border-radius: 6px; color: var(--text-3); cursor: pointer; user-select: none; font-size: 15px; font-weight: 500; }
.chan > .ico { width: 20px; height: 20px; opacity: .85; }
.chan:hover { background: var(--bg-hover); color: var(--text-2); }
.chan.active { background: var(--bg-active); color: var(--text); }
.chan.unread { color: var(--text); font-weight: 650; }
.chan.unread::before { content: ''; position: absolute; left: -8px; width: 4px; height: 8px; border-radius: 0 4px 4px 0; background: var(--text); }
.chan.muted-chan { opacity: .45; }
.chan .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan .actions { display: none; gap: 2px; } .chan:hover .actions, .chan.active .actions { display: flex; }
.chan .actions .icon-btn { width: 22px; height: 22px; } .chan .actions .ico { width: 16px; height: 16px; }
.voice-users { margin: 0 0 6px 28px; display: grid; gap: 1px; }
.voice-user { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; border-radius: 6px; color: var(--text-2); font-size: 14px; cursor: pointer; }
.voice-user:hover { background: var(--bg-hover); color: var(--text); }
.voice-user .flags { margin-left: auto; display: flex; gap: 4px; color: var(--text-3); align-items: center; } .voice-user .flags .ico { width: 15px; height: 15px; }
.live-tag { font-size: 10px; font-weight: 800; background: var(--red); color: #fff; border-radius: 4px; padding: 1px 5px; letter-spacing: .03em; }
.dm-row { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 8px; margin: 1px 0; border-radius: 6px; color: var(--text-3); cursor: pointer; }
.dm-row:hover { background: var(--bg-hover); color: var(--text-2); } .dm-row.active { background: var(--bg-active); color: var(--text); }
.dm-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.dm-row .sub { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-row .close { opacity: 0; } .dm-row:hover .close { opacity: 1; }
.nav-row { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 10px; border-radius: 6px; color: var(--text-3); cursor: pointer; font-weight: 600; font-size: 15px; }
.nav-row:hover { background: var(--bg-hover); color: var(--text-2); } .nav-row.active { background: var(--bg-active); color: var(--text); }
.section-title { display: flex; align-items: center; justify-content: space-between; padding: 18px 8px 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--text-3); }

.voice-panel { flex: none; border-bottom: 1px solid var(--border); padding: 10px 10px 8px; background: var(--rail); }
.voice-panel .status { color: var(--green); font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.voice-panel .where { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.voice-panel .where:hover { text-decoration: underline; }
.voice-panel .ctrls { display: flex; gap: 6px; margin-top: 8px; }
.voice-panel .ctrls .btn { flex: 1; height: 32px; padding: 0; }
.voice-panel .ctrls .btn.on { background: var(--green); color: #06210f; }
.user-panel { flex: none; height: 54px; display: flex; align-items: center; gap: 2px; padding: 0 8px; background: var(--rail); }
.user-panel .who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 4px; margin-left: -2px; border-radius: 6px; cursor: pointer; --status-ring: var(--rail); }
.user-panel .who:hover { background: var(--bg-hover); }
.user-panel .names { min-width: 0; line-height: 1.2; }
.user-panel .names div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.user-panel .names .u { font-size: 12px; color: var(--text-3); }
.user-panel .icon-btn.off { color: var(--red); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); position: relative; }
.topbar { height: 48px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 10px 0 16px; box-shadow: 0 1px 0 rgba(0,0,0,.25); position: relative; z-index: 2; }
.topbar .title { font-weight: 700; display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; font-size: 15.5px; overflow: hidden; }
.topbar .title > .ico { color: var(--text-3); width: 22px; height: 22px; }
.topbar .title span { overflow: hidden; text-overflow: ellipsis; }
.topbar .topic { color: var(--text-3); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; padding-left: 12px; margin-left: 4px; border-left: 1px solid var(--border-strong); cursor: pointer; }
.topbar .tools { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.topbar .tools .icon-btn { width: 34px; height: 34px; }
.topbar .tools .icon-btn .ico { width: 22px; height: 22px; }
.topbar .search { width: 160px; height: 26px; border-radius: 5px; border: 0; background: var(--rail); padding: 0 8px; font-size: 13.5px; outline: none; transition: width .2s; margin-left: 6px; }
.topbar .search:focus { width: 240px; }
.mobile-only { display: none !important; }
.content { flex: 1; min-height: 0; display: flex; }
.chat { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.members { width: var(--members-w); flex: none; background: var(--bg-2); padding: 4px 8px 24px; }
.side-panel { width: min(460px, 38%); min-width: 340px; flex: none; border-left: 1px solid var(--border); display: flex; flex-direction: column; background: var(--bg); min-height: 0; }
.side-panel .topbar { padding-right: 8px; }

/* ---------- messages ---------- */
.messages { flex: 1; min-height: 0; padding: 0 0 16px; overflow-anchor: none; }
.chan-intro { padding: 40px 16px 12px; }
.chan-intro .big-icon { width: 68px; height: 68px; border-radius: 50%; background: var(--bg-3); display: grid; place-items: center; margin-bottom: 12px; color: var(--text); }
.chan-intro .big-icon .ico { width: 38px; height: 38px; }
.chan-intro h1 { margin: 0 0 6px; font-size: 30px; font-weight: 800; letter-spacing: -.01em; }
.chan-intro p { margin: 0; color: var(--text-2); }
.day-sep { display: flex; align-items: center; gap: 8px; margin: 22px 16px 6px; color: var(--text-3); font-size: 12px; font-weight: 600; }
.day-sep::before, .day-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.new-sep { display: flex; align-items: center; margin: 8px 16px 0; color: var(--red); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.new-sep::before { content: ''; flex: 1; height: 1px; background: var(--red); margin-right: 4px; }
.msg { position: relative; padding: 2px 48px 2px 72px; min-height: 22px; }
.msg.head { margin-top: 17px; }
.msg:hover { background: rgba(0, 0, 0, 0.08); }
:root[data-theme="light"] .msg:hover { background: rgba(0, 0, 0, 0.025); }
.msg.mentioned { background: var(--mention-bg); } .msg.mentioned::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--mention-bar); }
.msg.highlight { animation: flash 2s ease-out; }
@keyframes flash { from { background: var(--accent-soft); } to { background: transparent; } }
.msg.pending { opacity: .55; } .msg.failed .body { color: var(--red); }
.msg > .avatar { position: absolute; left: 16px; top: 4px; cursor: pointer; }
.msg .meta { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; line-height: 1.375; }
.msg .author { font-weight: 600; cursor: pointer; font-size: 1em; } .msg .author:hover { text-decoration: underline; }
.msg .time { font-size: 12px; color: var(--text-3); font-weight: 500; }
.msg .side-time { position: absolute; left: 0; width: 64px; text-align: center; font-size: 11px; color: var(--text-3); top: 5px; opacity: 0; }
.msg:hover .side-time { opacity: 1; }
.msg .body { white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; color: var(--text); }
.msg .body.jumbo .emoji { width: 48px; height: 48px; } .msg .body.jumbo { font-size: 44px; line-height: 1.2; }
.msg .edited { font-size: 11px; color: var(--text-3); margin-left: 4px; }
.msg.system { color: var(--text-2); padding-top: 4px; padding-bottom: 4px; display: flex; }
.msg.system .sys-ico { position: absolute; left: 28px; top: 6px; color: var(--text-3); width: 18px; height: 18px; }
.msg.system .sys-ico.green { color: var(--green); }
.compact-mode .msg { padding-left: 16px; } .compact-mode .msg > .avatar { display: none; } .compact-mode .msg.head { margin-top: 4px; }
.compact-mode .msg .meta { display: inline-flex; margin-right: 6px; } .compact-mode .msg .content-wrap { display: inline; }
.reply-ref { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-3); margin-bottom: 3px; cursor: pointer; position: relative; min-width: 0; }
.reply-ref::before { content: ''; position: absolute; left: -36px; top: 50%; width: 30px; height: 12px; border-left: 2px solid var(--border-strong); border-top: 2px solid var(--border-strong); border-top-left-radius: 6px; }
.reply-ref .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.reply-ref b { color: var(--text-2); }
.reply-ref:hover .txt { color: var(--text); }
.forwarded { border-left: 3px solid var(--border-strong); padding: 2px 0 2px 12px; margin: 2px 0 4px; }
.forwarded .fwd-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-style: italic; color: var(--text-3); margin-bottom: 2px; }
.forwarded .fwd-label .ico { width: 14px; height: 14px; }
.forwarded .fwd-foot { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.tag-pill { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 800; padding: 0 5px; height: 16px; border-radius: 4px; background: var(--bg-3); color: var(--text-2); vertical-align: 2px; letter-spacing: .02em; }
.tag-pill.bot { background: var(--accent); color: var(--accent-text); }
.tag-pill.bot .ico { width: 11px; height: 11px; }
.tag-pill img { width: 12px; height: 12px; border-radius: 3px; object-fit: cover; }
.badges { display: inline-flex; gap: 3px; vertical-align: -2px; }
.badge { width: 18px; height: 18px; display: inline-grid; place-items: center; }
.badge svg { width: 100%; height: 100%; }
.msg-tools { position: absolute; right: 14px; top: -18px; display: none; background: var(--bg-float); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.25); padding: 2px; z-index: 5; }
.msg:hover .msg-tools, .msg.menu-open .msg-tools { display: flex; }
.msg-tools .icon-btn { width: 32px; height: 32px; border-radius: 6px; }
.attachments { display: grid; gap: 6px; margin-top: 6px; max-width: 550px; }
.attachments.grid-2 { grid-template-columns: 1fr 1fr; } .attachments.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.att-img { position: relative; border-radius: 8px; overflow: hidden; cursor: zoom-in; background: var(--bg-2); width: fit-content; max-width: 100%; line-height: 0; }
.att-img img, .att-img video { display: block; max-width: min(550px, 100%); max-height: 350px; width: auto; height: auto; object-fit: contain; }
.attachments.grid-2 .att-img, .attachments.grid-3 .att-img { width: 100%; aspect-ratio: 1; }
.attachments.grid-2 .att-img img, .attachments.grid-3 .att-img img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; }
.att-video video { display: block; max-width: min(550px, 100%); max-height: 350px; width: auto; height: auto; border-radius: 8px; background: #000; }
.att-file { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-2); max-width: 432px; }
.att-file > .ico { color: var(--accent); width: 30px; height: 30px; }
.att-file .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-audio { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-2); max-width: 432px; }
.att-audio audio { width: 100%; margin-top: 6px; }
.voice-note { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 22px; background: var(--bg-2); border: 1px solid var(--border); width: fit-content; max-width: 360px; margin-top: 4px; }
.voice-note .play { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; flex: none; }
.voice-note .play .ico { width: 16px; height: 16px; }
.voice-note .bars { display: flex; align-items: center; gap: 2px; height: 28px; cursor: pointer; }
.voice-note .bars i { display: block; width: 3px; border-radius: 3px; background: var(--text-3); }
.voice-note .bars i.on { background: var(--accent); }
.voice-note .dur { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; min-width: 34px; }
.spoiler-media { filter: blur(44px); cursor: pointer; } .spoiler-wrap { position: relative; width: fit-content; } .spoiler-wrap::after { content: 'SPOILER'; position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; color: #fff; background: rgba(0,0,0,.45); pointer-events: none; border-radius: 8px; letter-spacing: .05em; font-size: 13px; } .spoiler-wrap.shown::after { display: none; } .spoiler-wrap.shown .spoiler-media { filter: none; }
.embed { margin-top: 6px; max-width: 520px; border-radius: 6px; background: var(--bg-2); border-left: 4px solid var(--embed-color, var(--border-strong)); padding: 10px 14px 14px 12px; display: grid; gap: 4px; }
.embed .site { font-size: 12px; color: var(--text-3); } .embed .etitle { font-weight: 600; color: var(--link); } .embed .edesc { font-size: 14px; color: var(--text-2); }
.embed img.thumb { max-width: 100%; max-height: 300px; width: auto; height: auto; border-radius: 6px; margin-top: 6px; object-fit: contain; }
.embed .yt { position: relative; aspect-ratio: 16 / 9; width: 100%; margin-top: 6px; border-radius: 6px; overflow: hidden; background: #000; cursor: pointer; }
.embed .yt img { width: 100%; height: 100%; object-fit: cover; opacity: .9; } .embed .yt iframe { width: 100%; height: 100%; border: 0; }
.embed .yt .play { position: absolute; inset: 0; margin: auto; width: 64px; height: 44px; border-radius: 12px; background: rgba(0,0,0,.72); display: grid; place-items: center; color: #fff; }
.gif-embed { display: block; margin-top: 6px; border-radius: 8px; max-width: min(320px, 100%); max-height: 320px; width: auto; height: auto; object-fit: contain; }
.sticker-img { width: 160px; height: 160px; object-fit: contain; margin-top: 4px; }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.reactions:empty { display: none; }
.reaction { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 7px; border-radius: 8px; background: var(--bg-2); border: 1px solid transparent; font-size: 14px; }
.reaction:hover { border-color: var(--border-strong); } .reaction.me { background: var(--accent-soft); border-color: var(--accent); }
.reaction .emoji { width: 18px; height: 18px; object-fit: contain; } .reaction .n { font-weight: 700; font-size: 13px; color: var(--text-2); } .reaction.me .n { color: var(--accent); }
.reaction.super { background: linear-gradient(90deg, rgba(255,197,49,.18), rgba(255,120,190,.18)); border-color: rgba(255,160,120,.6); }
.reaction.super.burst { animation: burst .7s ease-out; }
@keyframes burst { 0% { transform: scale(1); } 30% { transform: scale(1.35); filter: drop-shadow(0 0 8px #ffc531); } 100% { transform: scale(1); } }
.react-add { opacity: 0; } .msg:hover .react-add { opacity: 1; }
.thread-chip { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; padding: 8px 12px; border-radius: 8px; background: var(--bg-2); cursor: pointer; font-size: 14px; }
.thread-chip:hover { background: var(--bg-3); } .thread-chip b { color: var(--text); }
.components { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.poll { margin-top: 6px; max-width: 440px; border-radius: 10px; padding: 14px; background: var(--bg-2); }
.poll h4 { margin: 0 0 4px; font-size: 16px; } .poll .sub { font-size: 12.5px; color: var(--text-3); margin-bottom: 10px; }
.poll-opt { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; margin-top: 6px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); overflow: hidden; text-align: left; }
.poll-opt:hover { border-color: var(--border-strong); } .poll-opt.mine { border-color: var(--accent); }
.poll-opt .fill { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); transition: width .3s; }
.poll-opt > span { position: relative; } .poll-opt .pct { margin-left: auto; font-weight: 700; font-size: 13px; color: var(--text-2); }
.poll-opt .check { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; }
.poll-opt.mine .check { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.poll-opt .check .ico { width: 12px; height: 12px; }

/* markdown */
.md code { font-family: var(--mono); font-size: .86em; background: var(--code-bg); padding: 1px 5px; border-radius: 4px; }
.md pre { margin: 6px 0 2px; background: var(--code-bg); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; overflow-x: auto; white-space: pre; max-width: 100%; }
.md pre code { background: none; padding: 0; font-size: 13px; }
.md blockquote { margin: 2px 0; padding: 0 0 0 12px; border-left: 4px solid var(--border-strong); }
.md h1, .md h2, .md h3 { margin: 8px 0 2px; line-height: 1.25; } .md h1 { font-size: 1.5em; } .md h2 { font-size: 1.25em; } .md h3 { font-size: 1.1em; }
.md .subtext { font-size: 12.5px; color: var(--text-3); }
.md ul, .md ol { margin: 2px 0; padding-left: 22px; }
.md .spoiler { background: var(--bg-3); color: transparent; border-radius: 4px; cursor: pointer; padding: 0 2px; transition: background .1s; }
.md .spoiler.shown { background: var(--bg-active); color: inherit; }
.md .mention { background: var(--accent-soft); color: var(--accent); border-radius: 3px; padding: 0 2px; font-weight: 600; cursor: pointer; }
.md .mention:hover { background: var(--accent); color: var(--accent-text); }
.md .emoji { display: inline-block; width: 22px; height: 22px; vertical-align: -5px; object-fit: contain; }
.md a { word-break: break-all; }

/* ---------- composer ---------- */
.composer-wrap { flex: none; padding: 0 16px 22px; position: relative; }
.typing { height: 22px; font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; padding-left: 4px; position: absolute; left: 16px; bottom: 2px; }
.typing .dots { display: inline-flex; gap: 3px; } .typing .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--text-2); animation: blink 1.2s infinite; }
.typing .dots i:nth-child(2) { animation-delay: .2s; } .typing .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }
.composer { border-radius: 10px; background: var(--bg-3); }
.composer .bar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 13px; color: var(--text-3); background: var(--bg-2); border-radius: 10px 10px 0 0; }
.composer .bar b { color: var(--text); }
.composer .row-in { display: flex; align-items: flex-end; gap: 2px; padding: 4px 6px; }
.composer textarea { flex: 1; resize: none; border: 0; background: transparent; outline: none; padding: 10px 6px; max-height: 40vh; min-height: 22px; line-height: 1.375; }
.composer textarea::placeholder { color: var(--text-3); }
.composer .icon-btn { width: 38px; height: 40px; color: var(--text-2); }
.composer .icon-btn .ico { width: 23px; height: 23px; }
.composer .icon-btn:hover { background: none; color: var(--text); }
.composer .icon-btn.rec { color: var(--red); }
.composer .disabled-note { padding: 13px 16px; color: var(--text-3); display: flex; align-items: center; gap: 8px; justify-content: center; }
.recording { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 16px; color: var(--text-2); }
.recording .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: blink 1s infinite; }
.uploads { display: flex; gap: 10px; padding: 14px 12px 4px; overflow-x: auto; }
.upload-card { position: relative; width: 132px; flex: none; border-radius: 8px; background: var(--bg-2); padding: 8px; font-size: 12px; }
.upload-card .thumb { width: 100%; height: 96px; border-radius: 6px; background: var(--bg); display: grid; place-items: center; overflow: hidden; color: var(--text-3); }
.upload-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.upload-card .nm { margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-card .x { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; }
.upload-card .x .ico { width: 13px; height: 13px; }
.upload-card .prog { position: absolute; left: 8px; right: 8px; bottom: 30px; height: 4px; border-radius: 4px; background: var(--border); overflow: hidden; }
.upload-card .prog i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.autocomplete { position: absolute; left: 16px; right: 16px; bottom: calc(100% - 20px); background: var(--bg-float); border-radius: 8px; box-shadow: var(--shadow); padding: 6px; max-height: 340px; z-index: 20; }
.autocomplete .head { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-3); padding: 4px 8px 6px; }
.ac-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 5px; cursor: pointer; }
.ac-item.sel { background: var(--bg-active); }
.ac-item .desc { color: var(--text-3); font-size: 13px; margin-left: auto; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.ephemeral { margin: 8px 16px; padding: 10px 14px; border-radius: 8px; background: var(--accent-soft); font-size: 14px; }
.ephemeral .note { font-size: 12px; color: var(--text-3); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.ephemeral .note .ico { width: 13px; height: 13px; }

/* ---------- members list ---------- */
.mgroup { padding: 20px 8px 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--text-3); }
.mrow { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 8px; margin: 1px 0; border-radius: 6px; cursor: pointer; --status-ring: var(--bg-2); }
.mrow:hover { background: var(--bg-hover); }
.mrow.offline { opacity: .4; }
.mrow .nm { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.mrow .nm .ico { width: 14px; height: 14px; color: var(--yellow); flex: none; }
.mrow .st { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.mrow .st .ico { width: 13px; height: 13px; flex: none; }
.mrow .grow { line-height: 1.25; }

/* ---------- floating: menus, popovers, modals, toasts ---------- */
.layer { position: fixed; inset: 0; z-index: 100; }
.menu { position: fixed; min-width: 200px; max-width: 280px; background: var(--rail); border-radius: 8px; box-shadow: var(--shadow); padding: 6px 8px; z-index: 101; max-height: 80vh; overflow-y: auto; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border-radius: 4px; text-align: left; font-size: 14px; font-weight: 500; color: var(--text-2); }
.menu-item .ico { width: 18px; height: 18px; order: 2; margin-left: auto; opacity: .9; }
.menu-item .grow { order: 1; }
.menu-item .right { order: 1; margin-left: auto; font-size: 12px; opacity: .7; }
.menu-item:hover { background: var(--accent); color: var(--accent-text); }
.menu-item.danger { color: var(--red); } .menu-item.danger:hover { background: var(--red); color: #fff; }
.menu-sep { height: 1px; background: var(--border); margin: 4px 4px; }
.menu-label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-3); padding: 6px 8px 4px; }
.popover { position: fixed; z-index: 101; background: var(--bg-float); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden auto; max-height: calc(100vh - 16px); overscroll-behavior: contain; }
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 90; display: grid; place-items: center; padding: 16px; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 460px; max-width: 100%; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: var(--bg); border-radius: var(--radius-lg); box-shadow: var(--shadow); animation: pop .16s ease-out; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.modal.wide { width: 620px; } .modal.xwide { width: 860px; }
.modal-head { padding: 22px 22px 6px; text-align: left; } .modal-head h2 { margin: 0; font-size: 20px; font-weight: 800; } .modal-head p { margin: 6px 0 0; color: var(--text-2); font-size: 14px; }
.modal-body { padding: 12px 22px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-foot { padding: 14px 18px; display: flex; justify-content: flex-end; gap: 8px; background: var(--bg-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.modal .x { position: absolute; top: 14px; right: 14px; }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; background: var(--rail); color: var(--text); padding: 10px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); animation: pop .2s; max-width: 90vw; border-left: 3px solid var(--accent); }
.toast.error { border-left-color: var(--red); }
.tooltip { position: fixed; z-index: 300; background: var(--rail); color: var(--text); padding: 6px 10px; border-radius: 6px; font-size: 13.5px; font-weight: 600; pointer-events: none; white-space: nowrap; box-shadow: var(--shadow); }
.lightbox { position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,.88); display: grid; place-items: center; padding: 24px; }
.lightbox img, .lightbox video { max-width: 100%; max-height: calc(100dvh - 80px); width: auto; height: auto; object-fit: contain; border-radius: 4px; }
.lightbox .open { position: absolute; bottom: 16px; color: #fff; font-size: 14px; }

/* emoji / gif / sticker picker */
.picker { width: 420px; max-width: calc(100vw - 16px); height: 440px; display: flex; flex-direction: column; background: var(--bg-float); }
.picker-tabs { display: flex; gap: 4px; padding: 10px 10px 0; }
.picker-tabs button { padding: 6px 12px; border-radius: 5px; font-weight: 600; font-size: 14px; color: var(--text-3); }
.picker-tabs button.on { background: var(--bg-active); color: var(--text); }
.picker-search { margin: 10px; height: 32px; width: auto; background: var(--rail); }
.picker-body { flex: 1; min-height: 0; padding: 0 8px 8px; }
.picker-cat { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-3); padding: 10px 4px 4px; position: sticky; top: 0; background: var(--bg-float); z-index: 1; }
.emoji-grid { display: grid; grid-template-columns: repeat(9, 1fr); }
.emoji-grid button { aspect-ratio: 1; font-size: 26px; border-radius: 6px; display: grid; place-items: center; }
.emoji-grid button:hover { background: var(--bg-active); }
.emoji-grid img { width: 30px; height: 30px; object-fit: contain; }
.gif-grid { columns: 2; column-gap: 6px; }
.gif-grid img { width: 100%; height: auto; margin-bottom: 6px; border-radius: 6px; cursor: pointer; background: var(--bg-3); }
.sticker-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.sticker-grid button { aspect-ratio: 1; border-radius: 8px; padding: 6px; } .sticker-grid button:hover { background: var(--bg-active); }
.sticker-grid img { width: 100%; height: 100%; object-fit: contain; }
.picker-foot { height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--bg-2); font-size: 14px; color: var(--text-2); }
.picker-foot img { width: 24px; height: 24px; object-fit: contain; }
.super-toggle { display: flex; align-items: center; gap: 6px; margin-left: auto; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; padding: 4px 8px; border-radius: 5px; }
.super-toggle.on { background: linear-gradient(90deg, rgba(255,197,49,.25), rgba(255,120,190,.25)); color: var(--text); }
.super-toggle .ico { width: 16px; height: 16px; color: var(--accent); }

/* profile card */
.profile-card { width: 340px; max-width: calc(100vw - 16px); background: var(--bg-float); position: relative; overflow: hidden; }
.profile-card .banner { height: 120px; background: var(--pc1, var(--accent)); background-size: cover; background-position: center; }
.profile-card.themed { background: linear-gradient(180deg, var(--pc1), var(--pc2)); padding: 4px; }
.profile-card.themed .inner { background: color-mix(in srgb, var(--bg-float) 86%, transparent); border-radius: 8px; }
.profile-card.themed .banner { border-radius: 8px 8px 0 0; }
.profile-card .inner { padding: 0 16px 16px; position: relative; }
.profile-card .av-wrap { margin-top: -48px; width: fit-content; border-radius: 50%; border: 6px solid var(--bg-float); --status-ring: var(--bg-float); position: relative; z-index: 2; }
.profile-card .disp { font-size: 20px; font-weight: 800; margin-top: 10px; }
.profile-card .uname { color: var(--text-2); font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.profile-card .section { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.profile-card .section h5 { margin: 0 0 6px; font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--text-2); }
.profile-card .badge-row { position: absolute; right: 12px; top: 10px; display: flex; gap: 4px; background: rgba(0,0,0,.25); border-radius: 8px; padding: 4px 6px; }
.profile-card .badge-row .badge { width: 22px; height: 22px; }
.profile-card .note-input { width: 100%; background: transparent; border: 0; outline: none; resize: none; font-size: 13px; color: var(--text-2); padding: 4px 0; min-height: 22px; }
.profile-card .note-input:focus { background: var(--rail); border-radius: 4px; padding: 4px 6px; }
.role-chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 4px; background: var(--bg-3); font-size: 12.5px; font-weight: 600; margin: 0 4px 4px 0; }
.role-chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--gray); }
.custom-status { display: flex; align-items: center; gap: 6px; font-size: 14px; margin-top: 6px; }
.activity { display: flex; gap: 10px; align-items: center; }
.activity .act-ico { width: 44px; height: 44px; border-radius: 8px; background: var(--bg-3); display: grid; place-items: center; color: var(--text); }
.activity .act-ico .ico { width: 24px; height: 24px; }
/* profile effects */
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
.fx i { position: absolute; top: -10%; display: block; animation: fall linear infinite; opacity: .9; }
@keyframes fall { to { transform: translateY(560px) rotate(360deg); } }
.fx.sparkles i { width: 8px; height: 8px; background: #fff3b0; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation-name: twinkle; top: auto; }
@keyframes twinkle { 0%, 100% { transform: scale(.2); opacity: 0; } 50% { transform: scale(1.2); opacity: 1; } }
.fx.snow i { width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.fx.hearts i { width: 10px; height: 10px; background: #ff6b9a; clip-path: path('M5 9.5C2 7.3 0 5.6 0 3.3A2.8 2.8 0 0 1 5 1.6a2.8 2.8 0 0 1 5 1.7C10 5.6 8 7.3 5 9.5z'); animation-name: rise; top: auto; bottom: -10%; }
@keyframes rise { to { transform: translateY(-560px); opacity: 0; } }
.fx.confetti i { width: 6px; height: 10px; border-radius: 1px; }
.fx.embers i { width: 4px; height: 4px; border-radius: 50%; background: #ff8a3d; box-shadow: 0 0 6px #ff8a3d; animation-name: rise; top: auto; bottom: -10%; }
.fx.rain i { width: 2px; height: 14px; background: rgba(150, 200, 255, .7); }
.fx.petals i { width: 10px; height: 8px; border-radius: 80% 0 80% 0; background: #ffb3c8; }
.fx.aurora { background: linear-gradient(120deg, rgba(80,255,180,.0), rgba(80,255,180,.18), rgba(120,140,255,.22), rgba(255,120,220,.15), rgba(80,255,180,0)); background-size: 300% 300%; animation: aurora 6s ease-in-out infinite; mix-blend-mode: screen; }
@keyframes aurora { 50% { background-position: 100% 50%; } }

/* ---------- pages ---------- */
.page { flex: 1; min-height: 0; padding: 24px 28px; }
.page-inner { max-width: 1180px; margin: 0 auto; }
.tabs { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.tab { height: 28px; padding: 0 10px; border-radius: 5px; font-weight: 600; font-size: 15px; color: var(--text-2); }
.tab:hover { background: var(--bg-hover); color: var(--text); } .tab.on { background: var(--bg-active); color: var(--text); }
.tab.add { background: var(--green); color: #06210f; } .tab.add.on { background: transparent; color: var(--green); }
.topbar .sep { width: 1px; height: 24px; background: var(--border-strong); margin: 0 6px; }
.friend-row { display: flex; align-items: center; gap: 12px; padding: 0 10px; height: 62px; border-top: 1px solid var(--border); cursor: pointer; border-radius: 8px; --status-ring: var(--bg); }
.friend-row:hover { background: var(--bg-hover); border-top-color: transparent; }
.friend-row:hover + .friend-row { border-top-color: transparent; }
.friend-row .acts { display: flex; gap: 10px; } .friend-row .acts .icon-btn { background: var(--bg-2); border-radius: 50%; width: 36px; height: 36px; }
.friend-row:hover .acts .icon-btn { background: var(--rail); }
.discover-hero { position: relative; border-radius: 12px; padding: 40px 36px; background: var(--bg-2); margin-bottom: 20px; display: flex; align-items: center; gap: 24px; overflow: hidden; }
.discover-hero .txt { flex: 1; min-width: 0; position: relative; z-index: 1; }
.discover-hero h1 { margin: 0 0 6px; font-size: 32px; font-family: var(--display); font-weight: 900; letter-spacing: -.01em; }
.discover-hero p { margin: 0 0 18px; color: var(--text-2); }
.discover-hero input { max-width: 520px; height: 44px; background: var(--rail); }
.discover-hero .mascot { width: 150px; height: 136px; flex: none; color: var(--accent); }
.server-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; margin-top: 18px; }
.server-card { border-radius: 10px; overflow: hidden; background: var(--bg-2); cursor: pointer; transition: background .12s, transform .12s; display: flex; flex-direction: column; }
.server-card:hover { background: var(--rail); transform: translateY(-1px); }
.server-card .bn { height: 120px; background: var(--bg-3); background-size: cover; background-position: center; }
.server-card .ic { margin: -30px 0 0 14px; width: 60px; height: 60px; border-radius: 16px; border: 5px solid var(--bg-2); background: var(--bg); overflow: hidden; display: grid; place-items: center; font-weight: 800; }
.server-card:hover .ic { border-color: var(--rail); }
.server-card .ic img { width: 100%; height: 100%; object-fit: cover; }
.server-card .bd { padding: 8px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.server-card h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 6px; }
.server-card h3 .ico { width: 18px; height: 18px; color: var(--accent); }
.server-card p { margin: 0; color: var(--text-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.server-card .stats { margin-top: auto; display: flex; gap: 12px; font-size: 12.5px; color: var(--text-3); align-items: center; }
.server-card .stats .ico { width: 14px; height: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; vertical-align: 1px; margin-right: 4px; }
.card { border-radius: 10px; padding: 16px; background: var(--bg-2); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.stat { border-radius: 10px; padding: 14px 16px; background: var(--bg-2); }
.stat .v { font-size: 28px; font-weight: 800; } .stat .k { font-size: 13px; color: var(--text-3); }

/* inbox */
.inbox { width: 520px; max-width: calc(100vw - 16px); height: min(640px, 80vh); display: flex; flex-direction: column; background: var(--rail); }
.inbox-head { padding: 14px 16px 0; background: var(--bg-2); }
.inbox-head h3 { margin: 0 0 10px; display: flex; align-items: center; gap: 8px; font-size: 16px; }
.inbox-head .tabs { padding-bottom: 10px; }
.inbox-body { flex: 1; min-height: 0; padding: 8px; }
.inbox-item { border-radius: 8px; background: var(--bg); margin-bottom: 8px; overflow: hidden; }
.inbox-item .where { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 13px; font-weight: 700; color: var(--text-2); background: var(--bg-2); cursor: pointer; }
.inbox-item .where:hover { color: var(--text); }
.inbox-item .msg { padding-right: 16px; cursor: pointer; }

/* events */
.event-card { border-radius: 10px; background: var(--bg-2); padding: 16px; margin-bottom: 12px; display: grid; gap: 8px; }
.event-card .when { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; font-weight: 700; }
.event-card .when.live { color: var(--green); }
.event-card .when .ico { width: 16px; height: 16px; }
.event-card h3 { margin: 0; font-size: 18px; }
.event-card .where { display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 14px; }
.event-card .where .ico { width: 16px; height: 16px; }
.event-card .foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.event-banner { margin: 0 8px 6px; padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, var(--green) 14%, var(--bg-2)); font-size: 13px; cursor: pointer; }
.event-banner b { display: block; color: var(--text); font-size: 14px; }

/* soundboard */
.soundboard { width: 400px; max-width: calc(100vw - 16px); padding: 12px; max-height: 70vh; overflow-y: auto; background: var(--bg-float); }
.sound-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.sound-btn { height: 46px; border-radius: 8px; background: var(--bg-3); font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 6px; padding: 0 10px; overflow: hidden; }
.sound-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sound-btn:hover { background: var(--accent); color: var(--accent-text); }
.sound-btn .ico { width: 16px; height: 16px; flex: none; }

/* decorations picker */
.deco-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.deco-opt { border-radius: 10px; background: var(--bg-2); padding: 14px 8px 8px; display: grid; justify-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-2); border: 2px solid transparent; }
.deco-opt:hover { background: var(--bg-3); }
.deco-opt.on { border-color: var(--accent); color: var(--text); }

/* settings */
.settings { position: fixed; inset: 0; z-index: 80; display: flex; background: var(--bg); animation: fade .15s; }
.settings-nav { width: max(260px, calc((100vw - 980px) / 2 + 220px)); flex: none; background: var(--bg-2); padding: 56px 8px 24px 20px; display: flex; flex-direction: column; align-items: flex-end; }
.settings-nav > * { width: 200px; }
.settings-nav .grp { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-3); padding: 14px 10px 6px; }
.settings-nav button { text-align: left; padding: 7px 10px; border-radius: 5px; color: var(--text-2); font-weight: 500; margin: 1px 0; display: flex; align-items: center; gap: 8px; font-size: 15px; }
.settings-nav button:hover { background: var(--bg-hover); color: var(--text); } .settings-nav button.on { background: var(--bg-active); color: var(--text); }
.settings-nav button.danger { color: var(--red); }
.settings-main { flex: 1; min-width: 0; padding: 56px 40px 80px; }
.settings-main .inner { max-width: 740px; }
.settings-main h2 { margin: 0 0 20px; font-size: 20px; font-weight: 800; }
.settings-main h3 { margin: 28px 0 12px; font-size: 16px; }
.settings-close { position: fixed; top: 56px; right: 40px; display: grid; justify-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text-3); z-index: 2; }
.settings-close .icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--text-3); color: var(--text-2); }
.save-bar { position: sticky; bottom: 16px; margin-top: 24px; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 18px; border-radius: 8px; background: var(--rail); box-shadow: var(--shadow); animation: pop .2s; }
.img-pick { position: relative; cursor: pointer; width: fit-content; }
.img-pick .hover { position: absolute; inset: 0; border-radius: inherit; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 800; text-transform: uppercase; opacity: 0; transition: opacity .15s; text-align: center; padding: 4px; }
.img-pick:hover .hover { opacity: 1; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-bottom: 1px solid var(--border); }
.list-row:hover { background: var(--bg-hover); }
.perm-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.perm-row .grow > div:first-child { font-weight: 600; } .perm-row .hint { margin-top: 2px; }
.tri { display: inline-flex; border-radius: 6px; overflow: hidden; flex: none; background: var(--bg-2); }
.tri button { width: 34px; height: 30px; display: grid; place-items: center; color: var(--text-3); }
.tri button .ico { width: 15px; height: 15px; }
.tri button.on.deny { background: var(--red); color: #fff; } .tri button.on.neutral { background: var(--bg-3); color: var(--text); } .tri button.on.allow { background: var(--green); color: #06210f; }
.split { display: grid; grid-template-columns: 220px 1fr; gap: 20px; }
.role-list button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border-radius: 5px; text-align: left; font-weight: 500; }
.role-list button:hover { background: var(--bg-hover); } .role-list button.on { background: var(--bg-active); }
.role-list i { width: 12px; height: 12px; border-radius: 50%; background: var(--gray); flex: none; }
.color-swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.color-swatches button { width: 34px; height: 34px; border-radius: 6px; border: 2px solid transparent; }
.color-swatches button.on { border-color: var(--text); }
.audit-row { display: flex; gap: 12px; padding: 12px 8px; border-bottom: 1px solid var(--border); font-size: 14px; }

/* voice / video */
.voice-stage { flex: 1; min-height: 0; background: #0b0b0d; color: #fff; display: flex; flex-direction: column; position: relative; }
.voice-grid { flex: 1; min-height: 0; padding: 16px; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-content: center; overflow-y: auto; }
.tile { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; background: #1c1d22; overflow: hidden; display: grid; place-items: center; --status-ring: #1c1d22; }
.tile.speaking { box-shadow: 0 0 0 3px var(--green) inset; }
.tile video { width: 100%; height: 100%; object-fit: cover; } .tile video.screen { object-fit: contain; background: #000; }
.tile .tile-name { position: absolute; left: 10px; bottom: 10px; display: flex; align-items: center; gap: 6px; background: rgba(0,0,0,.6); padding: 4px 10px; border-radius: 6px; font-size: 13px; font-weight: 600; }
.tile .tile-name .ico { width: 15px; height: 15px; color: #ff8b8f; }
.tile.focus { grid-column: 1 / -1; aspect-ratio: auto; height: 62vh; }
.tile .avatar { width: 84px; height: 84px; font-size: 84px; }
.tile .hand { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; }
.tile .hand .ico { width: 18px; height: 18px; }
.voice-ctrls { flex: none; display: flex; justify-content: center; gap: 10px; padding: 16px; }
.voice-ctrls .round { width: 52px; height: 52px; border-radius: 50%; background: #26272d; color: #fff; display: grid; place-items: center; }
.voice-ctrls .round:hover { background: #33343b; } .voice-ctrls .round.on { background: #fff; color: #111; } .voice-ctrls .round.off { background: #3a2124; color: #ff6b70; }
.voice-ctrls .round.leave { background: var(--red); color: #fff; width: 64px; border-radius: 26px; } .voice-ctrls .round .ico { width: 24px; height: 24px; }
.voice-join { flex: 1; display: grid; place-content: center; justify-items: center; text-align: center; gap: 12px; padding: 24px; }
.voice-join h2 { margin: 0; font-size: 24px; }
.voice-join .art-icon { width: 76px; height: 76px; border-radius: 50%; background: #1c1d22; display: grid; place-items: center; }
.voice-join .art-icon .ico { width: 38px; height: 38px; }
.stage-section { padding: 8px 16px; } .stage-section h4 { margin: 8px 0; font-size: 12px; text-transform: uppercase; color: #9a9ba3; letter-spacing: .04em; }
.stage-people { display: flex; flex-wrap: wrap; gap: 16px; }
.stage-person { width: 96px; text-align: center; font-size: 13px; position: relative; cursor: pointer; }
.stage-person .avatar { margin: 0 auto 6px; --status-ring: #0b0b0d; }
.stage-person .hand { position: absolute; top: 0; right: 14px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; }
.stage-person .hand .ico { width: 14px; height: 14px; }
.call-ring { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 160; background: var(--rail); border-radius: 14px; box-shadow: var(--shadow); padding: 16px 20px; display: flex; align-items: center; gap: 16px; animation: pop .2s; }
.call-ring .acts { display: flex; gap: 10px; } .call-ring .acts button { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.dm-call { background: #0b0b0d; color: #fff; height: 46%; min-height: 260px; display: flex; flex-direction: column; flex: none; }

/* auth */
.auth-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--rail); overflow-y: auto; position: relative; }
.auth-card { width: 480px; max-width: 100%; background: var(--bg); border-radius: 10px; padding: 32px; box-shadow: var(--shadow); position: relative; z-index: 1; }
.auth-card h1 { margin: 0 0 4px; font-size: 24px; text-align: center; font-weight: 800; }
.auth-card .sub { text-align: center; color: var(--text-2); margin: 0 0 22px; }
.auth-card .logo { width: 64px; height: 64px; margin: 0 auto 14px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12px; font-weight: 700; margin: 18px 0; text-transform: uppercase; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.btn.discord { background: #5865f2; color: #fff; } .btn.discord:hover { background: #4752c4; }
.bday { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 8px; }
.switch-auth { text-align: center; margin-top: 18px; font-size: 14px; color: var(--text-2); }
.switch-auth button { color: var(--link); font-weight: 600; }
.loading-screen { height: 100dvh; display: grid; place-items: center; gap: 16px; background: var(--rail); text-align: center; }
.loading-screen .logo { width: 72px; height: 72px; margin: 0 auto 8px; animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }
.banner-strip { flex: none; padding: 8px 16px; font-size: 14px; display: flex; align-items: center; gap: 10px; background: var(--accent); color: var(--accent-text); font-weight: 600; }
.banner-strip button { text-decoration: underline; font-weight: 700; }

/* forum */
.forum-list { padding: 16px; display: grid; gap: 8px; }
.forum-post { border-radius: 8px; padding: 14px 16px; background: var(--bg-2); cursor: pointer; display: grid; gap: 6px; }
.forum-post:hover { background: var(--rail); }
.forum-post h3 { margin: 0; font-size: 16px; } .forum-post .prev { color: var(--text-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.forum-post .foot { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-3); }
.forum-post .foot .ico { width: 15px; height: 15px; }

/* ---------- mobile ---------- */
@media (max-width: 1100px) {
  .members { display: none; }
  .members.open { display: block; position: absolute; right: 0; top: 48px; bottom: 0; z-index: 30; box-shadow: var(--shadow); }
  .side-panel { position: absolute; right: 0; top: 0; bottom: 0; z-index: 35; width: min(460px, 100%); min-width: 0; box-shadow: var(--shadow); }
}
@media (max-width: 760px) {
  .mobile-only { display: inline-grid !important; }
  .desktop-only { display: none !important; }
  #app { position: relative; }
  .nav-drawer { position: absolute; inset: 0 auto 0 0; z-index: 40; transform: translateX(-100%); transition: transform .22s ease; width: calc(100vw - 56px); max-width: 340px; box-shadow: var(--shadow); }
  .nav-drawer .sidebar { flex: 1; width: auto; border-radius: 0; }
  #app.drawer-open .nav-drawer { transform: none; }
  #app.drawer-open .main::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.5); z-index: 39; }
  .main { width: 100vw; flex: none; }
  .msg { padding-right: 12px; padding-left: 62px; } .msg > .avatar { left: 12px; } .msg .side-time { width: 58px; }
  .msg-tools { right: 8px; }
  .topbar .topic, .topbar .search { display: none; }
  .topbar .tools { gap: 0; flex: none; } .topbar .tools .icon-btn { width: 32px; }
  .composer-wrap { padding: 0 8px calc(10px + env(safe-area-inset-bottom)); }
  .settings { flex-direction: column; }
  .settings-nav { width: 100%; padding: 12px; flex-direction: row; overflow-x: auto; flex: none; scrollbar-width: none; align-items: center; }
  .settings-nav > * { width: auto; }
  .settings-nav .grp { display: none; } .settings-nav button { white-space: nowrap; }
  .settings-main { padding: 20px 16px 80px; }
  .settings-close { top: auto; bottom: 16px; right: 16px; }
  .split { grid-template-columns: 1fr; }
  .page { padding: 16px; }
  .discover-hero { padding: 24px 20px; } .discover-hero .mascot { display: none; }
  .tile.focus { height: 40vh; }
  .modal-back { align-items: end; padding: 0; }
  .modal { border-radius: 16px 16px 0 0; max-height: 92dvh; width: 100%; }
  .modal-foot { border-radius: 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .picker, .inbox, .soundboard { width: 100vw; }
  .side-panel { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.logo { display: block; } .logo svg { width: 100%; height: 100%; display: block; }
.deco .spin { transform-origin: 60px 60px; animation: spin 9s linear infinite; }
.msg > .avatar .deco, .mrow .avatar .deco { inset: -19%; }

/* Official server shows the Gabble logo when it has no icon */
.main-logo { display: block; width: 100%; height: 100%; } .main-logo svg { width: 100%; height: 100%; display: block; }

/* ---------- Admin panel ---------- */
.admin-tabs { overflow-x: auto; scrollbar-width: none; }
.admin-tabs .tab { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.page-inner.admin { display: grid; gap: 16px; align-content: start; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
button.chip { border: 0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; }
button.chip:hover:not(.on) { background: var(--border-strong); color: var(--text); }
.stat-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.stat { display: flex; align-items: center; gap: 14px; border: 1px solid var(--border); }
.stat.click { cursor: pointer; transition: border-color .15s, transform .15s; } .stat.click:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.stat-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-3); color: var(--text-2); flex: none; }
.stat.green .stat-ico { background: rgba(61, 204, 126, .15); color: var(--green); }
.stat.red .stat-ico { background: rgba(242, 85, 90, .15); color: var(--red); }
.stat .v { font-size: 24px; line-height: 1.1; }
.admin-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.card-title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 16px; }
.card-title .ico { color: var(--accent); }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 190px; align-items: end; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 46px; border-radius: 8px 8px 4px 4px; background: linear-gradient(var(--accent), #ff9a1a); min-height: 4px; }
.bar-n { font-size: 12px; font-weight: 700; color: var(--text-2); } .bar-l { font-size: 12px; color: var(--text-3); }
.list-row.tight { padding: 8px 4px; gap: 10px; }
.rank { width: 22px; text-align: center; font-weight: 800; color: var(--text-3); }
.mini-icon { width: 32px; height: 32px; border-radius: 10px; background: var(--bg-3); display: grid; place-items: center; font-size: 12px; font-weight: 800; overflow: hidden; flex: none; }
.mini-icon.lg { width: 44px; height: 44px; border-radius: 14px; font-size: 14px; }
.mini-icon img { width: 100%; height: 100%; object-fit: cover; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mono { font-family: var(--mono); }
.gap6 { gap: 6px; }
.admin-search { display: flex; align-items: center; gap: 10px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; }
.admin-search .ico { color: var(--text-3); }
.admin-search .input { border: 0; background: transparent; padding-left: 0; box-shadow: none; }
.admin-list { background: var(--bg-2); border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.admin-list > .empty, .admin-list > .empty-state { padding: 32px; }
.admin-row { width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--border); color: inherit; font: inherit; padding: 12px 14px; cursor: pointer; }
div.admin-row { cursor: default; }
.admin-row:last-child { border-bottom: 0; }
.pill-tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--bg-3); color: var(--text-2); white-space: nowrap; }
.pill-tag .ico { width: 13px; height: 13px; color: var(--accent); }
.pill-tag.gold { background: var(--accent-soft); color: var(--accent); }
.pill-tag.orange { background: rgba(242, 169, 59, .16); color: var(--yellow); }
.pill-tag.red { background: rgba(242, 85, 90, .16); color: var(--red); }
.admin-user { display: grid; gap: 14px; }
.au-head { display: flex; align-items: center; gap: 16px; }
.au-name { font-family: var(--display); font-size: 22px; font-weight: 900; }
.mini-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.mini-stat { background: var(--bg-2); border-radius: 10px; padding: 10px 12px; }
.mini-stat .v { font-size: 20px; font-weight: 800; } .mini-stat .k { font-size: 12px; color: var(--text-3); }
.au-sec { margin: 14px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.au-action { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.au-action .select { width: auto; height: 34px; }
.au-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.au-msgs { display: grid; gap: 6px; max-height: 280px; overflow: auto; }
.au-msg { background: var(--bg-2); border-radius: 8px; padding: 8px 12px; overflow-wrap: anywhere; }
.admin-section { display: grid; gap: 10px; }
.admin-section .hint { margin: -6px 0 4px; }
.admin-section > .btn { justify-self: start; }
@media (max-width: 860px) {
  .admin-cols { grid-template-columns: 1fr; }
  .mini-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .au-head { flex-wrap: wrap; }
  .au-action { flex-wrap: wrap; }
  .admin-tabs .tab span { display: none; }
}

/* ---------- Site-wide announcement banner ---------- */
.shell { display: flex; flex-direction: column; height: 100dvh; }
.shell > #app { flex: 1; height: auto; min-height: 0; }
.site-banner { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 36px; padding: 6px 44px; font-size: 14px; font-weight: 600; text-align: center; position: relative; flex: none;
  background: #4a55e8; color: #fff; }
.site-banner.good { background: #2fa866; } .site-banner.warn { background: #e0573b; }
.site-banner a, .site-banner u { color: inherit; text-decoration: underline; font-weight: 800; }
.site-banner .ico { width: 16px; height: 16px; flex: none; }
.site-banner .x { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: inherit; cursor: pointer; opacity: .8; display: grid; padding: 4px; }
.site-banner .x:hover { opacity: 1; }
.site-banner.static { border-radius: 8px; padding: 8px 14px; }
.maint { min-height: 100dvh; display: grid; place-items: center; text-align: center; padding: 24px; background: var(--rail); }
.maint .logo { width: 84px; height: 84px; margin: 0 auto 18px; }
.maint h1 { font-family: var(--display); font-weight: 900; margin: 0 0 8px; }
.maint p { color: var(--text-2); max-width: 420px; margin: 0 auto; }
.au-head > * { flex-shrink: 0; } .au-head > .grow { flex-shrink: 1; min-width: 0; }

/* Invite-a-friend */
.invite-hero { display: flex; align-items: center; gap: 20px; padding: 20px; border-radius: 14px; margin-bottom: 18px; background: linear-gradient(135deg, rgba(139, 92, 246, .28), rgba(255, 197, 49, .14)); border: 1px solid var(--border); }
.invite-hero h3 { margin: 0 0 4px; font-family: var(--display); font-size: 20px; }
.invite-hero p { margin: 0; }
.progress { height: 10px; border-radius: 99px; background: var(--bg-3); overflow: hidden; margin-top: 10px; }
.progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #8b5cf6, var(--accent)); }
.deco-opt.locked { opacity: .55; }
.deco-opt.locked:hover { opacity: .8; }

/* Badge cards (click a badge) */
button.badge { background: none; border: 0; padding: 0; cursor: pointer; transition: transform .12s; }
button.badge:hover { transform: translateY(-2px) scale(1.08); }
.badge-card { width: 260px; padding: 22px 20px 20px; text-align: center; }
.bc-art { width: 110px; height: 110px; margin: 0 auto 14px; filter: drop-shadow(0 10px 16px rgba(0,0,0,.4)); }
.bc-art svg { width: 100%; height: 100%; display: block; }
.bc-cat { color: var(--text-2); font-weight: 600; font-size: 15px; }
.bc-name { font-family: 'Unbounded', var(--display); font-weight: 900; text-transform: uppercase; font-size: 22px; line-height: 1.15; margin: 4px 0 6px; letter-spacing: .01em; }
.bc-stat { color: var(--text-2); font-size: 15px; }

/* Quests page */
.page-inner.quests { display: grid; gap: 14px; align-content: start; }
.quest-hero { display: flex; align-items: center; gap: 20px; padding: 24px; border-radius: 16px; background: linear-gradient(135deg, rgba(124, 58, 237, .35), rgba(255, 197, 49, .14)); border: 1px solid var(--border); }
.quest-hero h2 { margin: 0 0 4px; font-family: 'Unbounded', var(--display); font-weight: 900; text-transform: uppercase; font-size: 26px; }
.quest-hero p { margin: 0; max-width: 46em; }
.quest-count { text-align: center; background: rgba(0,0,0,.25); border-radius: 14px; padding: 10px 18px; }
.quest-count b { display: block; font-size: 26px; font-family: 'Unbounded', var(--display); }
.quest-count span { font-size: 12px; color: var(--text-2); }
.section-h { margin: 10px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.quest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.quest-card { display: flex; gap: 16px; align-items: flex-start; padding: 16px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--border); }
.quest-card.ready { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.quest-art { width: 64px; height: 64px; flex: none; background: none; border: 0; padding: 0; cursor: pointer; filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); transition: transform .12s; }
.quest-art:hover { transform: scale(1.06); }
.quest-art svg { width: 100%; height: 100%; display: block; }
.quest-art.dim { filter: grayscale(1) brightness(.6); }
.tier-name { font-family: 'Unbounded', var(--display); font-weight: 900; text-transform: uppercase; font-size: 17px; margin: 2px 0; }
.tier-dots { display: flex; gap: 5px; margin-top: 8px; }
.tier-dots i { width: 18px; height: 5px; border-radius: 9px; background: var(--bg-3); }
.tier-dots i.on { background: var(--accent); }
