/* ---------- font (Inter, bundled; OFL license in /fonts) ---------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/inter-latin-wght-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/inter-latin-ext-wght-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- themes ---------- */
:root {
  --bg0: #111214; --bg1: #17181b; --bg2: #1e2024; --bg3: #26292e; --bg4: #30343a;
  --line: #2c2f35; --text: #e8e6e3; --text-2: #c9c7c3; --muted: #8e939b;
  --hover: rgba(255,255,255,.035); --shadow: rgba(0,0,0,.45); --scrim: rgba(0,0,0,.6);
  --accent: #ff8a3d; --on-accent: #1a1006;
  --accent-2: color-mix(in srgb, var(--accent) 70%, white);
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --green: #3ecf8e; --red: #f05d5e; --yellow: #f2c14e; --blue: #61afef;
  --mention-bg: rgba(242,193,78,.08); --code-bg: var(--bg0);
  --radius: 10px; --chat-fs: 15px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  color-scheme: dark;
}
:root[data-theme="darker"] {
  --bg0: #000000; --bg1: #0b0b0d; --bg2: #111214; --bg3: #1b1d20; --bg4: #262a2f; --line: #1f2125;
}
:root[data-theme="light"] {
  --bg0: #e3e5e8; --bg1: #f2f3f5; --bg2: #ffffff; --bg3: #e8e9ec; --bg4: #d5d7db;
  --line: #dadce0; --text: #1e2023; --text-2: #3a3d42; --muted: #676c75;
  --hover: rgba(0,0,0,.035); --shadow: rgba(0,0,0,.16); --scrim: rgba(20,22,26,.45);
  --accent-2: color-mix(in srgb, var(--accent) 78%, black);
  --mention-bg: rgba(242,193,78,.16); --code-bg: #f1f2f4;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg0); color: var(--text); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent-2); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.spacer { flex: 1; }
.grow { flex: 1; min-width: 0; }
.pad { padding: 8px 10px; }
.col { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.warn { color: var(--yellow); }
.ic { flex: none; display: block; }
::selection { background: var(--accent-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- buttons & inputs ---------- */
.btn { border: 0; border-radius: 8px; padding: 9px 14px; background: var(--bg4); cursor: pointer; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: filter .12s, background .12s, transform .06s; }
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.danger { background: var(--red); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--hover); filter: none; }
.btn.xs { padding: 4px 10px; font-size: 12.5px; }
.btn.small-btn { padding: 5px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; color: var(--muted); display: grid; place-items: center; flex: none; text-decoration: none; transition: background .12s, color .12s; padding: 0; }
.icon-btn:hover { background: var(--bg3); color: var(--text); }
.icon-btn.on { color: var(--red); background: color-mix(in srgb, var(--red) 13%, transparent); }
.icon-btn.on-live { color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); }
.icon-btn.on-green { color: var(--green); background: color-mix(in srgb, var(--green) 13%, transparent); }
.icon-btn.danger:hover { color: var(--red); }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
label .hint { font-weight: 400; font-size: 12px; }
input, textarea, select { background: var(--bg0); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; outline: none; color: var(--text); transition: border-color .12s, box-shadow .12s; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; }
input[type=range] { padding: 0; border: 0; accent-color: var(--accent); background: transparent; box-shadow: none; }
input[type=color] { width: 36px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; box-shadow: none; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
.error { color: var(--red); font-size: 13px; min-height: 1em; }

/* ---------- auth ---------- */
.auth { min-height: 100%; display: grid; place-items: center; padding: 16px; background: radial-gradient(900px 500px at 20% 0%, var(--accent-soft), transparent 60%), var(--bg0); }
.auth-card { width: 100%; max-width: 380px; background: var(--bg1); border: 1px solid var(--line); border-radius: 18px; padding: 28px; display: grid; gap: 12px; box-shadow: 0 20px 60px var(--shadow); animation: pop-in .25s ease-out; }
.brand { font-size: 22px; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; }
.logo { color: var(--accent); flex: none; }
.invite-card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); }
.invite-card .sicon { width: 48px; height: 48px; border-radius: 14px; background: var(--bg3); font-size: 15px; }
.invite-card b { display: block; font-size: 16px; }
.dotline { display: inline-flex; align-items: center; gap: 6px; }
.dotline .dot { width: 8px; height: 8px; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 72px 248px 1fr 240px; height: 100dvh; overflow: hidden; }
.app.no-panel { grid-template-columns: 72px 248px 1fr 0; }
.app.no-panel .side-panel { display: none; }
.app.no-side { grid-template-columns: 72px 248px 1fr 0; }
.app.no-side .side-panel { display: none; }

/* rail */
.rail { background: var(--bg0); padding: 12px 0; display: flex; flex-direction: column; align-items: center; gap: 8px; overflow-y: auto; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
#serverIcons { display: flex; flex-direction: column; gap: 8px; }
.rail-sep { width: 30px; height: 2px; border-radius: 2px; background: var(--bg3); flex: none; }
.rail-btn { width: 48px; height: 48px; border-radius: 16px; border: 0; background: var(--bg2); cursor: pointer; position: relative; padding: 0; display: grid; place-items: center; transition: border-radius .18s, background .15s, color .15s; flex: none; color: var(--text); }
.rail-btn:hover { background: var(--bg3); border-radius: 13px; }
.rail-btn.active { border-radius: 13px; box-shadow: 0 0 0 2px var(--accent); background: var(--bg3); }
.rail-btn.home { color: var(--muted); }
.rail-btn.home.active, .rail-btn.home:hover { color: var(--accent); }
.rail-btn::before { content: ""; position: absolute; left: -12px; top: 50%; width: 5px; height: 0; margin-top: 0; border-radius: 0 4px 4px 0; background: var(--text); transition: height .15s, margin-top .15s; }
.rail-btn.unread::before { height: 10px; margin-top: -5px; }
.rail-btn:hover::before { height: 20px; margin-top: -10px; }
.rail-btn.active::before { height: 36px; margin-top: -18px; background: var(--accent); }
.rail-btn .badge { position: absolute; right: -6px; bottom: -4px; border: 3px solid var(--bg0); }
.rail-btn .rail-voice { position: absolute; left: -4px; bottom: -4px; color: #0b1f14; background: var(--green); border-radius: 50%; width: 18px; height: 18px; display: grid; place-items: center; border: 2px solid var(--bg0); }
.rail-btn.muted-srv { opacity: .55; }
.rail-btn.add { color: var(--green); background: var(--bg2); }
.rail-btn.add:hover { background: var(--green); color: #0b1f14; }
.sicon { width: 100%; height: 100%; border-radius: inherit; display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: .02em; overflow: hidden; }
.rail-btn .sicon { border-radius: inherit; }
.sicon img { width: 100%; height: 100%; object-fit: cover; }
.sicon.xs { width: 18px; height: 18px; border-radius: 5px; font-size: 8px; background: var(--bg3); }
.sicon.xl { width: 88px; height: 88px; border-radius: 22px; font-size: 26px; background: var(--bg3); }
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; line-height: 1; flex: none; }

/* sidebar */
.sidebar { background: var(--bg1); display: flex; flex-direction: column; min-width: 0; }
.sidebar-head { height: 52px; padding: 0 8px 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 6px; border-bottom: 1px solid var(--line); font-weight: 700; flex: none; position: relative; }
.sidebar-head.has-banner { height: 120px; align-items: flex-end; padding-bottom: 10px; border-bottom: 0; background-size: cover; background-position: center; color: #fff; }
.sidebar-head.has-banner::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 30%, rgba(0,0,0,.7)); }
.sidebar-head.has-banner > * { position: relative; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.sidebar-head.has-banner .icon-btn { color: #fff; }
.sh-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.sh-name.click { cursor: pointer; display: flex; align-items: center; gap: 4px; }
.channels { flex: 1; overflow-y: auto; padding: 8px 8px 12px; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--muted); cursor: pointer; font-weight: 600; font-size: 14px; }
.side-link:hover { background: var(--hover); color: var(--text); }
.side-link .badge { margin-left: auto; background: var(--accent); color: var(--on-accent); }
.cat { display: flex; align-items: center; gap: 2px; padding: 14px 4px 4px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); user-select: none; }
.cat.click { cursor: pointer; }
.cat.click:hover { color: var(--text); }
.cat .cat-name { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cat .chev { transition: transform .15s; }
.cat.collapsed .chev { transform: rotate(-90deg); }
.cat .icon-btn { width: 22px; height: 22px; visibility: hidden; }
.cat:hover .icon-btn { visibility: visible; }
.chan { display: flex; align-items: center; gap: 8px; padding: 6px 8px; margin: 1px 0; border-radius: 8px; color: var(--muted); cursor: pointer; user-select: none; position: relative; }
.chan:hover { background: var(--hover); color: var(--text); }
.chan.active { background: var(--bg3); color: var(--text); }
.chan.unread { color: var(--text); font-weight: 700; }
.chan.unread::before { content: ""; position: absolute; left: -8px; top: 50%; margin-top: -4px; width: 4px; height: 8px; border-radius: 0 4px 4px 0; background: var(--text); }
.chan.muted-ch { opacity: .5; }
.chan .ico { display: grid; place-items: center; opacity: .85; }
.chan .name { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chan .cog { visibility: hidden; width: 22px; height: 22px; }
.chan:hover .cog, .chan.active .cog { visibility: visible; }
.chan .lock { opacity: .6; }
.chan.thread-row { margin-left: 22px; padding-top: 4px; padding-bottom: 4px; font-size: 13.5px; }
.chan.thread-row::after { content: ""; position: absolute; left: -12px; top: -6px; width: 10px; height: 18px; border-left: 2px solid var(--bg4); border-bottom: 2px solid var(--bg4); border-bottom-left-radius: 6px; }
.vusers { padding: 2px 0 6px 26px; display: grid; gap: 1px; }
.vuser { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); padding: 3px 6px; border-radius: 6px; cursor: pointer; min-width: 0; }
.vuser:hover { background: var(--hover); color: var(--text); }
.vuser .flags { margin-left: auto; display: flex; gap: 4px; align-items: center; flex: none; color: var(--muted); }
.dm-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; color: var(--muted); cursor: pointer; position: relative; margin: 1px 0; }
.dm-row:hover { background: var(--hover); color: var(--text); }
.dm-row.active { background: var(--bg3); color: var(--text); }
.dm-row.unread { color: var(--text); }
.dm-row.unread .dm-name { font-weight: 700; }
.dm-txt { flex: 1; min-width: 0; }
.dm-name, .dm-sub { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dm-sub { font-size: 12px; color: var(--muted); }
.dm-x { visibility: hidden; width: 22px; height: 22px; }
.dm-row:hover .dm-x { visibility: visible; }
.dm-call { color: var(--green); }

/* voice bar */
.voice-bar { padding: 8px 10px; border-top: 1px solid var(--line); background: var(--bg1); display: grid; gap: 6px; }
.vb-top { display: flex; align-items: center; gap: 8px; }
.vb-info { flex: 1; min-width: 0; }
.vb-status { color: var(--green); font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.vb-chan { cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.vb-chan:hover { color: var(--text); text-decoration: underline; }
.vb-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.vb-btns .icon-btn { width: 100%; background: var(--bg2); }
.vb-btns .icon-btn:hover { background: var(--bg3); }
#hangupBtn { color: var(--red); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.live { background: var(--green); box-shadow: 0 0 8px var(--green); }

/* user panel */
.me { display: flex; align-items: center; gap: 2px; padding: 8px; background: var(--bg0); }
:root[data-theme="light"] .me { background: var(--bg3); }
.me-wrap { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; padding: 4px; border-radius: 8px; cursor: pointer; }
.me-wrap:hover { background: var(--hover); }
.me-txt { min-width: 0; }
.me-name { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-sub { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* avatars */
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #111; flex: none; font-size: 14px; position: relative; user-select: none; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar.xxs { width: 16px; height: 16px; font-size: 9px; }
.avatar.xs { width: 22px; height: 22px; font-size: 11px; }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.avatar.md { width: 40px; height: 40px; }
.avatar.lg { width: 56px; height: 56px; font-size: 22px; }
.avatar.xl { width: 80px; height: 80px; font-size: 30px; }
.avatar.xxl { width: 92px; height: 92px; font-size: 34px; }
.avatar.group { color: #fff; }
.avatar.speaking { box-shadow: 0 0 0 2px var(--bg1), 0 0 0 4px var(--green); }
.avatar .status { position: absolute; right: -2px; bottom: -2px; width: 34%; height: 34%; min-width: 10px; min-height: 10px; border-radius: 50%; border: 3px solid var(--bg1); background: var(--muted); box-sizing: content-box; }
.status.s-online { background: var(--green); }
.status.s-idle { background: var(--yellow); }
.status.s-dnd { background: var(--red); }
.status.s-offline { background: #6b6f76; }
.menu .status, .menu-item > .status { position: static; width: 10px; height: 10px; min-width: 0; min-height: 0; border: 0; display: inline-block; }

/* ---------- chat column ---------- */
.chat { display: flex; flex-direction: column; background: var(--bg2); min-width: 0; min-height: 0; position: relative; }
.chat-head { height: 52px; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--line); flex: none; min-width: 0; box-shadow: 0 1px 0 var(--hover); }
.ch-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; max-width: 40%; }
.ch-title.click { cursor: pointer; }
.ch-title.click:hover { text-decoration: underline; }
.ch-crumb { color: var(--muted); font-weight: 600; cursor: pointer; white-space: nowrap; }
.ch-crumb:hover { color: var(--text); }
.ch-topic { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 1px solid var(--line); padding-left: 10px; min-width: 0; flex: 1; cursor: default; }
.hash { color: var(--muted); display: grid; place-items: center; }
.chat-head .icon-btn.on { color: var(--text); background: var(--bg3); }
.search-box { display: flex; align-items: center; gap: 4px; background: var(--bg0); border-radius: 8px; padding: 0 8px; width: 170px; transition: width .2s; flex: none; color: var(--muted); }
.search-box:focus-within { width: 230px; }
.search-box input { border: 0; background: transparent; padding: 6px 2px; width: 100%; font-size: 13.5px; box-shadow: none; }
.messages { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 0; overflow-anchor: none; }
.msg-list { padding-bottom: 8px; }
.empty { height: 100%; display: grid; place-content: center; text-align: center; padding: 24px; }
.empty h2 { margin: 0 0 6px; }
.empty-card { padding: 22px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; }
.intro { padding: 24px 20px 8px; }
.intro h2 { margin: 10px 0 4px; }
.intro p { margin: 0; }
.intro-hash { width: 64px; height: 64px; border-radius: 50%; background: var(--bg3); display: grid; place-items: center; color: var(--muted); }

/* skeleton while a channel loads */
.skeleton { padding: 16px 20px; display: grid; gap: 22px; }
.sk-row { display: grid; grid-template-columns: 40px 1fr; gap: 14px; }
.sk-av { width: 40px; height: 40px; border-radius: 50%; }
.sk-lines { display: grid; gap: 8px; }
.sk-line { height: 11px; border-radius: 6px; }
.sk-av, .sk-line { background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -200% 0; } }

/* messages */
.msg { display: grid; grid-template-columns: 40px 1fr; gap: 0 14px; padding: 2px 56px 2px 20px; position: relative; }
.msg.first { margin-top: 14px; }
.msg:hover { background: var(--hover); }
.msg.mentioned { background: var(--mention-bg); box-shadow: inset 3px 0 0 var(--yellow); }
.msg.flash { animation: flash 2s ease-out; }
@keyframes flash { 0%, 30% { background: var(--accent-soft); } 100% { background: transparent; } }
.msg .m-av { width: 40px; height: 40px; grid-row: span 2; cursor: pointer; margin-top: 2px; }
.msg .meta { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.msg .author { font-weight: 700; cursor: pointer; font-size: var(--chat-fs); }
.msg .author:hover .utext { text-decoration: underline; }
.msg .time { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.msg .side-time { font-size: 10.5px; color: var(--muted); visibility: hidden; text-align: right; padding-top: 4px; white-space: nowrap; }
.msg:hover .side-time { visibility: visible; }
.msg .body { grid-column: 2; min-width: 0; }
.msg .text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--chat-fs); line-height: 1.45; }
.msg .edited { font-size: 11px; color: var(--muted); }
.msg .pin-flag { position: absolute; right: 22px; top: 6px; color: var(--muted); opacity: .7; }
.reply-line { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); padding-left: 20px; position: relative; cursor: pointer; min-width: 0; margin-bottom: 2px; }
.reply-line::before { content: ""; position: absolute; left: 18px; top: 50%; width: 22px; height: 10px; border-left: 2px solid var(--bg4); border-top: 2px solid var(--bg4); border-top-left-radius: 6px; }
.reply-line > * { position: relative; left: 26px; }
.reply-line .rname { font-weight: 600; flex: none; }
.reply-line .rtext { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 60%; }
.reply-line:hover .rtext { color: var(--text); }
.text code { background: var(--code-bg); padding: 1px 5px; border-radius: 5px; font-size: .9em; font-family: var(--mono); }
.text pre { background: var(--code-bg); padding: 10px 12px; border-radius: 8px; overflow-x: auto; white-space: pre; margin: 4px 0; border: 1px solid var(--line); }
.text pre code { background: none; padding: 0; }
.text .quote { display: block; border-left: 3px solid var(--bg4); padding-left: 10px; color: var(--text-2); }
.text .spoiler { background: var(--bg4); color: transparent; border-radius: 4px; cursor: pointer; padding: 0 2px; transition: color .1s; }
.text .spoiler:hover, .text .spoiler:focus { color: var(--text); background: var(--bg3); }
.mention { background: var(--accent-soft); color: var(--accent-2); border-radius: 4px; padding: 0 3px; font-weight: 600; cursor: pointer; }
.mention:hover { background: color-mix(in srgb, var(--accent) 30%, transparent); }
img.emoji { width: 1.45em; height: 1.45em; object-fit: contain; vertical-align: -.35em; }
img.emoji.lg { width: 32px; height: 32px; }
.jumbo { font-size: 2.5em; line-height: 1.2; }
.tools { position: absolute; right: 16px; top: -16px; display: none; background: var(--bg1); border: 1px solid var(--line); border-radius: 8px; z-index: 2; box-shadow: 0 4px 14px var(--shadow); padding: 2px; }
.msg:hover .tools { display: flex; }
.tools .icon-btn { width: 30px; height: 30px; }
.day { display: flex; align-items: center; gap: 10px; margin: 18px 20px 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.day::before, .day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.new-line { display: flex; align-items: center; gap: 8px; margin: 10px 20px 0; font-size: 10.5px; font-weight: 800; color: var(--red); }
.new-line::before { content: ""; flex: 1; height: 1px; background: var(--red); }
.load-more { display: flex; margin: 8px auto; }

/* compact mode */
.app.compact .msg { display: block; padding: 2px 56px 2px 20px; }
.app.compact .msg.first { margin-top: 4px; }
.app.compact .msg .m-av, .app.compact .msg .side-time { display: none; }
.app.compact .msg .meta { display: inline-flex; flex-direction: row-reverse; gap: 8px; margin-right: 6px; vertical-align: baseline; }
.app.compact .msg .body { display: inline; }
.app.compact .msg .body > .text { display: inline; }
.app.compact .msg .body > :not(.text) { display: grid; margin-left: 0; }
.app.compact .reply-line { padding-left: 0; }
.app.compact .reply-line::before { display: none; }
.app.compact .reply-line > * { left: 0; }

/* attachments */
.atts { display: grid; gap: 6px; margin-top: 4px; justify-items: start; }
.img-grid { display: grid; gap: 4px; max-width: min(520px, 100%); border-radius: 10px; overflow: hidden; }
.img-grid img { display: block; max-width: 100%; max-height: 320px; object-fit: cover; cursor: zoom-in; background: var(--bg3); }
.img-grid.n1 img { width: auto; height: auto; border-radius: 10px; object-fit: contain; }
.img-grid.n2 { grid-template-columns: 1fr 1fr; }
.img-grid.n3, .img-grid.n4 { grid-template-columns: 1fr 1fr; }
.img-grid.n2 img, .img-grid.n3 img, .img-grid.n4 img { width: 100%; height: 200px; }
.att-video { max-width: min(480px, 100%); max-height: 320px; border-radius: 10px; background: #000; }
.file-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; background: var(--bg1); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; max-width: min(420px, 100%); width: 100%; }
.file-card audio { grid-column: 1 / -1; width: 100%; height: 36px; }
.fc-icon { color: var(--accent); }
.fc-txt { min-width: 0; display: grid; }
.fc-txt a { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }

/* link previews */
.embed { position: relative; display: grid; gap: 8px; background: var(--bg1); border-left: 4px solid var(--bg4); border-radius: 6px; padding: 10px 14px 12px; margin-top: 6px; max-width: min(460px, 100%); }
.embed.has-thumb { grid-template-columns: 1fr 80px; }
.em-txt { display: grid; gap: 4px; min-width: 0; }
.em-site { font-size: 12px; color: var(--muted); }
.em-title { font-weight: 700; color: var(--accent-2); text-decoration: none; }
.em-title:hover { text-decoration: underline; }
.em-desc { font-size: 13.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.em-img { width: 100%; max-height: 260px; object-fit: cover; border-radius: 6px; cursor: zoom-in; }
.em-thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; cursor: zoom-in; }
.em-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; visibility: hidden; }
.embed:hover .em-x { visibility: visible; }
.yt-thumb { position: relative; cursor: pointer; border-radius: 6px; overflow: hidden; aspect-ratio: 16/9; background: #000; }
.yt-thumb img { width: 100%; height: 100%; object-fit: cover; }
.yt-play { position: absolute; inset: 0; margin: auto; width: 64px; height: 44px; border-radius: 12px; border: 0; background: rgba(255,0,51,.9); color: #fff; cursor: pointer; display: grid; place-items: center; }
.yt-frame { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 6px; }

/* polls */
.poll { margin-top: 6px; background: var(--bg1); border: 1px solid var(--line); border-radius: 12px; padding: 14px; max-width: min(460px, 100%); display: grid; gap: 8px; }
.poll-q { font-weight: 700; font-size: 16px; display: flex; gap: 8px; align-items: flex-start; }
.poll-q .ic { color: var(--accent); margin-top: 2px; }
.poll-sub { font-size: 12px; color: var(--muted); }
.poll-opt { position: relative; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; cursor: pointer; overflow: hidden; background: var(--bg2); text-align: left; width: 100%; }
.poll-opt:hover { border-color: var(--bg4); }
.poll-opt.mine { border-color: var(--accent); }
.poll-opt .bar { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); width: 0; transition: width .4s ease; }
.poll-opt.mine .bar { background: color-mix(in srgb, var(--accent) 26%, transparent); }
.poll-opt > :not(.bar) { position: relative; }
.poll-opt .po-text { flex: 1; font-weight: 600; }
.poll-opt .po-n { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.poll-opt .po-check { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--bg4); display: grid; place-items: center; flex: none; }
.poll.multi .poll-opt .po-check { border-radius: 5px; }
.poll-opt.mine .po-check { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.poll.ended .poll-opt { cursor: default; }
.poll-foot { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--muted); }

/* thread chip under a starter message */
.thread-chip { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; padding: 7px 12px; background: var(--bg1); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; max-width: min(460px, 100%); }
.thread-chip:hover { border-color: var(--accent); }
.thread-chip .ic { color: var(--accent); }
.thread-chip b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.thread-chip .tc-n { color: var(--accent-2); font-weight: 700; font-size: 13px; white-space: nowrap; }
.thread-chip .tc-t { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* reactions */
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.react { display: inline-flex; align-items: center; gap: 5px; background: var(--bg1); border: 1px solid var(--line); border-radius: 8px; padding: 2px 8px; cursor: pointer; font-size: 14px; transition: border-color .12s, transform .08s; }
.react:hover { border-color: var(--bg4); }
.react:active { transform: scale(.94); }
.react.mine { background: var(--accent-soft); border-color: var(--accent); }
.react .rc { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.react.mine .rc { color: var(--accent-2); }
.react img.emoji { width: 18px; height: 18px; vertical-align: middle; }
.react.add { visibility: hidden; color: var(--muted); padding: 2px 6px; }
.msg:hover .react.add { visibility: visible; }

/* composer */
.jump-bar { margin: 0 16px 4px; border: 0; border-radius: 8px; padding: 6px; background: var(--bg4); cursor: pointer; font-size: 13px; font-weight: 600; }
.typing { height: 20px; padding: 0 20px; display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.typing .dots { width: 18px; height: 6px; background: radial-gradient(circle, var(--muted) 2px, transparent 2.5px) 0 0 / 6px 6px repeat-x; animation: typing 1s steps(3) infinite; }
@keyframes typing { to { background-position: 18px 0; } }
.composer { padding: 0 16px 16px; flex: none; position: relative; }
.composer.disabled .composer-row { opacity: .5; pointer-events: none; }
.composer-row { display: flex; align-items: flex-end; gap: 4px; background: var(--bg3); border-radius: var(--radius); padding: 4px 6px; border: 1px solid transparent; transition: border-color .12s; }
.composer-row:focus-within { border-color: var(--bg4); }
.composer-row textarea { flex: 1; resize: none; max-height: 260px; background: transparent; border: 0; padding: 9px 6px; min-height: 40px; box-shadow: none; font-size: var(--chat-fs); }
.composer-row .icon-btn { margin-bottom: 4px; }
.composer .send { padding: 0 12px; height: 34px; margin-bottom: 3px; }
.composer-note { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 4px 4px 0; }
.composer-note.warn { color: var(--yellow); }
.reply-bar { display: flex; align-items: center; gap: 6px; background: var(--bg1); border-radius: var(--radius) var(--radius) 0 0; padding: 6px 8px 6px 14px; font-size: 13px; color: var(--muted); }
.reply-bar b { color: var(--text); }
.reply-bar:not(.hidden) ~ .composer-row, .tray:not(.hidden) ~ .composer-row { border-top-left-radius: 0; border-top-right-radius: 0; }
.ping-toggle { border: 0; background: transparent; color: var(--muted); font-weight: 800; font-size: 12px; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.ping-toggle.on { color: var(--accent-2); }
.tray { display: flex; gap: 8px; overflow-x: auto; background: var(--bg1); padding: 10px; border-radius: var(--radius) var(--radius) 0 0; }
.reply-bar:not(.hidden) + .tray { border-radius: 0; }
.tray-item { position: relative; width: 120px; flex: none; background: var(--bg2); border-radius: 8px; padding: 6px; display: grid; gap: 4px; }
.tray-item img { width: 100%; height: 80px; object-fit: cover; border-radius: 6px; }
.tray-icon { height: 80px; display: grid; place-items: center; background: var(--bg3); border-radius: 6px; color: var(--muted); }
.tray-name { font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tray-bar { height: 4px; border-radius: 2px; background: var(--bg4); position: relative; overflow: hidden; --p: 0; }
.tray-bar::after { content: ""; position: absolute; inset: 0; width: calc(var(--p) * 100%); background: var(--accent); transition: width .2s; }
.tray-item.done .tray-bar::after { background: var(--green); }
.tray-item.err .tray-bar::after { background: var(--red); width: 100%; }
.tray-x { position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; background: rgba(0,0,0,.6); color: #fff; }
.autocomplete { position: absolute; left: 16px; right: 16px; bottom: calc(100% - 8px); background: var(--bg1); border: 1px solid var(--line); border-radius: 10px; padding: 6px; z-index: 5; box-shadow: 0 -6px 20px var(--shadow); max-height: 320px; overflow-y: auto; animation: pop-in .12s ease-out; }
.ac-item { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.ac-item.on { background: var(--bg3); }
.ac-label { font-weight: 600; }
.ac-sub { margin-left: auto; font-size: 12px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ac-emo { width: 22px; text-align: center; font-size: 17px; }
.drop-overlay { position: absolute; inset: 0; background: color-mix(in srgb, var(--bg0) 85%, transparent); display: grid; place-items: center; z-index: 10; pointer-events: none; }
.drop-overlay div { border: 2px dashed var(--accent); border-radius: 16px; padding: 40px 60px; font-size: 18px; font-weight: 700; color: var(--accent-2); display: flex; gap: 10px; align-items: center; }
.edit-box { display: grid; gap: 4px; }
.edit-box textarea { width: 100%; background: var(--bg3); border: 0; font-size: var(--chat-fs); }

/* People page */
.people { padding: 20px 24px; max-width: 760px; }
.people-top { display: flex; align-items: center; justify-content: space-between; }
.people-top h2 { margin: 0; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px; border-top: 1px solid var(--line); cursor: pointer; border-radius: 8px; }
.person:hover { background: var(--hover); }
.person .icon-btn { background: var(--bg1); border-radius: 50%; width: 36px; height: 36px; }

/* side panel */
.side-panel { background: var(--bg1); overflow-y: auto; min-width: 0; }
#members { padding: 8px; }
.member { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; min-width: 0; }
.member:hover { background: var(--hover); }
.member.offline { opacity: .45; }
.m-txt { min-width: 0; display: grid; }
.m-sub { font-size: 11.5px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mname { font-weight: 600; }
.member .crown { color: var(--yellow); margin-left: auto; }
.member .to-flag { color: var(--red); margin-left: auto; }
.side-profile { display: grid; justify-items: start; gap: 6px; padding-bottom: 12px; }
.sp-banner { height: 80px; width: calc(100% + 16px); margin: -8px -8px 0; background-size: cover; background-position: center; }
.side-profile .avatar.xl { margin: -42px 0 0 8px; border: 6px solid var(--bg1); box-sizing: content-box; }
.sp-name { font-size: 20px; font-weight: 800; padding: 0 8px; }
.sp-status, .sp-bio { padding: 0 8px; font-size: 13.5px; white-space: pre-wrap; }
.side-profile .btn { margin: 6px 8px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 8px; position: sticky; top: 0; background: var(--bg1); z-index: 1; }
.panel-head b { display: flex; align-items: center; gap: 6px; }
.panel-list { display: grid; gap: 8px; padding: 0 10px 14px; }
.mini-msg { background: var(--bg2); border-radius: 10px; padding: 10px; display: grid; gap: 4px; }
.mm-top { display: flex; align-items: center; gap: 6px; font-size: 13px; min-width: 0; }
.mm-top .time { font-size: 11px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.mm-text { font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 140px; overflow: hidden; }
.mm-acts { display: flex; gap: 6px; justify-content: flex-end; }
.mm-chan { font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 4px 2px 0; }
.thread-item { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--bg2); cursor: pointer; }
.thread-item:hover { background: var(--bg3); }
.thread-item b { display: flex; align-items: center; gap: 6px; }
.thread-item .muted { font-size: 12px; }

/* ---------- voice stage ---------- */
.stage { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px; }
.stage.has-streams { justify-content: flex-start; }
.stage.compact { min-height: 0; padding: 14px; gap: 12px; }
.call-panel { background: var(--bg0); border-bottom: 1px solid var(--line); max-height: 55%; overflow-y: auto; flex: none; }
.tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 980px; }
.tile { width: 170px; min-height: 150px; background: var(--bg1); border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border: 2px solid transparent; transition: border-color .1s; position: relative; cursor: pointer; padding: 12px 6px; overflow: hidden; }
.stage.compact .tile { width: 140px; min-height: 120px; }
.tile.has-cam { width: 300px; padding: 0; aspect-ratio: 16/9; min-height: 0; justify-content: flex-end; }
.stage.compact .tile.has-cam { width: 220px; }
.tile.speaking { border-color: var(--green); }
.tile .tname { font-weight: 600; font-size: 14px; max-width: 100%; display: flex; align-items: center; gap: 4px; padding: 0 6px; }
.tile .tname .ic { color: var(--muted); }
.tile.has-cam .tname { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.6); color: #fff; padding: 2px 8px; border-radius: 6px; font-size: 13px; }
.cam-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.cam-video.self { transform: scaleX(-1); }
.tile .live-badge { position: absolute; top: 8px; right: 8px; }
.tile .btn { position: relative; }
.sound-pop { position: absolute; top: 10px; left: 50%; font-size: 30px; animation: pop-up 1.6s ease-out forwards; pointer-events: none; }
@keyframes pop-up { 0% { transform: translate(-50%, 20px) scale(.5); opacity: 0; } 20% { transform: translate(-50%, 0) scale(1.2); opacity: 1; } 100% { transform: translate(-50%, -40px) scale(1); opacity: 0; } }
.stage-ctr { display: flex; gap: 10px; align-items: center; justify-content: center; }
.ctl { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--bg3); cursor: pointer; display: grid; place-items: center; color: var(--text); transition: background .12s, transform .08s; }
.ctl:hover { background: var(--bg4); }
.ctl:active { transform: scale(.94); }
.ctl.on { background: var(--text); color: var(--bg1); }
.ctl.cam.on, .ctl.share.on { background: var(--accent); color: var(--on-accent); }
.ctl.hang { background: var(--red); color: #fff; }
.ctl.accept { background: var(--green); color: #0b1f14; }
.streams { width: 100%; max-width: 1100px; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.stream-card { background: var(--bg0); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); display: flex; flex-direction: column; }
.stream-card.loading { min-height: 200px; display: grid; place-items: center; }
.stream-video { width: 100%; aspect-ratio: 16 / 9; background: #000; display: block; object-fit: contain; }
.stream-top, .stream-ctr { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.stream-who { display: flex; align-items: center; gap: 8px; font-weight: 700; flex: 1; min-width: 0; }
.stream-ctr input[type=range] { width: 120px; }
.stream-ctr .btn { padding: 6px 12px; }
.live-badge { background: var(--red); color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; padding: 2px 6px; border-radius: 4px; }
.live-badge.sm { font-size: 9px; padding: 1px 4px; }

/* soundboard */
.soundboard { width: 340px; max-height: 420px; overflow-y: auto; padding: 10px; }
.sb-head { font-weight: 800; padding: 2px 4px 4px; display: flex; align-items: center; gap: 6px; }
.sb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.sb-btn { position: relative; display: grid; justify-items: center; gap: 2px; padding: 10px 4px 8px; border: 1px solid var(--line); background: var(--bg2); border-radius: 10px; cursor: pointer; transition: border-color .12s, transform .08s; }
.sb-btn:hover { border-color: var(--accent); background: var(--bg3); }
.sb-btn:active { transform: scale(.96); }
.sb-emo { font-size: 22px; }
.sb-name { font-size: 12px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 100%; }
.sb-preview { position: absolute; top: 4px; right: 4px; opacity: 0; color: var(--muted); }
.sb-btn:hover .sb-preview { opacity: 1; }

/* incoming call, event toasts */
.call-toast { position: fixed; right: 20px; top: 64px; z-index: 70; background: var(--bg1); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 12px 40px var(--shadow); animation: ring-in .3s ease-out; }
.ct-txt { min-width: 120px; }
@keyframes ring-in { from { transform: translateY(-16px); opacity: 0; } }

/* ---------- popovers / menus / emoji picker ---------- */
.popover { position: fixed; z-index: 80; background: var(--bg1); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px var(--shadow); animation: pop-in .12s ease-out; }
@keyframes pop-in { from { opacity: 0; transform: scale(.97) translateY(4px); } }
.menu { padding: 6px; min-width: 210px; display: grid; }
.menu-item { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 8px 10px; border-radius: 6px; cursor: pointer; text-align: left; font-size: 14px; color: var(--text); }
.menu-item:hover { background: var(--accent); color: var(--on-accent); }
.menu-item.danger { color: var(--red); }
.menu-item.danger:hover { background: var(--red); color: #fff; }
.menu-item.on { background: var(--bg3); }
.mi-icon { width: 18px; display: grid; place-items: center; }
.mi-sub { margin-left: auto; font-size: 11.5px; opacity: .7; }
.menu-sep { height: 1px; background: var(--line); margin: 4px 2px; }
.menu-title { font-weight: 700; padding: 6px 10px; }
.menu-range { display: flex; align-items: center; gap: 8px; padding: 4px 10px 8px; grid-template-columns: none; }
.menu-profile { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.emoji-picker { width: 352px; height: 400px; display: grid; grid-template-rows: auto auto 1fr auto; overflow: hidden; }
.ep-search { margin: 10px 10px 6px; }
.ep-nav { display: flex; gap: 2px; padding: 0 8px 6px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.ep-tab { border: 0; background: transparent; width: 32px; height: 30px; border-radius: 6px; cursor: pointer; font-size: 17px; flex: none; display: grid; place-items: center; }
.ep-tab:hover { background: var(--bg3); }
.ep-sicon { width: 22px; height: 22px; border-radius: 6px; background: var(--bg3); font-size: 9px; font-weight: 800; display: grid; place-items: center; overflow: hidden; }
.ep-sicon img { width: 100%; height: 100%; object-fit: cover; }
.ep-body { overflow-y: auto; padding: 4px 8px 8px; }
.ep-group { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 4px 4px; position: sticky; top: -4px; background: var(--bg1); }
.ep-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.ep-cell { border: 0; background: transparent; height: 38px; border-radius: 6px; cursor: pointer; font-size: 24px; display: grid; place-items: center; padding: 0; transition: transform .08s; }
.ep-cell:hover { background: var(--bg3); transform: scale(1.12); }
.ep-cell img { width: 28px; height: 28px; object-fit: contain; }
.ep-foot { border-top: 1px solid var(--line); padding: 8px 12px; font-size: 13px; color: var(--muted); min-height: 36px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-empty { padding: 30px; text-align: center; }

/* quick switcher */
.qs-card { max-width: 560px !important; padding: 16px !important; }
.qs-input { font-size: 18px; padding: 12px 14px; }
.qs-list { display: grid; gap: 2px; max-height: 50vh; overflow-y: auto; }
.qs-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; min-width: 0; }
.qs-item.on { background: var(--bg3); }
.qs-item .qs-name { font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.qs-item .qs-where { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.qs-item .ic { color: var(--muted); }
.kbd { display: inline-block; font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); border-bottom-width: 2px; color: var(--muted); }

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; background: var(--scrim); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade-in .15s ease-out; }
@keyframes fade-in { from { opacity: 0; } }
.modal-card { width: 100%; max-width: 440px; max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--bg1); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: grid; gap: 12px; align-content: start; box-shadow: 0 24px 70px var(--shadow); animation: pop-in .18s ease-out; }
.modal-card.wide { max-width: 680px; }
.modal-card h3 { margin: 0; }
.modal-card .head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.modal-card .head h3 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.seg { display: flex; background: var(--bg0); border-radius: 8px; padding: 3px; flex-wrap: wrap; }
.seg button { flex: 1; border: 0; background: transparent; padding: 7px 10px; border-radius: 6px; cursor: pointer; color: var(--muted); font-weight: 600; white-space: nowrap; }
.seg button.on { background: var(--bg3); color: var(--text); box-shadow: 0 1px 3px var(--shadow); }
.invite { display: flex; gap: 8px; }
.invite input { flex: 1; font-family: var(--mono); }
.divider { height: 1px; background: var(--line); margin: 4px 0; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
@media (max-width: 640px) { .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } }
.tabs button { border: 0; background: transparent; padding: 8px 11px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.list { display: grid; gap: 4px; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--bg2); min-width: 0; }
.list-row.click { cursor: pointer; }
.list-row.click:hover { background: var(--bg3); }
.list-row.picked { outline: 2px solid var(--accent); }
.list-row .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row input[type=range] { width: 90px; }
.list-row .sub { font-size: 12px; color: var(--muted); }
.inline-input { padding: 6px 8px; background: var(--bg1); }
.emo-input { width: 52px; text-align: center; }
.pick-list { max-height: 300px; overflow-y: auto; }
.pick-list label.list-row { display: flex; grid-template-columns: none; color: var(--text); font-weight: 500; font-size: 14px; }
.role-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: var(--bg2); font-size: 12.5px; border: 1px solid var(--line); }
.chip.click { cursor: pointer; }
.chip.click:hover { border-color: var(--accent); }
.chip.red { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.perm { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.perm .txt { flex: 1; min-width: 0; }
.perm .txt b { display: block; font-size: 14px; }
.perm .txt span { font-size: 12.5px; color: var(--muted); }
.perm-group { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 10px; }
.switch { position: relative; width: 40px; height: 24px; flex: none; display: block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--bg4); transition: background .15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:disabled + span { opacity: .4; cursor: not-allowed; }
.tri { display: flex; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); flex: none; }
.tri button { border: 0; background: var(--bg0); width: 34px; height: 28px; cursor: pointer; color: var(--muted); font-weight: 700; }
.tri button.on.deny { background: var(--red); color: #fff; }
.tri button.on.inherit { background: var(--bg4); color: var(--text); }
.tri button.on.allow { background: var(--green); color: #0b1f14; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch { width: 28px; height: 28px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; padding: 0; transition: transform .08s; }
.swatch:hover { transform: scale(1.08); }
.swatch.on { border-color: var(--text); }
.inline-label { display: flex; flex-direction: row; align-items: center; gap: 10px; }
.acct-top { display: flex; align-items: center; gap: 18px; }
.banner-edit { height: 120px; border-radius: 12px; background: var(--bg3) center / cover; position: relative; display: flex; align-items: flex-end; justify-content: flex-end; gap: 6px; padding: 8px; border: 1px dashed var(--line); }
.meter-box { display: grid; gap: 8px; }
.meter { position: relative; height: 12px; border-radius: 6px; background: var(--bg0); overflow: hidden; }
.meter-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--bg4); transition: width .05s linear; }
.meter-fill.on { background: var(--green); }
.meter-mark { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--accent); }
.theme-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-card { border: 2px solid var(--line); border-radius: 12px; padding: 0; overflow: hidden; cursor: pointer; background: none; display: grid; text-align: left; }
.theme-card.on { border-color: var(--accent); }
.theme-card .tc-preview { height: 64px; display: grid; grid-template-columns: 18px 40px 1fr; }
.theme-card .tc-preview i { display: block; }
.theme-card .tc-label { padding: 8px 10px; font-weight: 600; font-size: 13px; background: var(--bg2); }
.preview-msg { background: var(--bg2); border-radius: 10px; padding: 8px 0; border: 1px solid var(--line); }
.audit-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 10px; border-radius: 8px; background: var(--bg2); }
.audit-row .ic { color: var(--muted); margin-top: 2px; }
.audit-row .ar-txt { font-size: 14px; }
.audit-row .ar-det { font-size: 12.5px; color: var(--muted); }
.audit-row .ar-time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.event-card { display: grid; gap: 6px; padding: 14px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); }
.event-card.live { border-color: var(--green); }
.ev-when { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--accent-2); }
.event-card.live .ev-when { color: var(--green); }
.ev-name { font-size: 17px; font-weight: 800; }
.ev-where { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.ev-desc { font-size: 14px; color: var(--text-2); white-space: pre-wrap; }
.ev-foot { display: flex; align-items: center; gap: 8px; }
.poll-opts { display: grid; gap: 6px; }
.poll-opts .po-row { display: flex; gap: 6px; }
.poll-opts input { flex: 1; }

/* profile card */
.modal-card.profile-card { padding: 0; gap: 0; overflow-x: hidden; }
.pc-banner { height: 110px; position: relative; border-radius: 16px 16px 0 0; background-size: cover; background-position: center; }
.pc-x, .pc-back { position: absolute; top: 8px; background: rgba(0,0,0,.4); color: #fff; }
.pc-x:hover, .pc-back:hover { background: rgba(0,0,0,.6); color: #fff; }
.pc-x { right: 8px; } .pc-back { left: 8px; }
.pc-av { margin: -48px 0 0 18px; border: 6px solid var(--bg1); box-sizing: content-box; }
.pc-av .status { border-color: var(--bg1); }
.pc-body { padding: 8px 20px 20px; display: grid; gap: 10px; }
.pc-body .row { justify-content: flex-start; }
.pc-name { font-size: 22px; font-weight: 800; }
.pc-status { font-size: 14px; }
.pc-bio { white-space: pre-wrap; font-size: 14px; }
.pc-roles summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; padding: 6px 0; }

/* role styling */
.uname { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; }
.uname .utext { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ricon { width: 18px; height: 18px; font-size: 14px; line-height: 18px; text-align: center; object-fit: contain; flex: none; border-radius: 4px; }
.fx-gradient, .fx-shimmer, .fx-rainbow { -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; background-size: 200% auto; }
.fx-gradient { background-image: linear-gradient(90deg, var(--c1), var(--c2), var(--c1)); animation: fx-pan 3s linear infinite; }
.fx-shimmer { background-image: linear-gradient(110deg, var(--c1) 35%, #fff 50%, var(--c1) 65%); background-size: 250% auto; animation: fx-pan 2.6s linear infinite; }
.fx-rainbow { background-image: linear-gradient(90deg, #ff5e5e, #ffb35e, #f9f871, #6bf28c, #5ec8ff, #9b7bff, #ff5ec4, #ff5e5e); animation: fx-pan 4s linear infinite; }
.fx-glow { animation: fx-glow 2s ease-in-out infinite; }
@keyframes fx-pan { to { background-position: -200% center; } }
@keyframes fx-glow { 0%, 100% { text-shadow: 0 0 2px transparent; } 50% { text-shadow: 0 0 10px var(--c1), 0 0 2px var(--c1); } }
.emoji-pick { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg0); cursor: pointer; font-size: 17px; padding: 0; }
.emoji-pick:hover { border-color: var(--accent); }
.role-preview { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--bg2); font-weight: 700; margin-top: 4px; }
.role-preview .muted { margin-left: auto; font-weight: 400; }
.fx-seg { flex-wrap: wrap; }

/* lightbox, toast */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.88); display: grid; place-items: center; padding: 30px; cursor: zoom-out; animation: fade-in .15s; }
.lightbox img { max-width: 100%; max-height: calc(100dvh - 100px); border-radius: 8px; animation: pop-in .2s ease-out; }
.lb-bar { position: fixed; bottom: 16px; left: 0; right: 0; display: flex; justify-content: center; gap: 16px; color: #aaa; font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--bg4); color: var(--text); padding: 10px 16px; border-radius: 10px; z-index: 95; box-shadow: 0 8px 30px var(--shadow); max-width: calc(100% - 32px); animation: toast-in .2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }
.reconnect { position: fixed; top: 0; left: 50%; transform: translateX(-50%); background: var(--yellow); color: #1a1406; font-weight: 700; font-size: 13px; padding: 4px 14px; border-radius: 0 0 10px 10px; z-index: 96; }
.scrim { display: none; }
.only-mobile { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- phones ---------- */
@media (max-width: 860px) {
  .app, .app.no-panel, .app.no-side { grid-template-columns: 1fr; }
  .rail, .sidebar { position: fixed; top: 0; bottom: 0; z-index: 30; transition: transform .2s; }
  .rail { left: 0; width: 72px; }
  .sidebar { left: 72px; width: min(290px, calc(100vw - 72px)); }
  .app:not(.drawer) .rail { transform: translateX(-100%); }
  .app:not(.drawer) .sidebar { transform: translateX(calc(-100% - 72px)); }
  .side-panel, .app.no-panel .side-panel, .app.no-side .side-panel { position: fixed; right: 0; top: 0; bottom: 0; width: min(300px, 86vw); z-index: 30; transform: translateX(100%); transition: transform .2s; display: block; }
  .app.show-panel .side-panel { transform: none; }
  .app.drawer .scrim, .app.show-panel .scrim { display: block; position: fixed; inset: 0; background: var(--scrim); z-index: 20; }
  .only-mobile { display: grid; }
  .msg { padding: 2px 12px; gap: 0 10px; grid-template-columns: 36px 1fr; }
  .msg .m-av { width: 36px; height: 36px; }
  .tools { right: 8px; }
  .composer { padding: 0 8px calc(8px + env(safe-area-inset-bottom)); }
  .search-box { width: 36px; padding: 0 9px; }
  .search-box input { width: 0; padding: 6px 0; }
  .search-box:focus-within { width: 160px; }
  .search-box:focus-within input { width: 100%; padding: 6px; }
  .ch-topic { display: none; }
  .ch-title { max-width: 55%; }
  .tile { width: 140px; }
  .tile.has-cam { width: 100%; max-width: 340px; }
  .people { padding: 14px; }
  .emoji-picker { width: min(352px, calc(100vw - 16px)); }
  .call-toast { left: 12px; right: 12px; top: 60px; }
  .theme-cards { grid-template-columns: 1fr 1fr; }
}

/* ---------- v3 small pieces ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .two-col { grid-template-columns: 1fr; } }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent-2); font: inherit; font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text); flex: none; }
.poll-opt.winner { border-color: var(--yellow); }
.poll-opt .po-win { color: var(--yellow); }
.tflag { color: var(--muted); margin-left: 2px; }
.tflag.danger { color: var(--red); }
.viewers { display: inline-flex; align-items: center; gap: 4px; }
.sb-head { display: flex; align-items: center; gap: 6px; }
.btn .ic { flex: none; }
.ctl .ic { pointer-events: none; }
.events-modal .event-card + .event-card { margin-top: 2px; }
.accent-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.accent-row .swatch { border-radius: 50%; width: 30px; height: 30px; }
.font-row { display: flex; align-items: center; gap: 12px; }
.font-row input { flex: 1; }
.admin-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; background: var(--bg2); }
.admin-row .ar-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.reset-out { display: grid; gap: 6px; padding: 10px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); }
.inv-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; background: var(--bg2); }
.inv-row code { font-size: 13px; }
.inv-row .muted { font-size: 12px; }
.badge-new { font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 6px; background: var(--accent); color: var(--on-accent); }
.app.compact .msg .body > .thread-chip { display: flex; width: fit-content; }
.avatar { display: flex; align-items: center; justify-content: center; }
.accent-row input[type=color] { width: 30px; height: 30px; border-radius: 50%; padding: 0; border: 2px solid var(--line); overflow: hidden; cursor: pointer; }
.accent-row input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.accent-row input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }

/* friends */
.friend-tabs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ftab { border: 0; background: transparent; color: var(--muted); font-weight: 600; padding: 6px 12px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.ftab:hover { background: var(--hover); color: var(--text); }
.ftab.on { background: var(--bg3); color: var(--text); }
.ftab.add { background: var(--green); color: #0b1f14; }
.ftab.add.on { background: transparent; color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.people-top h2 { display: flex; align-items: center; gap: 8px; }
.people-top { flex-wrap: wrap; gap: 12px; }
.friend-list { display: grid; gap: 2px; margin-top: 10px; }
.add-friend { display: flex; gap: 8px; padding: 8px; border-radius: 12px; background: var(--bg1); border: 1px solid var(--line); }
.add-friend input { flex: 1; border: 0; background: transparent; font-size: 15px; }
.add-friend input:focus { outline: none; box-shadow: none; }
.person .icon-btn.accept { color: var(--green); }
.blocked-msg { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; padding: 6px 20px 6px 72px; }
.app.compact .blocked-msg { padding-left: 20px; }

/* voice messages */
.composer.recording .composer-row { display: none; }
.recorder { display: flex; align-items: center; gap: 10px; background: var(--bg1); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: rec-pulse 1s ease-in-out infinite; flex: none; }
@keyframes rec-pulse { 50% { opacity: .35; } }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 40px; }
.rec-bars { flex: 1; height: 30px; display: flex; align-items: center; justify-content: flex-end; gap: 2px; overflow: hidden; }
.rec-bars i { width: 3px; border-radius: 2px; background: var(--accent); flex: none; }
.rec-send { background: var(--accent) !important; color: var(--on-accent) !important; border-radius: 50%; }
.rec-cancel:hover { color: var(--red); }
.voice-msg { display: flex; align-items: center; gap: 10px; background: var(--bg1); border: 1px solid var(--line); border-radius: 24px; padding: 6px 12px 6px 6px; width: min(340px, 100%); margin-top: 4px; }
.vm-play { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; cursor: pointer; flex: none; }
.vm-wave { flex: 1; height: 28px; display: flex; align-items: center; gap: 2px; cursor: pointer; }
.vm-wave i { flex: 1; min-width: 2px; border-radius: 2px; background: var(--bg4); transition: background .1s; }
.vm-wave i.on { background: var(--accent); }
.vm-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 32px; text-align: right; }
.vm-speed { border: 0; background: var(--bg3); color: var(--text-2); font-size: 11px; font-weight: 800; border-radius: 6px; padding: 3px 6px; cursor: pointer; }

/* GIFs */
.gif-picker { width: min(420px, calc(100vw - 24px)); padding: 10px; display: grid; gap: 8px; }
.gif-search { width: 100%; }
.gif-grid { columns: 2; column-gap: 6px; max-height: 360px; overflow-y: auto; }
.gif-cell { display: block; width: 100%; margin: 0 0 6px; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--bg3); cursor: pointer; break-inside: avoid; min-height: 60px; }
.gif-cell img, .gif-cell video { width: 100%; height: 100%; display: block; object-fit: cover; }
.gif-cell:hover { outline: 2px solid var(--accent); }
.gif-foot { font-size: 11px; color: var(--muted); text-align: right; font-weight: 700; letter-spacing: .02em; }
.gif-embed { margin-top: 4px; max-width: min(320px, 100%); }
.gif-embed img { max-width: 100%; max-height: 300px; border-radius: 8px; display: block; cursor: zoom-in; }
.vm-wave i, .rec-bars i { display: block; }
.gif-grid { height: 360px; max-height: 50vh; }

/* ---------- Windows app ---------- */
#titlebar { display: none; }
html.desktop #titlebar { display: flex; position: fixed; inset: 0 0 auto 0; height: 32px; align-items: center; gap: 8px; padding-left: 14px; -webkit-app-region: drag; z-index: 45; background: var(--bg0); color: var(--muted); font-size: 12.5px; font-weight: 700; user-select: none; }
html.desktop #titlebar svg { color: var(--accent); }
html.desktop body { padding-top: 32px; box-sizing: border-box; }
html.desktop .app { height: calc(100dvh - 32px); }
html.desktop .reconnect { top: 32px; }
html.desktop .call-toast { top: 80px; }
.src-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; max-height: 52vh; overflow-y: auto; padding: 2px; }
.src-card { display: grid; gap: 6px; padding: 8px; border-radius: 10px; border: 2px solid var(--line); background: var(--bg2); cursor: pointer; text-align: left; color: var(--text); font: inherit; }
.src-card:hover { border-color: var(--accent); }
.src-card > img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #000; border-radius: 6px; }
.src-name { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; min-width: 0; }
.src-name span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.src-icon { width: 16px; height: 16px; flex: none; }
.dl-link { display: inline-flex; align-items: center; gap: 6px; }

/* invite cards in messages */
.invite-embed { margin-top: 6px; width: min(430px, 100%); border-radius: 12px; background: var(--bg1); border: 1px solid var(--line); padding: 12px 14px 14px; display: grid; gap: 10px; position: relative; overflow: hidden; }
.invite-embed.has-banner::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 46px; background: var(--ie-banner) center / cover; opacity: .35; }
.invite-embed > * { position: relative; }
.ie-label { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ie-row { display: flex; align-items: center; gap: 12px; }
.ie-icon { width: 50px; height: 50px; border-radius: 15px; background: var(--bg3); font-size: 15px; flex: none; color: var(--muted); }
.ie-icon img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.ie-txt { display: grid; gap: 2px; min-width: 0; flex: 1; }
.ie-txt b { font-size: 16px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ie-sub { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 4px; white-space: pre; }
.ie-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.ie-dot.on { background: var(--green); }
.ie-btn { flex: none; min-width: 84px; }
.invite-embed.bad .ie-txt b { color: var(--red); }

/* Lodge's update button (bottom of the server list) */
.rail-btn.upd { margin-top: auto; color: var(--accent); background: var(--accent-soft); }
.rail-btn.upd:hover { background: color-mix(in srgb, var(--accent) 24%, transparent); }
.rail-btn.upd::after { content: ''; position: absolute; inset: -4px; border-radius: 19px; border: 2px solid var(--accent); opacity: 0; animation: upd-glow 2.8s ease-in-out infinite; pointer-events: none; }
.rail-btn.upd .ic { animation: upd-bob 2.8s ease-in-out infinite; }
@keyframes upd-glow { 0%, 100% { opacity: 0; transform: scale(.92); } 50% { opacity: .55; transform: scale(1); } }
@keyframes upd-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .rail-btn.upd::after, .rail-btn.upd .ic { animation: none; } }
.upd-card { width: 300px; padding: 14px; display: grid; gap: 10px; }
.upd-head { display: flex; align-items: center; gap: 10px; }
.upd-head b { font-size: 15px; }
.upd-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.upd-text { margin: 0; font-size: 13.5px; }
.upd-note { margin: 0; font-size: 12px; color: var(--muted); }
.upd-btns { display: flex; justify-content: flex-end; gap: 8px; }
.rail-btn.upd::before { display: none; }

/* right-click menu for people */
.user-menu { min-width: 230px; }
.um-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 6px; }
.um-head b { font-size: 14px; }
.user-menu .menu-range .ic { color: var(--muted); flex: none; }
.user-menu .menu-range input { flex: 1; }

/* moderation panel in profile cards */
.mod-panel { display: grid; gap: 8px; }
.mod-banner { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); border: 1px solid color-mix(in srgb, var(--red) 30%, transparent); }
.mod-title { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.mod-list { display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg2); }
.mod-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background .12s; }
.mod-item + .mod-item { border-top: 1px solid var(--line); }
.mod-item:hover { background: var(--hover); }
.mod-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--bg3); color: var(--muted); }
.mod-item:hover .mod-ic { color: var(--text); }
.mod-txt { display: grid; gap: 1px; flex: 1; min-width: 0; }
.mod-txt b { font-size: 14px; font-weight: 600; }
.mod-txt span { font-size: 12px; color: var(--muted); }
.mod-chev { color: var(--muted); flex: none; }
.mod-item.danger .mod-txt b { color: var(--red); }
.mod-item.danger .mod-ic { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.mod-item.danger:hover { background: color-mix(in srgb, var(--red) 9%, transparent); }

/* What's new */
.wn-card { position: fixed; right: 20px; bottom: 20px; z-index: 60; width: min(340px, calc(100vw - 32px)); background: var(--bg1); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 40px var(--shadow); padding: 12px 12px 12px 14px; display: grid; gap: 8px; animation: toast-in .25s ease-out; }
.wn-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; border-radius: 14px 14px 0 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.wn-top { display: flex; align-items: flex-start; gap: 10px; }
.wn-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.wn-t { display: grid; flex: 1; min-width: 0; }
.wn-kicker { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-2); }
.wn-t b { font-size: 14.5px; }
.wn-prev { font-size: 13px; color: var(--text-2); white-space: pre-wrap; max-height: 62px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.wn-card .btn { justify-self: start; }
.wn-note { padding: 12px 14px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); display: grid; gap: 4px; }
.wn-note.big { background: none; border: 0; padding: 0; }
.wn-date { font-size: 12px; color: var(--muted); }
.wn-title { margin: 0; font-size: 17px; }
.wn-body { font-size: 14px; white-space: pre-wrap; line-height: 1.55; }
html.desktop .wn-card { bottom: 20px; }

/* Lodge Staff: badge next to staff names, and the hover tag on every name */
.staff-badge { flex: none; color: var(--accent); filter: drop-shadow(0 0 4px color-mix(in srgb, var(--accent) 55%, transparent)); animation: staff-glow 3s ease-in-out infinite; }
@keyframes staff-glow { 0%, 100% { filter: drop-shadow(0 0 2px color-mix(in srgb, var(--accent) 40%, transparent)); } 50% { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 80%, transparent)); } }
.staff-tip { position: fixed; z-index: 99; pointer-events: none; display: flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 9px; font-size: 12.5px; font-weight: 600; background: var(--bg4); color: var(--muted); box-shadow: 0 8px 24px var(--shadow); animation: pop-in .12s ease-out; white-space: nowrap; }
.staff-tip.is-staff { color: #fff; font-weight: 800; letter-spacing: .02em; background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #ffd36b) 50%, var(--accent)); background-size: 220% 100%; animation: pop-in .12s ease-out, staff-shine 2.4s linear infinite; box-shadow: 0 8px 26px color-mix(in srgb, var(--accent) 45%, transparent); text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.staff-tip .st-ic { display: grid; place-items: center; }
@keyframes staff-shine { from { background-position: 0% 0; } to { background-position: 220% 0; } }
@media (prefers-reduced-motion: reduce) { .staff-badge, .staff-tip.is-staff { animation: none; } }

/* search filters */
.search-tips { min-width: 260px; }
.search-tips .menu-item { gap: 10px; }
.search-tips code { font-size: 12.5px; background: var(--bg3); padding: 1px 6px; border-radius: 5px; color: var(--accent); }
.search-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 8px; }
.search-chips .chip { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--text); }

/* stickers */
.sticker { margin-top: 4px; }
.sticker img { width: 160px; height: 160px; object-fit: contain; display: block; user-select: none; }
.sticker.small img { width: 72px; height: 72px; }
.sticker-picker { width: 340px; max-width: calc(100vw - 24px); display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.sticker-picker .sp-body { max-height: 340px; overflow-y: auto; }
.sp-head { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 8px 2px 6px; }
.sp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sp-cell { aspect-ratio: 1; border-radius: 10px; background: var(--bg2); border: 1px solid transparent; padding: 6px; cursor: pointer; transition: transform .12s, border-color .12s; }
.sp-cell:hover { border-color: var(--accent); transform: translateY(-1px) rotate(-2deg); }
.sp-cell img { width: 100%; height: 100%; object-fit: contain; }
.sticker-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 10px; }
.sa-card { background: var(--bg2); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.sa-card img { width: 96px; height: 96px; object-fit: contain; }
.sa-row { display: flex; gap: 4px; width: 100%; align-items: center; }
.sa-row input { flex: 1; min-width: 0; }
.sa-name { font-size: 13px; }

/* watch together */
.watch-dock { background: var(--bg1); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; position: relative; flex: 0 0 auto; }
.watch-dock:not(.mini) .wd-player { height: min(52vh, calc((100vw - 560px) * 0.5625)); min-height: 200px; }
.wd-head { display: flex; align-items: center; gap: 4px; padding: 6px 10px; }
.wd-title { display: flex; align-items: center; gap: 6px; color: var(--accent); min-width: 0; white-space: nowrap; overflow: hidden; }
.wd-title b { color: var(--text); font-size: 13.5px; }
.wd-player { background: #000; display: flex; align-items: stretch; justify-content: center; }
.wd-player > iframe, .wd-player > div, .wd-player > video { width: 100%; height: 100%; border: 0; }
.wd-player.audio { flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 18px; height: auto !important; min-height: 0 !important; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--bg2)), var(--bg1)); }
.wd-player.audio > audio { width: min(520px, 100%); height: 40px; }
.wd-audio { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.wd-tap { position: absolute; left: 50%; top: 55%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px; border: 0; background: var(--accent); color: var(--on-accent); font-weight: 700; cursor: pointer; box-shadow: 0 8px 30px #0008; z-index: 2; }
.watch-dock.mini { position: fixed; right: 16px; bottom: 16px; width: 360px; max-width: calc(100vw - 32px); z-index: 60; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 16px 50px #000a; }
.watch-dock.mini .wd-player { aspect-ratio: 16 / 9; }
.watch-dock.mini .wd-player.audio { aspect-ratio: auto; }
@media (max-width: 760px) { .watch-dock:not(.mini) .wd-player { height: 56vw; min-height: 0; } .watch-dock.mini { width: 220px; bottom: 76px; } }

/* clips */
.clip-btn { display: inline-flex; align-items: center; gap: 4px; margin-right: 4px; }
.clip-preview { width: 100%; max-height: 60vh; background: #000; border-radius: 10px; }
.key-pick { display: flex; align-items: center; gap: 4px; }

/* Keeper + webhook authors */
.bot-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: 1px 6px 1px 5px; border-radius: 6px; background: color-mix(in srgb, var(--muted) 22%, transparent); color: var(--text); vertical-align: 2px; margin-right: 2px; }
.bot-tag.keeper { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 85%, #ffd27a), var(--accent)); color: #1b1410; box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 35%, transparent); }
.bot-name .utext { color: var(--text); font-weight: 650; }
.avatar.bot-av { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }

/* corner notices (reminders, group-ups, warnings) */
.notice-stack { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; flex-direction: column; gap: 10px; width: 330px; max-width: calc(100vw - 24px); }
html.desktop .notice-stack { bottom: 20px; }
.notice-card { background: var(--bg1); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 12px; padding: 10px 10px 10px 12px; box-shadow: 0 14px 40px #0009; animation: nc-in .25s ease-out; transition: opacity .4s; }
.notice-card.fade { opacity: .55; }
.notice-card:hover { opacity: 1; }
@keyframes nc-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.nc-top { display: flex; align-items: flex-start; gap: 10px; }
.nc-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); flex: 0 0 30px; }
.nc-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nc-kicker { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.nc-t b { font-size: 14.5px; overflow-wrap: anywhere; }
.nc-body { font-size: 13px; color: var(--muted); margin: 6px 0 0 40px; overflow-wrap: anywhere; }
.nc-acts { display: flex; gap: 6px; margin: 8px 0 0 40px; flex-wrap: wrap; }

/* group-ups */
.lfg-card { margin-top: 6px; max-width: 440px; border-radius: 14px; padding: 12px 14px; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 13%, var(--bg2)), var(--bg2) 60%); border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line)); display: flex; flex-direction: column; gap: 8px; }
.lfg-card.closed, .lfg-card.fired { background: var(--bg2); border-color: var(--line); }
.lfg-card.closed { opacity: .7; }
.lfg-head { display: flex; align-items: center; gap: 10px; }
.lfg-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); flex: 0 0 34px; }
.lfg-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.lfg-kicker { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }
.lfg-card.closed .lfg-kicker, .lfg-card.fired .lfg-kicker { color: var(--muted); }
.lfg-t b { font-size: 16px; overflow-wrap: anywhere; }
.lfg-count { font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; padding: 3px 9px; border-radius: 999px; background: var(--bg3); }
.lfg-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.lfg-meta svg:not(:first-child) { margin-left: 8px; }
.lfg-note { font-size: 13.5px; }
.lfg-slots { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lfg-slots .avatar { width: 30px; height: 30px; }
.lfg-empty { width: 30px; height: 30px; border-radius: 50%; border: 2px dashed color-mix(in srgb, var(--muted) 55%, transparent); }
.lfg-acts { display: flex; gap: 6px; flex-wrap: wrap; }

/* role pickers */
.picker-card { margin-top: 6px; max-width: 520px; padding: 12px 14px; border-radius: 14px; background: var(--bg2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.pk-title { font-size: 15px; }
.pk-roles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pk-role { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg1); color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; transition: border-color .12s, background .12s; }
.pk-role:hover { border-color: var(--accent); }
.pk-role .pk-check { display: none; color: var(--accent); }
.pk-role.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--bg1)); }
.pk-role.on .pk-check { display: inline; }
.pick-list { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; margin-bottom: 8px; }
.pick-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; flex-direction: row !important; }
.pick-row:hover { background: var(--bg2); }

/* Keeper settings */
.keeper-intro { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 14px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--bg2)), var(--bg2)); margin-bottom: 8px; }
.keeper-av { width: 56px; height: 56px; flex: 0 0 56px; }
.keeper-intro b { font-size: 16px; }
.keeper-text { width: 100%; resize: vertical; min-height: 44px; font: inherit; }
.keeper-reply { white-space: pre-wrap; font: inherit; background: var(--bg2); padding: 12px; border-radius: 10px; margin: 0 0 10px; }
.cmd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 12px; }
.cmd-row { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; padding: 5px 4px; cursor: pointer; }
.cmd-row code { color: var(--accent); font-size: 13px; }
.join-roles .jr-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.jr-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--bg2); font-size: 13px; }
.jr-x { border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; padding: 2px; border-radius: 50%; }
.jr-x:hover { color: var(--text); background: var(--bg3); }
.jr-add { display: inline-flex; align-items: center; gap: 4px; border: 1px dashed var(--line); background: none; color: var(--muted); padding: 4px 10px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 13px; }
.jr-add:hover { color: var(--text); border-color: var(--accent); }
.ac-cmd { color: var(--accent); }

/* webhooks */
.hook-card { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; background: var(--bg2); margin-bottom: 8px; flex-wrap: wrap; }
.hook-av { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; }
.hook-av:hover { outline: 2px solid var(--accent); }
.hook-mid { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 160px; }
.hook-btns { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; }

/* media gallery */
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 0 10px 10px; }
.media-cell { position: relative; aspect-ratio: 1; border: 0; padding: 0; border-radius: 8px; overflow: hidden; background: var(--bg2); cursor: pointer; }
.media-cell img, .media-cell video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.media-cell:hover img, .media-cell:hover video { transform: scale(1.05); }
.media-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: #0004; }
.media-empty { grid-column: 1 / -1; }
.media-more { margin: 0 auto 12px; display: block; }

/* two-step login */
.tf-on { font-weight: 700; color: var(--green, #3ba55d); }
.tf-qr { width: 200px; height: 200px; margin: 6px auto 10px; border-radius: 12px; overflow: hidden; background: #fff; display: grid; place-items: center; color: #333; font-size: 12px; text-align: center; }
.tf-qr svg { width: 100%; height: 100%; }
.tf-key { text-align: center; margin-bottom: 10px; }
.tf-key code { font-size: 13px; letter-spacing: .04em; user-select: all; }
.tf-code { font-size: 22px; letter-spacing: .3em; text-align: center; width: 100%; }
.tf-backup { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 4px 0 12px; }
.tf-backup code { background: var(--bg2); padding: 8px; border-radius: 8px; text-align: center; font-size: 14px; letter-spacing: .05em; user-select: all; }

/* playing now */
.activity { display: flex; align-items: center; gap: 4px; font-size: 13px; margin-top: 6px; color: var(--text); flex-wrap: wrap; }
.activity svg { color: var(--accent); }
.m-sub.m-playing { color: var(--text); }
.m-sub.m-playing svg { color: var(--accent); vertical-align: -2px; }
.keeper-member .mname { display: inline-flex; align-items: center; gap: 5px; }
.keeper-member .bot-tag { vertical-align: 0; }
.keeper-pop { width: 300px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.kp-top { display: flex; gap: 12px; align-items: center; }
.kp-top b { font-size: 16px; margin-right: 6px; }
.kp-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 4px; }
.kp-cmds { display: flex; flex-direction: column; gap: 3px; max-height: 220px; overflow-y: auto; }
.kp-cmds code { color: var(--accent); font-size: 12.5px; }

/* drag channels / categories into place */
#channels .chan[draggable="true"], #channels .cat[draggable="true"] { -webkit-user-drag: element; }
#channels .dragging { opacity: .35; }
#channels .drop-before, #channels .drop-after { position: relative; }
#channels .drop-before::before, #channels .drop-after::after { content: ''; position: absolute; left: 6px; right: 6px; height: 3px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent); pointer-events: none; z-index: 2; }
#channels .drop-before::before { top: -2px; }
#channels .drop-after::after { bottom: -2px; }
#channels .cat.drop-into { background: color-mix(in srgb, var(--accent) 16%, transparent); border-radius: 6px; outline: 1px dashed var(--accent); }
#channels.dnd-on .chan:hover { background: none; }

/* view server as role */
.pv-banner { margin: 4px 6px 10px; padding: 10px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 16%, var(--bg2)); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); display: flex; flex-direction: column; gap: 8px; }
.pv-t { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.pv-t svg { color: var(--accent); }
.pv-banner .row { margin: 0; justify-content: flex-start; }
.pv-flag { margin-left: auto; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line); padding: 0 5px; border-radius: 5px; }
.chan.pv-hidden { opacity: .5; }
.pv-bar { padding: 8px 16px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--accent) 8%, var(--bg1)); display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.pv-line { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.pv-line svg { color: var(--accent); }
.pv-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.pv-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.pv-chip.yes { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--text); }
.pv-chip.yes svg { color: var(--green); }
.pv-chip.no { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--muted); }
.pv-chip.no svg { color: var(--red); }

/* voice sensitivity */
.meter-bg { position: absolute; top: 0; bottom: 0; width: 2px; background: color-mix(in srgb, var(--text) 45%, transparent); }
.meter-legend { margin: 4px 0 8px; }
.sens-ends { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: -2px; }

/* inbox */
.inbox-btn { color: var(--muted); }
.inbox-btn:hover { color: var(--accent); }
.inbox-pop { width: 420px; max-width: calc(100vw - 24px); max-height: min(560px, 80vh); display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.ib-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ib-head svg { color: var(--accent); }
.ib-head b { font-size: 15px; }
.ib-list { overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.ib-item { text-align: left; border: 0; background: none; color: var(--text); font: inherit; padding: 8px 10px; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 5px; }
.ib-item:hover { background: var(--bg2); }
.ib-top { display: flex; gap: 8px; align-items: center; font-size: 12px; flex-wrap: wrap; }
.ib-where { font-weight: 650; color: var(--muted); }
.ib-why { color: var(--accent); font-weight: 650; }
.ib-top .muted { margin-left: auto; }
.ib-body { display: flex; gap: 8px; align-items: flex-start; }
.ib-txt { font-size: 13.5px; overflow-wrap: anywhere; line-height: 1.35; }
.ib-more { margin: 6px auto; display: block; }

/* voice channel status */
.chan.has-status { flex-wrap: wrap; }
.vstatus { flex-basis: 100%; order: 10; font-size: 12px; color: var(--muted); margin: -2px 0 0 30px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* rules screen */
.rules-text { background: var(--bg2); border-radius: 12px; padding: 12px 14px; max-height: 50vh; overflow-y: auto; margin-bottom: 12px; line-height: 1.5; }

/* site admin */
.admin-sect { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.modal-card .seg { flex-wrap: wrap; }
.health-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.h-tile { background: var(--bg2); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; border: 1px solid transparent; }
.h-tile.warn { border-color: color-mix(in srgb, var(--red) 55%, transparent); background: color-mix(in srgb, var(--red) 9%, var(--bg2)); }
.h-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.h-value { font-size: 19px; font-variant-numeric: tabular-nums; }
.h-sub { font-size: 12px; color: var(--muted); }
.person .p-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.p-chip { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--bg3); color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.p-chip.bad { background: color-mix(in srgb, var(--red) 20%, transparent); color: var(--text); }
.p-chip.good { background: color-mix(in srgb, var(--green) 20%, transparent); color: var(--text); }
.person.suspended { opacity: .6; }
.small-code { max-width: 220px; font-size: 18px; }
.err-list { display: flex; flex-direction: column; gap: 4px; max-height: 55vh; overflow-y: auto; }
.err-item { background: var(--bg2); border-radius: 8px; padding: 6px 10px; border-left: 3px solid var(--yellow); }
.err-item.error { border-left-color: var(--red); }
.err-item summary { cursor: pointer; display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; list-style: none; }
.err-lvl { font-weight: 800; text-transform: uppercase; font-size: 10.5px; color: var(--muted); }
.err-time { color: var(--muted); white-space: nowrap; }
.err-first { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-family: ui-monospace, Consolas, monospace; }
.err-text { white-space: pre-wrap; font-size: 12px; margin: 8px 0 2px; max-height: 300px; overflow: auto; font-family: ui-monospace, Consolas, monospace; }
.meter-box input[type=range] { width: 100%; }
.cal-box { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--bg2); display: flex; flex-direction: column; gap: 8px; }
.cal-t { display: flex; flex-direction: column; gap: 2px; }
.cal-res { padding: 10px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.45; }
.cal-res.good { background: color-mix(in srgb, var(--green) 14%, transparent); }
.cal-res.bad { background: color-mix(in srgb, var(--yellow) 14%, transparent); }
.cal-res .row { margin-top: 8px; justify-content: flex-start; }
.ai-status.err { color: var(--red); }

/* ---------- landing page (signed-out visitors) ---------- */
@font-face { font-family: "Bricolage"; font-style: normal; font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; src: url(fonts/bricolage-latin.woff2) format("woff2"); }
.landing {
  --lp-night: #13213a; --lp-ridge: #1b2b45; --lp-pine: #102521; --lp-lantern: #ffb35c; --lp-ember: #ff8a3d; --lp-snow: #eef2f7; --lp-mist: #a9b6cb;
  position: fixed; inset: 0; overflow-y: auto; z-index: 50; background: var(--lp-pine); color: var(--lp-snow);
  font-family: Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased;
}
.landing.hidden { display: none; }
.lp-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 22px clamp(18px, 5vw, 64px); }
.lp-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--lp-snow); text-decoration: none; font-family: Bricolage, Inter, sans-serif; font-weight: 700; font-size: 22px; letter-spacing: -.01em; }
.lp-brand svg { color: var(--lp-lantern); }
.lp-link { background: none; border: 0; color: var(--lp-snow); font: 600 15px Inter, sans-serif; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.lp-link:hover { background: rgba(255, 255, 255, .08); }
.lp-hero { position: relative; min-height: min(92vh, 760px); display: flex; align-items: center; overflow: hidden; background: var(--lp-night); }
.lp-scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.lp-win { fill: #2c3b57; animation: lp-light .9s ease-out forwards; animation-delay: calc(.6s + var(--i) * .45s); }
@keyframes lp-light { 0% { fill: #2c3b57; } 35% { fill: #ffd08f; } 50% { fill: #c99a62; } 100% { fill: var(--lp-lantern); } }
.lp-copy { position: relative; z-index: 1; max-width: 46rem; margin-left: clamp(18px, 7vw, 120px); padding: 120px 0 180px; }
.lp-copy h1 { font-family: Bricolage, Inter, sans-serif; font-weight: 720; font-stretch: 96%; font-size: clamp(46px, 7.2vw, 92px); line-height: 1; letter-spacing: -.012em; margin: 0 0 22px; color: var(--lp-snow); }
.lp-lead { font-size: clamp(17px, 1.6vw, 19px); line-height: 1.6; color: #d3dbe8; margin: 0 0 30px; max-width: 32rem; }
.lp-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.lp-btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 12px; padding: 13px 22px; font: 650 16px Inter, sans-serif; cursor: pointer; text-decoration: none; border: 1px solid transparent; transition: transform .12s, background .12s; }
.lp-btn.primary { background: var(--lp-lantern); color: #2a1604; }
.lp-btn.primary:hover { background: #ffc27a; transform: translateY(-1px); }
.lp-btn.ghost { color: var(--lp-snow); border-color: rgba(238, 242, 247, .35); background: rgba(19, 33, 58, .45); }
.lp-btn.ghost:hover { border-color: var(--lp-snow); }
.lp-btn.hidden { display: none; }
.lp-note { margin: 18px 0 0; font-size: 14.5px; color: var(--lp-mist); }
.lp-shot { position: relative; z-index: 1; margin: -120px auto 0; padding: 0 clamp(14px, 5vw, 64px); max-width: 1180px; }
.lp-shot img { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid rgba(238, 242, 247, .12); box-shadow: 0 30px 80px rgba(3, 10, 8, .6); }
.lp-features { max-width: 1060px; margin: 0 auto; padding: 96px clamp(18px, 5vw, 64px) 72px; }
.lp-features h2 { font-family: Bricolage, Inter, sans-serif; font-weight: 700; font-stretch: 96%; font-size: clamp(30px, 3.6vw, 44px); letter-spacing: -.02em; margin: 0 0 40px; }
.lp-features ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 34px 56px; }
.lp-features li { display: flex; gap: 16px; align-items: flex-start; }
.lp-features li > span { flex: 0 0 auto; color: var(--lp-lantern); margin-top: 2px; }
.lp-features b { display: block; font-size: 17.5px; margin-bottom: 6px; }
.lp-features p { margin: 0; line-height: 1.6; color: var(--lp-mist); font-size: 15.5px; max-width: 36ch; }
.lp-foot { border-top: 1px solid rgba(238, 242, 247, .1); max-width: 1060px; margin: 0 auto; padding: 40px clamp(18px, 5vw, 64px) 64px; display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; justify-content: space-between; }
.lp-foot p { margin: 0; font-size: 16px; color: #d3dbe8; max-width: 44ch; line-height: 1.55; }
.landing :focus-visible { outline: 3px solid var(--lp-lantern); outline-offset: 3px; }
@media (max-width: 760px) {
  .lp-hero { min-height: 780px; align-items: flex-start; }
  .lp-copy { padding: 110px 0 300px; margin-right: 18px; }
  .lp-shot { margin-top: -24px; }
}
@media (prefers-reduced-motion: reduce) { .lp-win { animation: none; fill: var(--lp-lantern); } .lp-btn { transition: none; } }
html:not(.desktop) .auth .brand { cursor: pointer; }
#twoStepSection.flash { animation: flash 2s ease-out; border-radius: 8px; }
.seg.admin-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; }
@media (max-width: 560px) { .seg.admin-tabs { grid-template-columns: repeat(2, 1fr); } }
