/* Trixie Messenger web client */
:root {
  --accent: #8b5cf6;
  --accent-soft: color-mix(in srgb, var(--accent) 18%, transparent);
  --accent-strong: color-mix(in srgb, var(--accent) 80%, #fff);
  --danger: #f43f5e;
  --warn: #f59e0b;
  --ok: #22c55e;
  --radius: 10px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, ui-monospace, monospace;
  font-size: 15px;
}
:root.fs-small { font-size: 13.5px; }
:root.fs-large { font-size: 17px; }

[data-theme="dark"] {
  --bg-0: #0f1117; --bg-1: #151821; --bg-2: #1b1f2a; --bg-3: #242938; --bg-hover: #2a3042;
  --line: #2b3142; --text: #e6e8ef; --text-2: #a3a9bb; --text-3: #6f768a; --shadow: 0 12px 40px rgba(0,0,0,.45);
  color-scheme: dark;
}
[data-theme="midnight"] {
  --bg-0: #000; --bg-1: #07080c; --bg-2: #0c0e14; --bg-3: #141722; --bg-hover: #1a1e2b;
  --line: #1c2030; --text: #e9ebf3; --text-2: #9aa1b5; --text-3: #616881; --shadow: 0 12px 40px rgba(0,0,0,.7);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg-0: #e9ebf1; --bg-1: #f2f3f7; --bg-2: #ffffff; --bg-3: #eef0f5; --bg-hover: #e6e8ef;
  --line: #dcdfe8; --text: #1b1e27; --text-2: #4e5568; --text-3: #8a90a2; --shadow: 0 12px 40px rgba(20,24,40,.18);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg-0); color: var(--text); font-family: var(--font); line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-strong); }
::selection { background: var(--accent-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--text-3); }
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: .85em; }

/* ---------- buttons & inputs ---------- */
.btn { border: 0; border-radius: 8px; padding: .55em 1em; background: var(--bg-3); cursor: pointer; font-weight: 600; transition: background .12s, transform .05s; white-space: nowrap; }
.btn:hover { background: var(--bg-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 85%, #000); }
.btn.danger { background: color-mix(in srgb, var(--danger) 85%, #000); color: #fff; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--bg-hover); }
.btn.sm { padding: .3em .7em; font-size: .85em; }
.icon-btn { border: 0; background: transparent; color: var(--text-2); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; display: inline-grid; place-items: center; font-size: 1.05em; }
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn.active { color: var(--accent-strong); }
.input, select.input, textarea.input { width: 100%; padding: .6em .8em; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-1); outline: none; transition: border-color .12s, box-shadow .12s; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label.field, div.field { display: block; margin-bottom: .9em; }
label.field > span, div.field > span { display: block; font-size: .78em; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); margin-bottom: .35em; }
.check { display: flex; align-items: center; gap: .6em; cursor: pointer; margin: .4em 0; }
.check input { width: 1.1em; height: 1.1em; accent-color: var(--accent); }
.error-text { color: var(--danger); font-size: .9em; min-height: 1.2em; margin: .3em 0; }
.row { display: flex; gap: .6em; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- login ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 10% -10%, var(--accent-soft), transparent 60%),
              radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%), var(--bg-0); }
.auth-card { width: min(440px, 100%); background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: var(--shadow); }
.auth-card h1 { margin: 0 0 .1em; font-size: 1.6em; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.brand img { width: 52px; height: 52px; border-radius: 50%; }
.motd { background: var(--bg-1); border-left: 3px solid var(--accent); padding: .6em .8em; border-radius: 6px; color: var(--text-2); margin: 0 0 1.2em; white-space: pre-wrap; font-size: .92em; }
.auth-switch { margin-top: 1em; text-align: center; font-size: .9em; color: var(--text-2); }
.linkish { background: none; border: 0; color: var(--accent-strong); cursor: pointer; padding: 0; font-weight: 600; }
.linkish:hover { text-decoration: underline; }

/* ---------- app layout ---------- */
.app { display: grid; grid-template-columns: 260px 1fr auto; height: 100vh; overflow: hidden; }
.sidebar { background: var(--bg-1); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.server-head { padding: 14px 14px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.server-head .logo { width: 36px; height: 36px; flex: none; border-radius: 50%; }
.server-head .name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-head .sub { font-size: .75em; color: var(--text-3); display: flex; align-items: center; gap: 5px; }
.lock-badge { color: var(--ok); }
.chan-scroll { flex: 1; overflow-y: auto; padding: 8px 8px 16px; display: flex; flex-direction: column; }
.chan-scroll > * { flex: none; }
.section-title { display: flex; align-items: center; padding: 14px 8px 4px; font-size: .72em; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.section-title .icon-btn { width: 22px; height: 22px; font-size: 1.1em; }
.chan { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; color: var(--text-2); cursor: pointer; user-select: none; position: relative; }
.chan:hover { background: var(--bg-hover); color: var(--text); }
.chan.active { background: var(--accent-soft); color: var(--text); }
.chan.unread { color: var(--text); font-weight: 700; }
.chan .glyph { width: 18px; text-align: center; color: var(--text-3); flex: none; }
.chan .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.badge { background: var(--danger); color: #fff; font-size: .7em; font-weight: 800; border-radius: 10px; padding: 1px 6px; min-width: 18px; text-align: center; }
.me-bar { border-top: 1px solid var(--line); padding: 10px; display: flex; align-items: center; gap: 10px; background: var(--bg-0); }
.me-bar .who { flex: 1; min-width: 0; }
.me-bar .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; position: relative; font-size: .85em; text-transform: uppercase; }
.avatar.sm { width: 24px; height: 24px; font-size: .65em; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.4em; }
.avatar .dot { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--bg-1); background: var(--text-3); }
.avatar .dot.on { background: var(--ok); }
.avatar.sm .dot { width: 10px; height: 10px; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg-2); }
.chan-header { height: 54px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 0 12px 0 18px; flex: none; }
.chan-header .title { font-weight: 800; font-size: 1.05em; white-space: nowrap; }
.chan-header .topic { color: var(--text-2); font-size: .9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; border-left: 1px solid var(--line); padding-left: 10px; }
.banner { background: color-mix(in srgb, var(--warn) 20%, var(--bg-2)); color: var(--text); padding: 8px 18px; font-size: .9em; display: flex; gap: 10px; align-items: center; border-bottom: 1px solid var(--line); }
.banner.err { background: color-mix(in srgb, var(--danger) 22%, var(--bg-2)); }

.messages { flex: 1; overflow-y: auto; padding: 16px 0 8px; min-height: 0; }
.chan-intro { padding: 16px 20px 20px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.chan-intro h2 { margin: 6px 0 4px; }
.chan-intro .big { width: 56px; height: 56px; border-radius: 50%; background: var(--bg-3); display: grid; place-items: center; font-size: 1.8em; color: var(--text-2); }
.day-sep { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: .75em; font-weight: 700; margin: 14px 20px 6px; }
.day-sep::before, .day-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.msg { display: grid; grid-template-columns: 40px 1fr; gap: 0 14px; padding: 3px 20px; position: relative; }
.msg.first { margin-top: 12px; }
.msg:hover { background: color-mix(in srgb, var(--bg-hover) 45%, transparent); }
.msg.mention { background: color-mix(in srgb, var(--warn) 9%, transparent); box-shadow: inset 3px 0 0 var(--warn); }
.msg .gutter { color: var(--text-3); font-size: .68em; text-align: right; padding-top: .35em; opacity: 0; }
.msg:hover .gutter { opacity: 1; }
.msg .avatar { width: 40px; height: 40px; cursor: pointer; }
.msg .meta { display: flex; align-items: baseline; gap: 8px; }
.msg .author { font-weight: 700; cursor: pointer; }
.msg .author:hover { text-decoration: underline; }
.msg .time { color: var(--text-3); font-size: .75em; }
.msg .body { white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.msg .edited { color: var(--text-3); font-size: .72em; margin-left: 4px; }
.msg .body code { font-family: var(--mono); background: var(--bg-3); padding: .1em .35em; border-radius: 5px; font-size: .88em; }
.msg .body pre { background: var(--bg-1); border: 1px solid var(--line); border-radius: 8px; padding: .7em .9em; overflow-x: auto; margin: .3em 0; white-space: pre; }
.msg .body pre code { background: none; padding: 0; }
.msg .body blockquote { margin: .2em 0; padding-left: .8em; border-left: 3px solid var(--line); color: var(--text-2); }
.mention-tag { background: var(--accent-soft); color: var(--accent-strong); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.msg-actions { position: absolute; right: 16px; top: -14px; display: none; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 2px; }
.msg:hover .msg-actions { display: flex; }
.msg-actions .icon-btn { width: 30px; height: 28px; }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.reaction { border: 1px solid var(--line); background: var(--bg-1); border-radius: 8px; padding: 1px 8px; font-size: .85em; cursor: pointer; display: inline-flex; gap: 5px; align-items: center; }
.reaction.mine { border-color: var(--accent); background: var(--accent-soft); }
.reaction:hover { border-color: var(--text-3); }
:root.compact .msg { grid-template-columns: 52px 1fr; padding-top: 1px; padding-bottom: 1px; }
:root.compact .msg.first { margin-top: 4px; }
:root.compact .msg .avatar { display: none; }
:root.compact .msg .gutter { opacity: 1; }
:root.compact .msg .meta { display: inline-flex; margin-right: 6px; }
:root.compact .msg .content { display: block; }
:root.compact .msg .body { display: inline; }
.edit-box textarea { width: 100%; }
.load-more { text-align: center; padding: 6px; }

.composer-wrap { padding: 0 18px 6px; flex: none; position: relative; }
.composer { display: flex; align-items: flex-end; gap: 8px; background: var(--bg-3); border-radius: 12px; padding: 8px 8px 8px 14px; border: 1px solid transparent; }
.composer:focus-within { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.composer textarea { flex: 1; background: transparent; border: 0; outline: none; resize: none; max-height: 40vh; min-height: 1.45em; padding: 4px 0; }
.composer.disabled { opacity: .6; }
.typing { height: 20px; font-size: .78em; color: var(--text-2); padding: 2px 4px; }
.typing b { color: var(--text); }
.char-count { font-size: .72em; color: var(--text-3); align-self: center; }
.char-count.over { color: var(--danger); }
.autocomplete { position: absolute; bottom: 100%; left: 18px; right: 18px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; max-height: 240px; overflow-y: auto; z-index: 5; }
.autocomplete .opt { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.autocomplete .opt.sel, .autocomplete .opt:hover { background: var(--accent-soft); }

.members { width: 240px; background: var(--bg-1); border-left: 1px solid var(--line); overflow-y: auto; padding: 8px; }
.member { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.member:hover { background: var(--bg-hover); }
.member.offline { opacity: .5; }
.member .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

.empty-main { flex: 1; display: grid; place-items: center; color: var(--text-3); text-align: center; padding: 20px; }

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(4,6,12,.62); display: grid; place-items: center; z-index: 50; padding: 20px; animation: fade .12s ease-out; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
.modal { background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); width: min(520px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop .14s ease-out; }
.modal.wide { width: min(1040px, 100%); height: min(760px, calc(100vh - 40px)); }
.modal-head { display: flex; align-items: center; padding: 16px 18px 10px; gap: 10px; }
.modal-head h3 { margin: 0; font-size: 1.15em; flex: 1; }
.modal-body { padding: 4px 18px 16px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--bg-1); border-radius: 0 0 16px 16px; }

.tabs-layout { display: grid; grid-template-columns: 210px 1fr; flex: 1; min-height: 0; }
.tabs-nav { background: var(--bg-1); padding: 10px; border-right: 1px solid var(--line); overflow-y: auto; border-bottom-left-radius: 16px; }
.tabs-nav .tab { padding: 7px 10px; border-radius: 7px; cursor: pointer; color: var(--text-2); font-weight: 600; margin-bottom: 2px; }
.tabs-nav .tab:hover { background: var(--bg-hover); color: var(--text); }
.tabs-nav .tab.active { background: var(--accent-soft); color: var(--text); }
.tabs-nav .grp { font-size: .7em; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 12px 10px 4px; }
.tab-pane { padding: 18px 22px; overflow-y: auto; }
.tab-pane h4 { margin: 0 0 .3em; font-size: 1.15em; }
.tab-pane .lead { color: var(--text-2); margin: 0 0 1.2em; font-size: .92em; }
.setting-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.setting-row .lbl { flex: 1; }
.setting-row .ctl { width: 220px; display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.setting-row .ctl .input { width: 100%; }
.setting-row.locked .lbl::after { content: " 🔒"; }
.setting-row.sub-setting { padding-left: 18px; border-left: 2px solid var(--line); margin-left: 4px; }
.setting-row.forced-off .lbl { opacity: .6; }
.setting-row .note { font-size: .78em; color: var(--text-3); }
.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--bg-3); border-radius: 22px; cursor: pointer; transition: .15s; border: 1px solid var(--line); }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.switch input:checked + span::before { transform: translateX(18px); }
.switch input:disabled + span { opacity: .5; cursor: not-allowed; }

table.grid { width: 100%; border-collapse: collapse; font-size: .92em; }
table.grid th { text-align: left; color: var(--text-3); font-size: .75em; text-transform: uppercase; letter-spacing: .06em; padding: 6px 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg-2); }
table.grid td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid tr:hover td { background: color-mix(in srgb, var(--bg-hover) 40%, transparent); }
.pill { display: inline-block; border-radius: 20px; padding: 1px 9px; font-size: .78em; font-weight: 700; border: 1px solid currentColor; }
.role-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.perm-list .perm { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.perm-list .perm .d { font-size: .82em; color: var(--text-3); }
.list-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; }
.list-item:hover { background: var(--bg-hover); }

/* ---------- popover / toast ---------- */
.popover { position: fixed; z-index: 60; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; animation: pop .1s ease-out; }
.profile-card { width: 280px; }
.profile-card .top { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
#toasts { position: fixed; bottom: calc(var(--composer-h, 0px) + 22px); right: 18px; transition: bottom .15s; display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast { background: var(--bg-3); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 10px 14px; box-shadow: var(--shadow); max-width: 360px; animation: pop .15s ease-out; }
.toast.err { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--ok); }

/* ---------- composer extras (v1.1) ---------- */
.composer { align-items: center; padding: 6px 6px 6px 6px; }
.composer textarea { padding: 6px 4px; align-self: stretch; }
.comp-btn { width: 34px; height: 34px; font-size: 1.15em; flex: none; }
.comp-btn:disabled { opacity: .4; cursor: not-allowed; }
.gif-btn { font-size: .72em; font-weight: 900; letter-spacing: .04em; border: 1.5px solid currentColor; width: auto; height: 22px; padding: 0 5px; border-radius: 5px; margin: 0 5px; }
.send-btn { align-self: center; }
.upload-tray { display: flex; gap: 8px; overflow-x: auto; padding: 8px 2px; }
.up-chip { position: relative; display: flex; gap: 8px; align-items: center; background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px; padding: 6px 30px 6px 6px; min-width: 190px; max-width: 260px; flex: none; }
.up-chip img, .up-chip .up-icon { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex: none; display: grid; place-items: center; background: var(--bg-1); font-size: 1.4em; }
.up-meta { min-width: 0; flex: 1; }
.up-name { font-size: .85em; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-bar { height: 4px; background: var(--bg-1); border-radius: 4px; overflow: hidden; margin-top: 4px; }
.up-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.up-chip.done .up-bar span { background: var(--ok); }
.up-chip.error { border-color: var(--danger); }
.up-chip.error .up-bar span { background: var(--danger); width: 100% !important; }
.up-rm { position: absolute; top: 4px; right: 4px; border: 0; background: transparent; color: var(--text-3); cursor: pointer; border-radius: 6px; width: 22px; height: 22px; }
.up-rm:hover { background: var(--bg-hover); color: var(--danger); }
.main.dropping { box-shadow: inset 0 0 0 3px var(--accent); }
.main.dropping::after { content: "Drop files to upload"; position: fixed; inset: auto 0 50% 0; text-align: center; font-weight: 800; font-size: 1.4em; color: var(--accent-strong); pointer-events: none; }

/* ---------- emoji picker ---------- */
.emoji-picker { width: 352px; height: 380px; display: flex; flex-direction: column; gap: 6px; }
.emoji-search { padding: .45em .7em; }
.emoji-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding-bottom: 4px; overflow-x: auto; }
.emoji-tabs button { border: 0; background: transparent; font-size: 1.1em; padding: 3px 6px; border-radius: 6px; cursor: pointer; flex: none; }
.emoji-tabs button:hover { background: var(--bg-hover); }
.emoji-scroll { overflow-y: auto; flex: 1; position: relative; }
.emoji-sec-title { font-size: .7em; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); padding: 8px 4px 4px; position: sticky; top: 0; background: var(--bg-2); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 2px; }
.emoji-grid button { border: 0; background: transparent; font-size: 1.45em; border-radius: 7px; cursor: pointer; height: 38px; padding: 0; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
.emoji-grid button:hover { background: var(--bg-hover); transform: scale(1.12); }

/* ---------- GIF picker ---------- */
.gif-picker { width: 420px; height: 460px; display: flex; flex-direction: column; gap: 6px; }
.gif-scroll { flex: 1; overflow-y: auto; }
.gif-status { padding: 2px 2px 6px; font-weight: 700; }
.gif-grid { columns: 2; column-gap: 6px; }
.gif-item { display: block; width: 100%; border: 0; padding: 0; margin: 0 0 6px; border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--bg-3); break-inside: avoid; }
.gif-item { position: relative; }
.gif-item img { display: block; width: 100%; height: auto; }
.gif-badge { position: absolute; left: 5px; bottom: 5px; font-size: 9px; font-weight: 900; letter-spacing: .05em; padding: 1px 5px; border-radius: 4px; background: rgba(0,0,0,.6); color: #fff; opacity: .85; }
.gif-badge.klipy { background: rgba(124, 58, 237, .85); }
.gif-badge.giphy { background: rgba(0, 0, 0, .75); }
.gif-item:hover { outline: 3px solid var(--accent); }
.gif-foot { text-align: right; font-weight: 700; letter-spacing: .04em; }

/* ---------- attachments ---------- */
.attachments { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; align-items: flex-start; }
.att-media img, .att-media video { display: block; max-width: min(400px, 100%); max-height: 320px; border-radius: 10px; background: var(--bg-3); cursor: zoom-in; object-fit: contain; }
.att-media video { cursor: default; }
.att-media.gif img { border-radius: 8px; }
.att-file { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; background: var(--bg-1); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: min(420px, 100%); }
.att-icon { font-size: 1.8em; }
.att-info { min-width: 0; }
.att-name { font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.att-name:hover { text-decoration: underline; }
.att-file audio { grid-column: 1 / -1; width: 100%; height: 36px; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; gap: 12px; animation: fade .12s; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 110px); object-fit: contain; border-radius: 6px; cursor: zoom-out; }
.lightbox-bar { display: flex; gap: 10px; align-items: center; color: #eee; flex-wrap: wrap; justify-content: center; }
.lightbox-bar .btn { text-decoration: none; }

/* ---------- v1.3: image previews in the upload tray ---------- */
.up-chip.image { padding: 6px 6px 6px 6px; min-width: 230px; }
.up-thumb { position: relative; border: 0; padding: 0; background: var(--bg-1); border-radius: 8px; overflow: hidden; cursor: zoom-in; flex: none; width: 76px; height: 76px; }
.up-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 0; transition: filter .15s; }
.up-thumb:hover img { filter: brightness(1.1); }
.up-spoiler-tag { display: none; position: absolute; inset: auto 0 6px 0; margin: auto; width: max-content; font-size: 9px; font-weight: 900; letter-spacing: .08em; padding: 2px 6px; border-radius: 4px; background: rgba(0,0,0,.7); color: #fff; }
.up-chip.spoiler .up-thumb img { filter: blur(10px) brightness(.8); }
.up-chip.spoiler .up-spoiler-tag { display: block; }
.up-chip { padding-right: 6px; }
.up-tools { display: flex; flex-direction: column; gap: 2px; align-self: flex-start; }
.up-tools button { border: 0; background: transparent; color: var(--text-3); cursor: pointer; border-radius: 6px; width: 26px; height: 24px; font-size: .9em; }
.up-tools button:hover { background: var(--bg-hover); color: var(--text); }
.up-tools .up-spoiler-btn.on { color: var(--accent-strong); background: var(--accent-soft); }
.up-rm { display: none; }

/* ---------- v1.3: replies ---------- */
.reply-bar { display: flex; align-items: center; gap: 8px; background: var(--bg-1); border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; padding: 6px 6px 6px 14px; font-size: .85em; color: var(--text-2); }
.reply-bar-label { white-space: nowrap; }
.reply-bar-label b { color: var(--text); }
.reply-bar-excerpt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); }
.reply-bar .icon-btn { width: 26px; height: 26px; }
.composer.replying { border-top-left-radius: 0; border-top-right-radius: 0; }
.msg.has-reply { margin-top: 14px; }
.reply-ref { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; margin: 0 0 3px 20px; padding-left: 34px; position: relative; font-size: .82em; color: var(--text-2); cursor: pointer; min-width: 0; max-width: 100%; }
.reply-ref::before { content: ""; position: absolute; left: 0; top: 50%; width: 28px; height: 12px; border-left: 2px solid var(--line); border-top: 2px solid var(--line); border-top-left-radius: 7px; }
.reply-ref:hover .reply-ref-text { color: var(--text); }
.reply-ref-name { font-weight: 700; white-space: nowrap; }
.reply-ref-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.reply-ref-att { color: var(--text-3); }
.reply-ref.deleted { cursor: default; font-style: italic; color: var(--text-3); }
.avatar.xs { width: 16px; height: 16px; font-size: .5em; }
:root.compact .reply-ref { margin-left: 52px; }
@keyframes msgflash { 0%, 30% { background: color-mix(in srgb, var(--accent) 28%, transparent); } 100% { background: transparent; } }
.msg.flash { animation: msgflash 2.2s ease-out; }

/* ---------- v1.3: spoilers ---------- */
.att-media { position: relative; display: inline-block; max-width: 100%; }
.att-media.spoiler { overflow: hidden; border-radius: 10px; }
.att-media.spoiler img, .att-media.spoiler video { transition: filter .2s; }
.att-media.spoiler.concealed img, .att-media.spoiler.concealed video { filter: blur(44px) brightness(.75); transform: scale(1.04); }
.spoiler-cover { display: none; position: absolute; inset: 0; border: 0; background: rgba(10,12,20,.25); cursor: pointer; place-items: center; z-index: 1; }
.spoiler-cover span { background: rgba(0,0,0,.72); color: #fff; font-weight: 900; letter-spacing: .12em; font-size: .78em; padding: 6px 12px; border-radius: 20px; }
.spoiler-cover:hover span { background: #000; }
.att-media.spoiler.concealed .spoiler-cover { display: grid; }
.spoiler-hide { display: none; position: absolute; top: 6px; right: 6px; z-index: 2; border: 0; width: 30px; height: 30px; border-radius: 8px; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; place-items: center; opacity: .85; }
.spoiler-hide:hover { opacity: 1; background: rgba(0,0,0,.8); }
.att-media.spoiler:not(.concealed) .spoiler-hide { display: grid; }

/* ---------- v1.3: image editor (preview / crop / spoiler) ---------- */
.modal.editor-modal { width: min(860px, 100%); }
.editor-preview { display: flex; justify-content: center; background: repeating-conic-gradient(var(--bg-3) 0 25%, var(--bg-1) 0 50%) 0 0 / 18px 18px; border-radius: 10px; padding: 10px; margin-bottom: 6px; }
.crop-stage { position: relative; display: inline-block; line-height: 0; user-select: none; touch-action: none; }
.crop-stage img { max-width: 100%; max-height: min(60vh, 560px); display: block; }
.editor-preview.spoiler-on img { filter: blur(24px) brightness(.8); }
.crop-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0,0,0,.55); cursor: move; touch-action: none; }
.crop-box::before, .crop-box::after { content: ""; position: absolute; inset: 0; pointer-events: none; border: 1px solid rgba(255,255,255,.35); }
.crop-box::before { left: 33.33%; right: 33.33%; border-top: 0; border-bottom: 0; }
.crop-box::after { top: 33.33%; bottom: 33.33%; border-left: 0; border-right: 0; }
.crop-h { position: absolute; width: 14px; height: 14px; background: #fff; border: 2px solid var(--accent); border-radius: 3px; z-index: 1; }
.crop-h.nw { left: -8px; top: -8px; cursor: nwse-resize; } .crop-h.se { right: -8px; bottom: -8px; cursor: nwse-resize; }
.crop-h.ne { right: -8px; top: -8px; cursor: nesw-resize; } .crop-h.sw { left: -8px; bottom: -8px; cursor: nesw-resize; }
.crop-h.n { left: calc(50% - 7px); top: -8px; cursor: ns-resize; } .crop-h.s { left: calc(50% - 7px); bottom: -8px; cursor: ns-resize; }
.crop-h.e { top: calc(50% - 7px); right: -8px; cursor: ew-resize; } .crop-h.w { top: calc(50% - 7px); left: -8px; cursor: ew-resize; }
.crop-box.locked .crop-h.n, .crop-box.locked .crop-h.s, .crop-box.locked .crop-h.e, .crop-box.locked .crop-h.w { display: none; }
.crop-ratios .btn { padding: .25em .6em; }
@media (hover: none) { .crop-h { width: 22px; height: 22px; } .crop-h.nw, .crop-h.ne { top: -12px; } .crop-h.sw, .crop-h.se { bottom: -12px; } .crop-h.nw, .crop-h.sw { left: -12px; } .crop-h.ne, .crop-h.se { right: -12px; } }

.mobile-only { display: none !important; }
.scrim { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: 220px 1fr; }
  .members { display: none; }
  .tabs-layout { grid-template-columns: 1fr; }
  .tabs-nav { display: flex; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
  .tabs-nav .grp { display: none; }
}

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .mobile-only { display: inline-grid !important; }
  .btn.mobile-only { display: inline-block !important; margin-top: 10px; }
  .app { grid-template-columns: 1fr; height: 100dvh; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 30; transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow); padding-top: env(safe-area-inset-top); }
  .app.nav-open .sidebar { transform: none; }
  .members { display: block !important; position: fixed; inset: 0 0 0 auto; width: min(280px, 82vw); z-index: 30; transform: translateX(102%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .members.hidden { display: none !important; }
  .app.members-open .members { transform: none; }
  .app.nav-open .scrim, .app.members-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 25; }
  .chan-header { padding: 0 6px; gap: 6px; height: 50px; }
  .chan-header .topic { display: none; }
  .chan-header .title { flex: 1; overflow: hidden; text-overflow: ellipsis; }
  .msg { padding: 3px 10px; grid-template-columns: 36px 1fr; gap: 0 10px; }
  .msg .avatar { width: 36px; height: 36px; }
  .msg-actions { right: 8px; }
  .msg.sel { background: color-mix(in srgb, var(--bg-hover) 55%, transparent); }
  .composer-wrap { padding: 0 8px calc(4px + env(safe-area-inset-bottom)); }
  .composer { gap: 2px; }
  .comp-btn { width: 32px; }
  .send-btn { padding: .45em .7em; }
  .overlay { padding: 0; }
  .modal, .modal.wide { width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .modal-foot { border-radius: 0; flex-wrap: wrap; }
  .setting-row { flex-wrap: wrap; }
  .setting-row .ctl { width: 100%; justify-content: flex-start; }
  table.grid { font-size: .82em; }
  .popover { left: 6px !important; right: 6px; max-width: calc(100vw - 12px); }
  .emoji-picker, .gif-picker { width: 100%; height: min(420px, 60dvh); }
  #toasts { left: 10px; right: 10px; bottom: calc(var(--composer-h, 60px) + 14px); }
  .toast { max-width: none; }
  .auth-card { padding: 22px; }
  .tab-pane { padding: 14px; }
}
@media (hover: none) {
  .msg:hover .msg-actions { display: none; }
  .msg.sel .msg-actions { display: flex; }
  .msg .gutter { opacity: 0 !important; }
}

/* ---------------------------------------------------------------- profile pictures (v1.4.0) */
.avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--bg-2); }
.avatar.has-img { color: transparent; }
.avatar.xl { width: 96px; height: 96px; font-size: 2em; }
.crop-box.round { border-radius: 50%; }
.crop-box.round::before, .crop-box.round::after { display: none; }
.editor-preview.round-preview .crop-stage img { border-radius: 50%; aspect-ratio: 1; object-fit: cover; max-height: min(50vh, 360px); }
.avatar-current { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.avatar-history { display: flex; gap: 12px; flex-wrap: wrap; }
.avatar-hist { position: relative; width: 64px; height: 64px; }
.avatar-hist-pick { width: 64px; height: 64px; padding: 0; border-radius: 50%; border: 2px solid transparent; background: var(--bg-2); cursor: pointer; overflow: hidden; }
.avatar-hist-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-hist-pick:hover:not(:disabled) { border-color: var(--accent); }
.avatar-hist.current .avatar-hist-pick { border-color: var(--ok); cursor: default; }
.avatar-hist-tag { position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); background: var(--ok); color: #fff; font-size: .62em; font-weight: 700; padding: 1px 6px; border-radius: 8px; }
.avatar-hist-del { position: absolute; top: -4px; right: -4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--bg-3); color: var(--text); font-size: .7em; cursor: pointer; opacity: 0; transition: opacity .15s; }
.avatar-hist:hover .avatar-hist-del, .avatar-hist-del:focus { opacity: 1; }
@media (hover: none) { .avatar-hist-del { opacity: 1; } }
.avatar-hist-del:hover { background: var(--danger); color: #fff; }

/* ---------------------------------------------------------------- client update prompt (v1.4.0) */
.update-prompt { position: fixed; top: 14px; right: 14px; z-index: 45; width: min(400px, calc(100vw - 28px)); display: flex; gap: 12px;
  padding: 14px 16px; background: var(--bg-2); border: 1px solid var(--accent); border-radius: 12px; box-shadow: var(--shadow); animation: upd-in .25s ease-out; }
.update-prompt .update-icon { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); font-weight: 800; }
.update-prompt .update-text { min-width: 0; line-height: 1.4; }
@keyframes upd-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 760px) { .update-prompt { top: 8px; right: 8px; left: 8px; width: auto; } }
.update-bar { position: relative; height: 8px; margin-top: 12px; border-radius: 4px; background: var(--bg-3); overflow: hidden; }
.update-bar > span { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); border-radius: 4px; transition: width .3s; }
.update-bar.indeterminate > span { width: 35% !important; animation: upd-slide 1.1s ease-in-out infinite; }
@keyframes upd-slide { from { left: -35%; } to { left: 100%; } }

/* ---------------------------------------------------------------- status (v1.5.0) */
.avatar .dot.away { background: var(--warn); }
.avatar .dot.dnd { background: var(--danger); }
.avatar .dot.dnd::after { content: ""; position: absolute; left: 50%; top: 50%; width: 55%; height: 2px; transform: translate(-50%, -50%); background: var(--bg-1); border-radius: 1px; }
.avatar .dot.away::after { content: ""; position: absolute; left: -1px; top: -1px; width: 60%; height: 60%; border-radius: 50%; background: var(--bg-1); }
.status-dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--text-3); vertical-align: middle; position: relative; }
.status-dot.online { background: var(--ok); }
.status-dot.away { background: var(--warn); }
.status-dot.dnd { background: var(--danger); }
.status-dot.dnd::after { content: ""; position: absolute; left: 2px; right: 2px; top: 4px; height: 2px; background: var(--bg-2); border-radius: 1px; }
.me-status-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px; margin: -4px; border-radius: 8px; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.me-status-btn:hover { background: var(--bg-hover); }
.me-status-btn .who { flex: 1; min-width: 0; }
.me-status-btn .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-menu { width: 300px; }
.status-opt { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.status-opt:hover { background: var(--bg-hover); }
.status-opt.sel { background: var(--accent-soft); }
.status-opt .status-check { margin-left: auto; color: var(--accent-strong); font-weight: 800; }
.status-menu .row .input { flex: 1; min-width: 0; }
.dm-status { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
.dm-status-label { white-space: nowrap; }
.dm-custom-status { font-style: italic; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.member-status, .member-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-status { color: var(--text-2); }
.profile-status { margin: -2px 0 8px; padding: 6px 10px; border-radius: 8px; background: var(--bg-3); font-size: .9em; word-break: break-word; }
.hover-tip { position: fixed; z-index: 2000; max-width: 280px; padding: 6px 10px; border-radius: 8px; background: var(--bg-0); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: .85em; line-height: 1.4; word-break: break-word; pointer-events: none; }

/* ---------------------------------------------------------------- custom emoji (v1.5.0) */
.cemoji { width: 1.375em; height: 1.375em; object-fit: contain; vertical-align: -0.3em; display: inline-block; }
.body.jumbo .cemoji { width: 3em; height: 3em; vertical-align: middle; margin: 2px 2px 0 0; }
.cemoji.big { width: 40px; height: 40px; }
.reaction .cemoji { width: 1.2em; height: 1.2em; }
.emoji-grid button .cemoji { width: 24px; height: 24px; vertical-align: middle; }
.emoji-picker > .row { gap: 6px; }
.emoji-picker > .row .input { flex: 1; min-width: 0; }
.emoji-upload-preview { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-height: 56px; padding: 8px 12px; margin-bottom: 10px; border-radius: 10px; background: var(--bg-3); }
.emoji-upload-preview .msg-sample { font-size: .95em; }
.emoji-table td { vertical-align: middle; }
.muted-row { opacity: .55; }
.input.sm { padding: 4px 8px; font-size: .9em; }

/* ---------------------------------------------------------------- favourite GIFs (v1.5.0) */
.gif-star { position: absolute; top: 6px; right: 6px; z-index: 3; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; cursor: pointer; opacity: 0; transition: opacity .15s, transform .15s; padding: 0; }
.gif-star svg { fill: none; }
.gif-star.on { color: #facc15; }
.gif-star.on svg { fill: #facc15; }
.gif-item:hover .gif-star, .att-media:hover .gif-star, .gif-star:focus-visible { opacity: 1; }
.gif-star:hover { transform: scale(1.12); background: rgba(0,0,0,.75); }
@media (hover: none) { .gif-star.on { opacity: 1; } .msg.sel .gif-star, .gif-item .gif-star { opacity: 1; } }
.att-media.spoiler .gif-star { right: 40px; }
.att-media.concealed .gif-star { display: none; }
/* v1.56.12: the desktop app's save button on videos */
.att-video-dl { position: absolute; top: 6px; left: 6px; z-index: 3; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; opacity: 0; transition: opacity .15s, transform .15s; }
.att-video-dl svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.att-media:hover .att-video-dl, .att-video-dl:focus-visible { opacity: 1; }
.att-video-dl:hover { transform: scale(1.12); background: rgba(0,0,0,.75); }
.att-media.concealed .att-video-dl { display: none; }
.gif-tabs { display: flex; gap: 4px; }
.gif-tab { flex: 1; border: 0; padding: 6px 8px; border-radius: 8px; background: var(--bg-3); color: var(--text-2); font: inherit; font-weight: 700; cursor: pointer; }
.gif-tab.active { background: var(--accent-soft); color: var(--accent-strong); }
.gif-empty { padding: 30px 12px; text-align: center; column-span: all; }
.up-chip.sending { opacity: .5; }

/* ---------------------------------------------------------------- formatting (v1.6.0) */
.fmt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 8px; margin-bottom: 6px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; }
.fmt-group { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.fmt-group + .fmt-group { padding-left: 8px; margin-left: 2px; box-shadow: inset 1px 0 0 var(--line); }
.fmt-group.fmt-colors { box-shadow: none; padding-left: 4px; }
.fmt-btn { min-width: 30px; height: 28px; padding: 0 6px; border: 0; border-radius: 6px; background: none; color: var(--text-2); font: inherit; font-size: .9em; cursor: pointer; }
.fmt-btn:hover { background: var(--bg-hover); color: var(--text); }
.fmt-spoiler { letter-spacing: -2px; }
.fmt-select { height: 28px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg-1); color: var(--text); font: inherit; font-size: .85em; padding: 0 4px; }
.fmt-swatch { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--bg-2); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; margin: 0 1px; }
.fmt-swatch:hover { transform: scale(1.15); }
.fmt-color-input { width: 26px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; }
.fmt-toggle { font-weight: 800; font-size: .95em !important; letter-spacing: -.02em; }
.fmt-toggle.active { color: var(--accent-strong); background: var(--accent-soft); }
.shortcut-list { width: 260px; }
.shortcut-list .row { padding: 3px 0; font-size: .9em; }
kbd { font-family: var(--mono); font-size: .8em; padding: 1px 6px; border-radius: 5px; background: var(--bg-3); border: 1px solid var(--line); border-bottom-width: 2px; }
.fs-small { font-size: .82em; }
.fs-large { font-size: 1.35em; line-height: 1.3; }
.fs-huge { font-size: 1.9em; line-height: 1.2; font-weight: 700; }
@font-face { font-family: "Trixie Serif"; src: local("Georgia"), url("/fonts/Merriweather-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Trixie Serif"; src: local("Georgia Bold"), local("Georgia-Bold"), url("/fonts/Merriweather-Bold.woff") format("woff"); font-weight: 700; font-display: swap; }
.ff-serif { font-family: Georgia, "Trixie Serif", "Times New Roman", serif; }
.ff-mono { font-family: var(--mono); }
/* Fonts that phones don't have are served by the server itself (SIL Open Font Licence, see web/fonts). */
@font-face { font-family: "Trixie Comic"; src: local("Comic Sans MS"), url("/fonts/ComicNeue-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Trixie Comic"; src: local("Comic Sans MS Bold"), local("ComicSansMS-Bold"), url("/fonts/ComicNeue-Bold.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Trixie Script"; src: url("/fonts/Caveat.woff") format("woff"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Trixie Impact"; src: local("Impact"), url("/fonts/Anton-Regular.woff") format("woff"); font-display: swap; }
@font-face { font-family: "Trixie Rounded"; src: local("Arial Rounded MT Bold"), url("/fonts/VarelaRound-Regular.woff") format("woff"); font-display: swap; }
.ff-script { font-family: "Segoe Script", "Trixie Script", cursive; }
.ff-comic { font-family: "Trixie Comic", "Comic Sans MS", cursive; }
.ff-impact { font-family: "Trixie Impact", Impact, sans-serif; letter-spacing: .02em; }
.ff-rounded { font-family: "Trixie Rounded", system-ui, sans-serif; }
.md-h1, .md-h2, .md-h3 { font-weight: 800; line-height: 1.25; margin: .25em 0 .1em; }
.md-h1 { font-size: 1.6em; } .md-h2 { font-size: 1.3em; } .md-h3 { font-size: 1.1em; }
.msg .body ul { margin: .1em 0; padding-left: 1.4em; }
.msg .body a, .member-status a, .dm-custom-status a { color: var(--accent-strong); }
/* ||spoiler|| text */
.tspoiler { border-radius: 4px; padding: 0 2px; cursor: pointer; transition: background .15s, color .15s; background: color-mix(in srgb, var(--text) 10%, transparent); }
.tspoiler.concealed { background: #0b0c10; color: transparent !important; user-select: none; }
.tspoiler.concealed * { color: transparent !important; visibility: hidden; }
.tspoiler.concealed:hover { background: #1c1f29; }
.tspoiler:not(.concealed):hover { outline: 1px dashed var(--text-3); }
[data-theme="light"] .tspoiler.concealed { background: #2b2f3a; }
.status-preview { margin-top: 8px; padding: 6px 10px; border-radius: 8px; background: var(--bg-3); font-size: .9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-fmt { display: flex; gap: 2px; margin-top: 6px; }
.member-status, .dm-custom-status, .me-sub, .dm-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-status .cemoji, .dm-sub .cemoji, .me-sub .cemoji, .dm-custom-status .cemoji { width: 1.2em; height: 1.2em; }

/* ---------------------------------------------------------------- DMs, groups (v1.6.0) */
.dm-item { align-items: center; }
.dm-label { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.dm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-sub { font-size: .76em; font-weight: 400; color: var(--text-3); margin-top: 1px; }
.chan.unread .dm-sub { font-weight: 400; }
.avatar.group-av { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #0ea5e9)); font-size: .8em; }
.avatar.group-av .group-count { position: absolute; right: -3px; bottom: -3px; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 7px; background: var(--bg-0); color: var(--text); font-size: 9px; line-height: 14px; text-align: center; border: 1.5px solid var(--bg-1); }
.avatar.sm.group-av { font-size: .6em; }
.avatar.lg.group-av { font-size: 1.6em; }
.avatar.lg.group-av .group-count { font-size: 12px; min-width: 20px; height: 20px; line-height: 20px; border-radius: 10px; }
.members-add { width: 100%; margin: 4px 0 6px; }
.pick-list { max-height: 46vh; overflow-y: auto; }
.pick-item { cursor: pointer; border-radius: 8px; }
.pick-item.sel { background: var(--accent-soft); }
.pick-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.pick-chips:empty { display: none; }
.pick-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong); font-size: .85em; font-weight: 600; }
.pick-chip button { border: 0; background: none; color: inherit; cursor: pointer; font-size: .85em; }

/* ---------------------------------------------------------------- About: app version (v1.6.0) */
.app-version { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 4px 0 18px; background: var(--bg-2); }
.app-version-rows { display: flex; gap: 28px; flex-wrap: wrap; }
.app-version-rows > div { display: flex; flex-direction: column; gap: 1px; }
.app-version-rows b { font-size: 1.25em; }
.update-check-result { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ok-text { color: var(--ok); font-weight: 600; }

/* ---- context menus (1.7.0) ---- */
.ctx-pop { padding: 5px; min-width: 210px; max-width: 300px; }
.ctx-menu { display: flex; flex-direction: column; outline: none; }
.ctx-item { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; color: var(--text); text-align: left;
  padding: 7px 9px; border-radius: 7px; cursor: pointer; font: inherit; font-size: .93em; }
.ctx-item:hover:not(:disabled), .ctx-item:focus-visible { background: var(--accent); color: #fff; outline: none; }
.ctx-item:disabled { opacity: .45; cursor: default; }
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger:hover, .ctx-item.danger:focus-visible { background: var(--danger); color: #fff; }
.ctx-icon { width: 18px; text-align: center; flex: none; display: inline-flex; justify-content: center; }
.ctx-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-hint { font-size: .8em; opacity: .65; }
.ctx-sep { height: 1px; background: var(--line); margin: 4px 6px; }
.ctx-header { font-size: .75em; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); padding: 6px 9px 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-row { display: flex; gap: 2px; padding: 2px; justify-content: space-between; }
.ctx-react { background: var(--bg-3); border: 1px solid transparent; border-radius: 8px; font-size: 1.15em; width: 32px; height: 32px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; color: var(--text); }
.ctx-react:hover { border-color: var(--accent); transform: scale(1.08); }
.ctx-react.mine { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, transparent); }
@media (max-width: 720px) { .ctx-pop { left: auto !important; right: auto; max-width: calc(100vw - 16px); } }

/* ---- username style (1.7.0) ---- */
.name-sample { display: flex; gap: 10px; align-items: center; background: var(--bg-1); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 6px 0 10px; }
.name-preview { font-weight: 700; }
.swatches { display: flex; gap: 5px; flex-wrap: wrap; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--bg-2); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.swatch:hover:not(:disabled) { transform: scale(1.12); }
.swatch:disabled { opacity: .4; cursor: default; }

/* ---- message auditing (1.7.0) ---- */
.audit-note { background: color-mix(in srgb, var(--warn) 12%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
  border-radius: 10px; padding: 8px 10px; margin: 0 0 12px; color: var(--text-2); }
.audit-perm b { color: var(--warn); }
.seg { display: inline-flex; background: var(--bg-1); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 3px; margin-bottom: 10px; }
.seg-btn { border: 0; background: none; color: var(--text-2); padding: 5px 12px; border-radius: 7px; cursor: pointer; font-weight: 600; }
.seg-btn.active { background: var(--accent); color: #fff; }
.empty-note { padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: 10px; }
.maudit-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.maudit-filters .input { flex: 1 1 140px; min-width: 0; }
.maudit-list { display: flex; flex-direction: column; gap: 6px; }
.maudit-entry { background: var(--bg-1); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.maudit-entry.ev-deleted, .maudit-entry.ev-channel_deleted { border-left: 3px solid var(--danger); }
.maudit-entry.ev-edited { border-left: 3px solid var(--warn); }
.maudit-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; font-size: .9em; }
.maudit-entry .body { white-space: pre-wrap; word-break: break-word; }
.maudit-atts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.maudit-file { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; font-size: .9em; }
.maudit-file img { max-width: 180px; max-height: 140px; border-radius: 8px; cursor: zoom-in; }
.maudit-file.gone { color: var(--text-3); }
.maudit-convs { display: flex; flex-direction: column; gap: 4px; }
.maudit-conv { display: flex; gap: 10px; align-items: center; background: var(--bg-1); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px;
  cursor: pointer; color: var(--text); text-align: left; font: inherit; }
.maudit-conv:hover { border-color: var(--accent); }
.maudit-conv .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill.tiny { font-size: .7em; padding: 0 7px; }
.pill.tone-ok { color: var(--ok); } .pill.tone-warn { color: var(--warn); } .pill.tone-danger { color: var(--danger); }

/* ---- group icons + rename (1.8.0) ---- */
.chan-header .title-btn { background: none; border: 0; color: var(--text); cursor: pointer; padding: 2px 6px; margin-left: -6px; border-radius: 6px; font: inherit; font-weight: 800; font-size: 1.05em; display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.chan-header .title-btn:hover { background: var(--bg-hover); }
.chan-header .title-btn::after { content: "✎"; font-size: .75em; opacity: 0; color: var(--text-3); transition: opacity .1s; }
.chan-header .title-btn:hover::after, .chan-header .title-btn:focus-visible::after { opacity: 1; }
.group-icon-row { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.avatar.xl.group-av { font-size: 2.4em; }
.avatar.xl.group-av .group-count { font-size: 13px; min-width: 24px; height: 24px; line-height: 24px; border-radius: 12px; right: 0; bottom: 0; }
.avatar.group-av.has-img > span:first-child { visibility: hidden; }

/* ---- server GIF library (1.8.0) ---- */
.gif-badge.server { background: color-mix(in srgb, var(--accent) 85%, #000); }
.gif-lib-bar { gap: 6px; flex-wrap: nowrap; }
.gif-lib-bar .input { flex: 1; min-width: 0; }
.gif-upload-preview { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 12px; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; min-height: 60px; justify-content: center; }
.gif-upload-preview img { max-width: 260px; max-height: 200px; border-radius: 8px; }
.tag-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: -4px 0 10px; }
.tag-chip { background: var(--accent-soft, var(--bg-3)); color: var(--text); border-radius: 12px; padding: 2px 9px; font-size: .8em; font-weight: 600; }
.cgif-list { display: flex; flex-direction: column; gap: 8px; }
.cgif-row { display: flex; gap: 12px; align-items: center; background: var(--bg-1); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.cgif-row img { width: 88px; height: 66px; object-fit: cover; border-radius: 7px; flex: none; background: var(--bg-3); }
.cgif-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.cgif-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.muted-row { opacity: .55; }
.last-online-text { color: var(--text-2); }
@media (max-width: 720px) { .cgif-row { flex-wrap: wrap; } .cgif-actions { flex-direction: row; width: 100%; justify-content: flex-end; } }

/* ---- favourite emoji (1.9.0) ---- */
.emoji-grid button { position: relative; }
.emoji-grid button .emoji-star { position: absolute; top: -3px; right: -3px; font-size: 11px; line-height: 1; padding: 2px; border-radius: 50%;
  background: var(--bg-2); color: var(--text-3); opacity: 0; transition: opacity .1s; cursor: pointer; }
.emoji-grid button:hover .emoji-star, .emoji-grid button:focus-visible .emoji-star { opacity: 1; }
.emoji-grid button.is-fav .emoji-star { color: #f5b301; }
.emoji-grid button .emoji-star:hover { color: #f5b301; transform: scale(1.2); }
.emoji-fav-hint { padding: 4px 8px 8px; }

/* ---- stickers (1.9.0) ---- */
.att-sticker { display: inline-block; line-height: 0; }
.att-sticker img { max-width: 160px; max-height: 160px; width: auto; height: auto; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0,0,0,.25)); }
.sticker-btn svg { display: block; }
.sticker-picker { width: 360px; max-width: calc(100vw - 24px); display: flex; flex-direction: column; gap: 8px; }
.sticker-picker .input { flex: 1; min-width: 0; }
.sticker-scroll { max-height: 340px; overflow-y: auto; }
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.sticker-item { background: var(--bg-1); border: 1px solid transparent; border-radius: 10px; padding: 6px; cursor: pointer; aspect-ratio: 1; display: grid; place-items: center; }
.sticker-item:hover, .sticker-item:focus-visible { border-color: var(--accent); background: var(--bg-hover); }
.sticker-item img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cgif-row img.sticker-thumb { object-fit: contain; background: var(--bg-2); }

/* ---- small screens & on-screen keyboards (1.10.0) ---- */
.app { height: var(--app-h, 100vh); }
@media (max-width: 720px) { .app { height: var(--app-h, 100dvh); } }
.composer textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 720px), (max-height: 560px) {
  .composer textarea { height: 1.45em; max-height: 1.45em; min-height: 1.45em; overflow-y: auto; box-sizing: content-box; }
}
.popover.pop-above { overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; }
.popover.pop-above > * { min-height: 0; }
.popover.pop-above .gif-picker { height: min(460px, var(--pop-room, 460px)); }
.popover.pop-above .emoji-picker { height: min(380px, var(--pop-room, 380px)); }
.popover.pop-above .sticker-picker { max-height: var(--pop-room, 420px); }
.popover.pop-above .sticker-scroll { max-height: none; flex: 1; min-height: 0; }
@media (max-width: 720px) {
  .popover.pop-above .gif-picker { height: min(420px, 60dvh, var(--pop-room, 420px)); }
  .popover.pop-above .emoji-picker { height: min(420px, 60dvh, var(--pop-room, 420px)); }
}
.extras-menu { display: flex; gap: 6px; padding: 2px; }
.extras-opt { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 76px; padding: 10px 8px; background: var(--bg-1);
  border: 1px solid var(--line); border-radius: 12px; color: var(--text); font: inherit; font-weight: 600; font-size: .85em; cursor: pointer; }
.extras-opt:hover, .extras-opt:focus-visible { border-color: var(--accent); }
.extras-icon { font-size: 1.6em; line-height: 1; height: 26px; display: grid; place-items: center; font-weight: 900; }
.extras-icon svg { width: 24px; height: 24px; }
.ctx-svg { display: inline-flex; } .ctx-svg svg { width: 15px; height: 15px; }
.icon-btn svg { display: block; }
/* emoji picker section titles: opaque, full width and above the emoji (1.10.0) */
.emoji-sec-title { z-index: 2; margin: 0 -2px; padding-left: 6px; padding-right: 6px; box-shadow: 0 1px 0 var(--line); }
/* swipe to reply (1.10.0) */
.msg { transition: transform .18s ease-out; }
.msg.swiping { transition: none; position: relative; }
.msg.swiping::before { content: "↩"; position: absolute; left: -34px; top: 50%; transform: translateY(-50%) scale(.7); width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: var(--bg-3); color: var(--text-2); opacity: .6; transition: transform .12s, opacity .12s, background .12s; }
.msg.swipe-ready::before { transform: translateY(-50%) scale(1); opacity: 1; background: var(--accent); color: #fff; }
.messages { overflow-x: hidden; }
.edit-box .fmt-bar { margin: 0 0 6px; }
.edit-hint { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.edit-fmt-toggle.active { color: var(--accent); }

/* ---- sidebar favourites & folders (1.10.0) ---- */
.sub-title { padding: 8px 8px 2px; font-size: .68em; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.folder { margin: 2px 0; }
.folder-head { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 7px; color: var(--text-2); cursor: pointer; user-select: none; font-weight: 700; font-size: .92em; }
.folder-head:hover { background: var(--bg-hover); color: var(--text); }
.folder-caret { width: 12px; font-size: .75em; transition: transform .12s; color: var(--text-3); }
.folder-head.collapsed .folder-caret { transform: rotate(-90deg); }
.folder-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-meta { font-size: .75em; font-weight: 600; }
.folder-items { margin-left: 12px; padding-left: 4px; border-left: 1px solid var(--line); }
.folder-empty { padding: 4px 8px 6px; }
.folder-plus { font-size: .85em; filter: grayscale(.4); }
.chan.dragging { opacity: .4; }
.chan.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.folder-head.drop-into, .section-title.drop-into { background: var(--accent-soft); color: var(--text); }
.chan.pinned .dm-name::after, .chan.pinned .chan-name::after { content: " ★"; color: #f5b301; font-size: .8em; }
.section-title .icon-btn.active { color: var(--accent); }
/* -# subtext (1.10.0) */
.md-sub { font-size: .78em; color: var(--text-3); line-height: 1.3; margin: .1em 0; }
.fmt-h { font-weight: 800; font-size: .85em; } .fmt-sub { font-size: .72em; color: var(--text-3); }
/* About: app downloads (1.10.0) */
.download-list { display: flex; flex-direction: column; gap: 8px; }
.download-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--bg-1); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
a.download-card:hover { border-color: var(--accent); }
.download-card.missing { opacity: .65; }
.download-icon { font-size: 1.5em; }
.download-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.download-arrow { font-size: 1.2em; color: var(--accent); }

/* ================= v1.11.0 ================= */
/* monochrome icons */
.ic { display: inline-flex; align-items: center; justify-content: center; line-height: 0; vertical-align: -0.15em; }
.ic svg { width: 1.05em; height: 1.05em; display: block; }
.chan .glyph { display: inline-flex; align-items: center; justify-content: center; height: 18px; }
.chan .glyph .ic svg { width: 16px; height: 16px; }
.head-glyph { display: inline-flex; align-items: center; justify-content: center; width: 24px; }
.head-glyph .ic svg { width: 20px; height: 20px; }
.chan-intro .big .ic svg { width: 30px; height: 30px; }
.glyph .ic svg { width: 16px; height: 16px; }
.folder-icon { display: inline-flex; color: var(--text-3); }
.folder-icon .ic svg { width: 16px; height: 16px; }
.folder-plus { filter: none; display: inline-flex; }
.folder-plus .ic svg { width: 15px; height: 15px; }
.ctx-icon .ic svg { width: 15px; height: 15px; }
.gif-tab .ic { margin-right: 2px; }
/* message bar: + menu and one emoji/sticker/GIF button */
.comp-btn.attach-btn svg, .comp-btn.extras-btn svg { width: 22px; height: 22px; }
.comp-btn.attach-btn, .comp-btn.extras-btn { color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; }
.comp-btn.attach-btn:hover, .comp-btn.extras-btn:hover { color: var(--text); }
.comp-btn.hidden { display: none !important; }
.attach-menu .extras-opt { min-width: 104px; }
.extras-opt.opt-gifs .extras-icon { font-size: .95em; letter-spacing: .04em; }
/* code blocks with a language */
pre.code-block { position: relative; }
pre.code-block[data-lang] { padding-top: 1.7em; }
.code-lang { position: absolute; top: .35em; right: .7em; font: 700 .68em/1 system-ui, sans-serif; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); user-select: none; }
:root { --hl-kw: #c792ea; --hl-str: #c3e88d; --hl-num: #f78c6c; --hl-com: #7f8a9c; --hl-fn: #82aaff; --hl-type: #ffcb6b; --hl-attr: #89ddff; --hl-meta: #ff9cac; --hl-add: #9ece6a; --hl-del: #f7768e; }
[data-theme="light"] { --hl-kw: #8b2bb9; --hl-str: #2a7a0f; --hl-num: #b45309; --hl-com: #6b7280; --hl-fn: #1d4ed8; --hl-type: #a16207; --hl-attr: #0e7490; --hl-meta: #be185d; --hl-add: #15803d; --hl-del: #b91c1c; }
.hl .hljs-keyword, .hl .hljs-selector-tag, .hl .hljs-doctag, .hl .hljs-template-tag { color: var(--hl-kw); }
.hl .hljs-string, .hl .hljs-regexp, .hl .hljs-char.escape_, .hl .hljs-template-variable { color: var(--hl-str); }
.hl .hljs-number, .hl .hljs-literal, .hl .hljs-symbol, .hl .hljs-bullet { color: var(--hl-num); }
.hl .hljs-comment, .hl .hljs-quote { color: var(--hl-com); font-style: italic; }
.hl .hljs-title, .hl .hljs-title.function_, .hl .hljs-section { color: var(--hl-fn); }
.hl .hljs-type, .hl .hljs-built_in, .hl .hljs-title.class_, .hl .hljs-class .hljs-title { color: var(--hl-type); }
.hl .hljs-attr, .hl .hljs-attribute, .hl .hljs-property, .hl .hljs-variable, .hl .hljs-params, .hl .hljs-selector-class, .hl .hljs-selector-id, .hl .hljs-name { color: var(--hl-attr); }
.hl .hljs-meta, .hl .hljs-tag, .hl .hljs-subst { color: var(--hl-meta); }
.hl .hljs-addition { color: var(--hl-add); } .hl .hljs-deletion { color: var(--hl-del); }
.hl .hljs-emphasis { font-style: italic; } .hl .hljs-strong { font-weight: 700; }
/* polls */
.poll { border: 1px solid var(--line); background: var(--bg-1); border-radius: 12px; padding: 10px 12px 8px; margin: 4px 0; max-width: 480px; }
.poll-head { display: flex; align-items: center; gap: 6px; font-size: .78em; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); }
.poll-head .poll-time { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 600; }
.poll-icon svg { width: 16px; height: 16px; }
.poll-q { font-weight: 700; font-size: 1.05em; margin: 6px 0 2px; overflow-wrap: anywhere; }
.poll-sub { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 8px; }
.poll-note { display: inline-flex; align-items: center; gap: 3px; }
.poll-opts { display: flex; flex-direction: column; gap: 6px; }
.poll-opt { display: flex; flex-direction: column; gap: 3px; }
.poll-opt-main { position: relative; overflow: hidden; display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 8px 10px;
  border-radius: 9px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font: inherit; cursor: pointer; }
.poll-opt-main:hover:not(:disabled) { border-color: var(--accent); }
.poll-opt-main:disabled { cursor: default; }
.poll-opt.mine .poll-opt-main { border-color: var(--accent); }
.poll-bar { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); transition: width .35s ease; pointer-events: none; }
.poll-opt.winner .poll-bar { background: color-mix(in srgb, var(--accent) 32%, transparent); }
.poll-opt-main > *:not(.poll-bar) { position: relative; }
.poll-mark { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--text-3); display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.poll-mark.multi { border-radius: 5px; }
.poll-opt.mine .poll-mark { background: var(--accent); border-color: var(--accent); }
.poll-mark .ic svg { width: 12px; height: 12px; stroke-width: 3; }
.poll-opt-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.poll-win { color: #f5b301; }
.poll-count { font-weight: 700; font-size: .88em; white-space: nowrap; }
.poll-voters { display: inline-flex; align-items: center; gap: 2px; align-self: flex-start; margin-left: 30px; padding: 1px 4px; border: none; background: none; cursor: pointer; border-radius: 10px; color: var(--text-2); }
.poll-voters:hover { background: var(--bg-hover); }
.poll-voters .avatar { margin-left: -4px; box-shadow: 0 0 0 2px var(--bg-1); }
.poll-voters .avatar:first-child { margin-left: 0; }
.poll-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 8px; }
.poll.closed .poll-head { color: var(--text-3); }
.poll-voter-list { min-width: 200px; max-height: 300px; overflow-y: auto; }
.poll-voter { display: flex; align-items: center; gap: 8px; padding: 4px 6px; }
.poll-creator .poll-edit-opts { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 8px; }
.poll-edit-opt { display: flex; gap: 6px; align-items: center; }
.poll-edit-opt .input { flex: 1; }
.check-row { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.check-row input { margin-top: 3px; }
.check-row > span { display: flex; flex-direction: column; }
/* What's new */
.whats-new details { border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; background: var(--bg-1); }
.whats-new summary { display: flex; align-items: center; gap: 6px; padding: 9px 12px; cursor: pointer; list-style: none; }
.whats-new summary::-webkit-details-marker { display: none; }
.whats-new summary::before { content: "▸"; color: var(--text-3); font-size: .8em; transition: transform .12s; }
.whats-new details[open] > summary::before { transform: rotate(90deg); }
.whats-new summary .spacer { flex: 1; }
.whats-new .wn-intro { margin: 0 12px 6px; }
.wn-group { padding: 0 12px 8px; }
.wn-group-title { font-weight: 800; font-size: .8em; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); margin: 6px 0 2px; }
.wn-group ul { margin: 2px 0; padding-left: 18px; }
.wn-group li { margin: 3px 0; font-size: .92em; }
.wn-item { display: flex; align-items: flex-start; gap: 6px; }
.wn-text { flex: 1; min-width: 0; }
.wn-eye { width: 24px; height: 24px; flex: none; color: var(--text-3); }
.wn-eye svg { width: 16px; height: 16px; }
.wn-eye.off { color: var(--danger); }
.wn-hidden > .wn-item .wn-text, details.wn-hidden > summary b { opacity: .45; text-decoration: line-through; }
.wn-tag { font-size: .7em; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--danger); border: 1px solid currentColor; border-radius: 5px; padding: 0 4px; flex: none; }
/* long code lines scroll inside the block instead of widening the message (phones) */
.msg .content { min-width: 0; }
.msg .body pre { max-width: 100%; box-sizing: border-box; }

/* ================= v1.12.0: voice calls ================= */
.call-start svg, .call-join-head svg, .call-join svg { width: 18px; height: 18px; display: block; }
.call-join-head, .call-join { display: inline-flex; align-items: center; gap: 4px; background: var(--ok, #22c55e); color: #fff; border-color: transparent; }
.call-join-head:hover, .call-join:hover { filter: brightness(1.08); }
.call-bar { display: flex; align-items: center; gap: 14px; padding: 8px 14px; border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, color-mix(in srgb, var(--ok, #22c55e) 14%, var(--bg-1)), var(--bg-1)); flex: none; flex-wrap: wrap; }
.call-bar.hidden { display: none; }
.call-bar-info { display: flex; flex-direction: column; min-width: 0; }
.call-bar-title { font-weight: 800; display: inline-flex; align-items: center; gap: 6px; }
.call-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok, #22c55e); box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: callpulse 1.6s infinite; flex: none; }
@keyframes callpulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.6); } 70% { box-shadow: 0 0 0 7px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.call-people { display: flex; gap: 6px; flex: 1; min-width: 0; flex-wrap: wrap; }
.call-person { position: relative; border-radius: 50%; padding: 2px; border: none; background: none; box-shadow: 0 0 0 2px transparent; transition: box-shadow .12s; }
.call-person .avatar.sm { width: 30px; height: 30px; font-size: .75em; }
.call-person.speaking { box-shadow: 0 0 0 2px var(--ok, #22c55e); }
.call-person.away { opacity: .45; cursor: pointer; }
.call-person.away:hover { opacity: .8; }
.call-person.ringing { opacity: .8; animation: callring 1s infinite alternate; }
@keyframes callring { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
.call-person-muted, .call-person-bell { position: absolute; right: -3px; bottom: -3px; width: 15px; height: 15px; border-radius: 50%; background: var(--bg-0); color: var(--danger); display: grid; place-items: center; }
.call-person-bell { color: var(--text-2); }
.call-person-muted svg, .call-person-bell svg { width: 11px; height: 11px; }
.call-bar-ctl { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.call-btn { width: 52px; height: 52px; border-radius: 50%; border: none; display: grid; place-items: center; cursor: pointer; color: #fff; background: var(--bg-3); }
.call-btn svg { width: 24px; height: 24px; }
.call-btn.sm { width: 36px; height: 36px; color: var(--text); background: var(--bg-3); }
.call-btn.sm svg { width: 18px; height: 18px; }
.call-btn.off { background: color-mix(in srgb, var(--danger) 22%, var(--bg-3)); color: var(--danger); }
.call-btn.on { background: var(--accent); color: #fff; }
.call-btn.hangup, .call-btn.sm.hangup { background: var(--danger, #ef4444); color: #fff; }
.call-btn.answer { background: var(--ok, #22c55e); }
.call-btn:hover { filter: brightness(1.1); }
.call-ring { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(0,0,0,.45); animation: fadein .15s; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.call-ring-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; padding: 26px 30px 22px; display: flex; flex-direction: column; align-items: center; gap: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5); min-width: 260px; }
.call-ring-card .avatar.lg { width: 76px; height: 76px; font-size: 1.6em; animation: callpulse 1.6s infinite; }
.call-ring-who { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.call-ring-who b { font-size: 1.15em; }
.call-ring-btns { display: flex; gap: 46px; margin-top: 6px; }
.call-mini { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--ok, #22c55e) 12%, var(--bg-0)); }
.call-mini-info { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; background: none; border: none; color: var(--text); font: inherit; cursor: pointer; text-align: left; padding: 0; }
.call-mini-info .faint { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 14px; }
.call-mini .call-btn.sm { width: 32px; height: 32px; }
.chan-call { display: inline-flex; color: var(--ok, #22c55e); flex: none; }
.chan-call svg { width: 15px; height: 15px; }
@media (max-width: 720px) {
  .call-bar { padding: 8px 10px; gap: 8px; }
  .call-people { order: 3; flex-basis: 100%; }
}
/* gallery picker (v1.12.0) */
.modal.gallery-modal { width: min(560px, 100vw); }
.gallery-body { min-height: 200px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 4px; max-height: min(60vh, 520px); overflow-y: auto; overscroll-behavior: contain; }
.gallery-tile { position: relative; aspect-ratio: 1; padding: 0; border: none; border-radius: 6px; overflow: hidden; background: var(--bg-3); cursor: pointer; }
.gallery-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .12s; }
.gallery-tile.sel img { transform: scale(.88); border-radius: 6px; }
.gallery-tile.sel { box-shadow: inset 0 0 0 3px var(--accent); }
.gallery-video { position: absolute; left: 4px; bottom: 4px; font-size: .7em; font-weight: 700; color: #fff; background: rgba(0,0,0,.55); border-radius: 4px; padding: 1px 4px; }
.gallery-num { position: absolute; right: 5px; top: 5px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.25); color: #fff; font-size: .75em; font-weight: 800; display: grid; place-items: center; }
.gallery-tile:not(.sel) .gallery-num { color: transparent; }
.gallery-tile.sel .gallery-num { background: var(--accent); border-color: var(--accent); }
.gallery-ask { text-align: center; padding: 20px 10px; }
.gallery-ask-icon svg { width: 44px; height: 44px; color: var(--text-3); }
.gallery-partial { margin-bottom: 8px; }
@media (max-width: 720px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); max-height: 62vh; } }

/* ================= v1.13.0 ================= */
/* call bar: fixed-width info block and steady digits, so the pictures never shift as the timer counts */
.call-bar-info { flex: none; width: 128px; }
.call-bar-info [data-call-since], .call-mini [data-call-since] { font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .call-bar-info { width: auto; flex: 1; } }
button.call-person { cursor: pointer; }
button.call-person:not(.away):hover { box-shadow: 0 0 0 2px var(--line); }
button.call-person.speaking:hover, .call-person.speaking { box-shadow: 0 0 0 2px var(--ok, #22c55e); }
.call-person { transition: box-shadow .08s linear; }
.person-volume { display: flex; flex-direction: column; gap: 8px; min-width: 220px; padding: 2px; }
.vol-slider { flex: 1; accent-color: var(--accent); min-width: 120px; }
.vol-value { width: 52px; text-align: right; font-variant-numeric: tabular-nums; }
.vol-row { align-items: center; gap: 10px; }
/* voice settings */
.mic-meter { position: relative; height: 12px; border-radius: 6px; background: var(--bg-3); overflow: hidden; margin-top: 4px; }
.mic-meter-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--text-3); transition: width .06s linear; }
.mic-meter.speaking .mic-meter-fill { background: var(--ok, #22c55e); }
.mic-meter.gated .mic-meter-fill { background: var(--text-3); opacity: .6; }
.mic-meter-gate { position: absolute; top: -2px; bottom: -2px; left: var(--gate, 37%); width: 2px; background: var(--danger); }
.user-gains { display: flex; flex-direction: column; gap: 6px; }
.user-gain-row { display: flex; align-items: center; gap: 10px; }
/* keybinds */
.keybind-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.keybind-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-1); flex-wrap: wrap; }
.keybind-label { flex: 1; font-weight: 700; min-width: 140px; }
.keybind-kbd { font: 600 .9em ui-monospace, monospace; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--line); border-bottom-width: 3px; background: var(--bg-2); min-width: 120px; text-align: center; }
.keybind-kbd.none { color: var(--text-3); font-weight: 400; }
.keybind-kbd.recording { border-color: var(--accent); color: var(--accent); }
/* app icon choice */
.icon-choices { display: flex; gap: 12px; }
.icon-choice { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg-1); color: var(--text); cursor: pointer; font: inherit; }
.icon-choice img { width: 64px; height: 64px; border-radius: 50%; }
.icon-choice.sel { border-color: var(--accent); }
/* YouTube */
.yt-embeds { display: flex; flex-direction: column; gap: 6px; margin: 4px 0; }
.yt-embed { max-width: 440px; border: 1px solid var(--line); border-left: 3px solid #f00; border-radius: 10px; background: var(--bg-1); overflow: hidden; }
.yt-thumb, .yt-player { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: none; padding: 0; background: #000 center / cover no-repeat; cursor: pointer; }
.yt-play { position: absolute; left: 50%; top: 50%; width: 64px; height: 45px; transform: translate(-50%, -50%); opacity: .9; transition: opacity .1s, transform .1s; }
.yt-thumb:hover .yt-play { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
.yt-play svg { width: 100%; height: 100%; display: block; }
.yt-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-close { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: none; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; z-index: 1; }
.yt-meta { display: flex; flex-direction: column; padding: 7px 10px 8px; gap: 1px; }
.yt-title { font-weight: 700; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yt-title:hover { text-decoration: underline; }
.yt-embed.unavailable .yt-thumb { opacity: .5; }
/* tabs in code */
.msg .body pre, textarea { tab-size: 4; -moz-tab-size: 4; }
/* mobile data warning */
.net-banner { position: fixed; left: 50%; bottom: calc(var(--composer-h, 60px) + 14px); transform: translateX(-50%); z-index: 40; display: flex; gap: 8px; align-items: center;
  padding: 6px 12px; border-radius: 18px; font-size: .82em; background: color-mix(in srgb, #f59e0b 22%, var(--bg-2)); border: 1px solid color-mix(in srgb, #f59e0b 50%, transparent); box-shadow: 0 4px 14px rgba(0,0,0,.3); max-width: calc(100vw - 24px); }

/* ================= v1.14.0 ================= */
/* server-wide folders and subfolders */
.folder.server > .folder-head .folder-icon { color: var(--accent); }
.folder.server > .folder-head .folder-name::after { content: ""; }
.folder .folder { margin: 1px 0; }
.folder .folder > .folder-head { font-size: .9em; padding-top: 4px; padding-bottom: 4px; }
.folder-head .folder-shared-tag { font-size: .66em; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.folder.server .folder-items { border-left-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.folder-head.drop-into { outline: 1px dashed var(--accent); outline-offset: -1px; }
/* only the avatar (not the whole row under it) opens a profile */
.msg-avatar { align-self: start; width: fit-content; height: fit-content; cursor: pointer; line-height: 0; border-radius: 50%; }
.msg .author { cursor: pointer; }
/* new-message banner */
.messages-wrap { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.messages-wrap > .messages { flex: 1; }
.new-msg-banner { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: 7px 14px; border: none; border-radius: 999px; background: var(--accent); color: #fff; font: inherit; font-size: .88em; font-weight: 700;
  box-shadow: 0 4px 16px rgba(0,0,0,.28); cursor: pointer; white-space: nowrap; animation: nmbIn .18s ease-out; max-width: calc(100% - 24px); }
.new-msg-banner:hover { filter: brightness(1.08); }
.new-msg-banner.hidden { display: none; }
.new-msg-banner .nmb-jump { opacity: .85; font-weight: 600; }
@keyframes nmbIn { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }
/* YouTube download button with a progress ring */
.yt-row { display: flex; align-items: flex-start; gap: 8px; }
.yt-row > .yt-embed { flex: 1 1 auto; min-width: 0; }
.ytdl-btn { position: relative; flex: none; width: 40px; height: 40px; margin-top: 4px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-1);
  color: var(--text-2); display: grid; place-items: center; cursor: pointer; padding: 0; transition: color .12s, border-color .12s; }
.ytdl-btn:hover { color: var(--text); border-color: var(--accent); }
.ytdl-icon { display: inline-flex; position: relative; z-index: 1; }
.ytdl-icon .ic svg { width: 18px; height: 18px; }
.ytdl-ring { position: absolute; inset: -1px; pointer-events: none; }
.ytdl-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.ytdl-ring circle { fill: none; stroke-width: 3; }
.ytdl-ring .track { stroke: transparent; }
.ytdl-ring .bar { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .3s ease; }
.ytdl-btn.busy { color: var(--accent); border-color: transparent; }
.ytdl-btn.busy .ytdl-ring .track { stroke: var(--line); }
.ytdl-btn.queued .ytdl-ring svg { animation: ytdlSpin 1.1s linear infinite; }
.ytdl-btn.converting .ytdl-ring .bar { stroke: #f59e0b; }
.ytdl-btn.done { color: #22c55e; border-color: #22c55e; }
.ytdl-btn.done .ytdl-ring .bar { stroke: transparent; }
@keyframes ytdlSpin { to { transform: rotate(270deg); } }
.ytdl-done-name { font-weight: 700; margin-bottom: 2px; word-break: break-word; }
.ytdl-save { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
/* keybinds: global toggle */
.keybind-global { margin: 4px 0 14px; }
.ytdl-btn.unready { opacity: .55; }
.ytdl-help ul { margin: 6px 0 10px; padding-left: 20px; } .ytdl-help li { margin: 3px 0; }
/* YouTube download chooser: MP4 / MP3 */
.ytdl-choices { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ytdl-choice { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-1); }
.ytdl-choice.ready { border-color: color-mix(in srgb, #22c55e 55%, var(--line)); }
.ytdl-fmt { display: flex; flex-direction: column; line-height: 1.15; }
.ytdl-fmt b { font-size: 1.05em; letter-spacing: .02em; }
.ytdl-sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ytdl-prog { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; min-width: 130px; }
.ytdl-prog-bar { width: 130px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.ytdl-prog-bar span { display: block; height: 100%; background: var(--accent); transition: width .3s ease; }
@media (max-width: 480px) { .ytdl-choice { grid-template-columns: 52px 1fr; } .ytdl-choice > :last-child { grid-column: 1 / -1; justify-self: stretch; } .ytdl-prog, .ytdl-prog-bar { width: 100%; align-items: stretch; } }

/* ================= v1.15.0: screen sharing ================= */
.call-bar { flex-wrap: wrap; }
.call-btn.share-btn.on { background: #22c55e; color: #fff; }
.call-person { position: relative; }
.call-person-screen { position: absolute; right: -4px; top: -4px; width: 16px; height: 16px; border-radius: 4px; background: #22c55e; color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg-2); }
.call-person-screen svg { width: 11px; height: 11px; }
.screen-strip { flex: 1 0 100%; display: flex; flex-wrap: wrap; gap: 6px; padding-top: 2px; }
.screen-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-1); color: var(--text); font: inherit; font-size: .85em; font-weight: 600; cursor: pointer; }
.screen-chip .ic svg { width: 15px; height: 15px; }
.screen-chip:hover { border-color: var(--accent); }
.screen-chip.on { background: var(--accent-soft); border-color: var(--accent); }
.screen-chip.mine { border-color: #22c55e; color: #22c55e; }
.screen-chip:disabled { opacity: .5; cursor: not-allowed; }
.screen-chip-meta { font-size: .8em; color: var(--text-3); font-weight: 700; }
/* the pictures being watched */
.screens { display: grid; gap: 6px; padding: 6px; background: #000; border-bottom: 1px solid var(--line); height: min(52vh, 560px); min-height: 140px; max-height: 85vh; resize: vertical; overflow: hidden;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); grid-auto-rows: 1fr; flex: none; }
.screens.hidden { display: none; }
.screen-tile { position: relative; display: flex; flex-direction: column; min-height: 0; min-width: 0; border-radius: 8px; overflow: hidden; background: #0b0d12; }
.screen-tile.maxed { position: fixed; inset: 0; z-index: 900; border-radius: 0; }
.screen-tile-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 8px; background: rgba(255,255,255,.06); color: #e5e7eb; font-size: .85em; flex: none; }
.screen-tile-head .faint { color: #9ca3af; }
.screen-tile-head .icon-btn { color: #e5e7eb; }
.screen-tile-head .icon-btn svg { width: 16px; height: 16px; }
.screen-info { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.screen-body { position: relative; flex: 1 1 0; min-height: 0; min-width: 0; overflow: hidden; background: #000; }
.screen-body:fullscreen { background: #000; }
/* the whole shared screen always fits: scaled to the space, aspect ratio kept, black bars where needed (v1.15.0) */
.screen-canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; display: block; }
.screen-wait { position: absolute; inset: 0; display: grid; place-items: center; color: #9ca3af; }
.screen-tile.live .screen-wait { display: none; }
@media (max-width: 720px) { .screens { height: 34vh; grid-template-columns: 1fr; } }
/* the share pop-up */
.share-pop { width: 320px; max-width: calc(100vw - 24px); max-height: min(78vh, 640px); overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.share-head { display: flex; align-items: center; gap: 8px; }
.share-preview { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 8px; object-fit: contain; }
.share-stats b { color: var(--text); }
.share-go { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.share-go .ic svg { width: 18px; height: 18px; }

/* ================= v1.16.0 ================= */
/* server name and address never run under the administration button */
.server-head > div { min-width: 0; }
.server-head .sub { min-width: 0; overflow: hidden; }
.server-head .sub .lock-badge { flex: none; }
.server-head .sub .host { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-head .server-admin-btn { flex: none; margin-left: 4px; }
/* custom themes */
.theme-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.theme-card { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-1); }
.theme-card.in-use { border-color: var(--accent); }
.theme-card-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.theme-card-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theme-swatch { display: inline-flex; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); flex: none; }
.theme-swatch i { width: 16px; height: 28px; display: block; }
.danger-text { color: var(--danger); }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 14px; margin-top: 6px; }
.theme-part { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }
.theme-part input[type=color] { width: 40px; height: 30px; border: 1px solid var(--line); border-radius: 6px; background: none; padding: 0; cursor: pointer; flex: none; }
.theme-part span { flex: 1; min-width: 0; }
/* screen pictures: floating bubbles and popped-out windows */
.screen-floats { position: fixed; inset: 0; pointer-events: none; z-index: 800; }
.screen-tile.floating { position: fixed; pointer-events: auto; resize: both; overflow: hidden; min-width: 220px; min-height: 150px;
  box-shadow: 0 14px 44px rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.14); border-radius: 12px; background: #000; z-index: 801; }
.screen-tile.floating .screen-tile-head { cursor: grab; user-select: none; touch-action: none; }
.screen-tile.floating.dragging, .screen-tile.floating.dragging .screen-tile-head { cursor: grabbing; }
.screen-tile.floating.maxed { inset: 0 !important; width: auto !important; height: auto !important; resize: none; border-radius: 0; }
.screen-tile-head .icon-btn.off { color: var(--danger); }
.screen-tile-head .screen-return { display: inline-flex; align-items: center; gap: 4px; }
.screen-tile-head .screen-return .ic svg { width: 15px; height: 15px; }
.screen-chip.preview { border-style: dashed; }
.share-audio { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
html.popout, html.popout body { background: #000; }
html.popout #root { height: 100vh; }
.screens.popout-screens { height: 100vh; max-height: none; resize: none; border: 0; padding: 0; grid-template-columns: 1fr; }
.screens.popout-screens .screen-tile { border-radius: 0; }
.popout-msg { height: 100vh; display: grid; place-items: center; color: #9ca3af; font-size: 1.05em; background: #000; }
.screen-tile-head > b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.screen-tile-head .screen-info { flex: 0 10 auto; }
.screen-tile-head .icon-btn { flex: none; }
.screen-tile.floating .screen-tile-head .avatar { display: none; }

/* ================= v1.17.0 ================= */
/* icon buttons: no default button padding, so small icons sit dead centre on every engine */
.icon-btn { padding: 0; line-height: 1; }
.section-title .icon-btn { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.section-title .icon-btn .folder-plus, .section-title .icon-btn .ic { display: flex; align-items: center; justify-content: center; vertical-align: 0; line-height: 0; }
/* foldable sidebar sections */
.section-toggle { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 2px 0; margin: 0; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; text-align: left; min-width: 0; }
.section-toggle:hover { color: var(--text); }
.section-caret { display: inline-block; font-size: .9em; transition: transform .12s; width: 10px; }
.section-toggle.folded .section-caret { transform: rotate(-90deg); }
.section-unread { margin-left: 4px; min-width: 16px; padding: 0 5px; border-radius: 8px; background: var(--danger); color: #fff; font-size: .95em; letter-spacing: 0; text-align: center; }
/* voice channels */
.chan.voice-live { flex-wrap: wrap; row-gap: 4px; }
.voice-row { flex-basis: 100%; display: flex; align-items: center; gap: 6px; padding-left: 26px; min-width: 0; }
.voice-avatars { display: inline-flex; align-items: center; min-width: 0; }
.voice-av { margin-right: -5px; border-radius: 50%; box-shadow: 0 0 0 2px var(--bg-1); display: inline-flex; position: relative; }
.voice-av.muted { opacity: .7; }
.voice-av.sharing::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1.5px var(--bg-1); }
.avatar.xs { width: 20px; height: 20px; font-size: .55em; }
.voice-more { margin-left: 9px; font-size: .72em; color: var(--text-3); font-weight: 700; }
.voice-row .voice-join { margin-left: auto; border: 1px solid color-mix(in srgb, var(--ok, #22c55e) 50%, var(--line)); background: color-mix(in srgb, var(--ok, #22c55e) 14%, transparent);
  color: var(--text); border-radius: 6px; padding: 1px 9px; font: inherit; font-size: .75em; font-weight: 700; cursor: pointer; }
.voice-row .voice-join:hover { background: color-mix(in srgb, var(--ok, #22c55e) 28%, transparent); }
.voice-row .voice-in { margin-left: auto; font-size: .72em; }
.voice-quick { border: 0; background: none; color: var(--text-3); width: 22px; height: 22px; padding: 0; border-radius: 6px; display: inline-grid; place-items: center; cursor: pointer; flex: none; opacity: .55; }
.voice-quick svg { width: 15px; height: 15px; display: block; }
.chan:hover .voice-quick { opacity: 1; }
.voice-quick:hover { background: var(--bg-3); color: var(--text); }
.call-sound-note { display: inline-flex; align-items: center; gap: 6px; font-size: .82em; color: var(--text-2); padding: 2px 8px; border-radius: 999px; background: var(--bg-3); animation: fadein .15s; }
.call-sound-note .cemoji { width: 18px; height: 18px; }

/* pins */
.pins-btn svg, .head-popout svg, .pop-home svg { width: 18px; height: 18px; }
.chan-header .pins-btn, .chan-header .head-popout { color: var(--text-2); }
.popover.pins-popover { padding: 0; }
.pins-pop { width: 380px; max-width: calc(100vw - 24px); display: flex; flex-direction: column; max-height: min(520px, 70vh); }
.pins-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.pins-head .ic svg { width: 16px; height: 16px; display: block; }
.pins-list { overflow-y: auto; padding: 6px; }
.pin-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border-radius: 8px; cursor: pointer; position: relative; }
.pin-item:hover, .pin-item:focus-visible { background: var(--bg-hover); outline: none; }
.pin-body { flex: 1; min-width: 0; font-size: .9em; }
.pin-meta { display: flex; gap: 8px; align-items: baseline; margin-bottom: 2px; }
.pin-text { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; color: var(--text-2); }
.pin-x { width: 24px; height: 24px; opacity: 0; flex: none; }
.pin-item:hover .pin-x, .pin-item:focus-within .pin-x { opacity: 1; }
.pins-empty { padding: 18px 14px; text-align: center; }
.msg-pin { display: inline-flex; color: var(--text-3); margin-left: 6px; vertical-align: -2px; }
.msg-pin svg { width: 13px; height: 13px; }
.msg-pin.inline { float: right; margin: 3px 0 0 6px; }
a.msg-link { display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; border-radius: 5px; background: var(--accent-soft); color: var(--text); text-decoration: none; font-weight: 600; }
a.msg-link::before { content: "↪"; opacity: .7; }
a.msg-link:hover { filter: brightness(1.15); }

/* jump to the newest messages */
.jump-bottom { position: absolute; left: 16px; bottom: 14px; z-index: 6; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; padding: 0; transition: transform .12s, opacity .12s; }
.jump-bottom svg { width: 18px; height: 18px; display: block; }
.jump-bottom:hover { transform: translateY(1px); border-color: var(--accent); }
.jump-bottom.hidden { display: none; }
.messages.jumping { cursor: progress; }

/* soundboard */
.soundboard { width: 400px; max-width: calc(100vw - 24px); display: flex; flex-direction: column; gap: 8px; }
.soundboard .input { flex: 1; min-width: 0; }
.sound-hint { margin-top: -2px; }
.sound-scroll { max-height: 340px; overflow-y: auto; }
.popover.pop-above .soundboard { max-height: var(--pop-room, 420px); }
.popover.pop-above .sound-scroll { max-height: none; flex: 1; min-height: 0; }
.sound-sec { font-size: .72em; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin: 6px 2px 4px; }
.sound-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.sound-tile { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-1); overflow: hidden; }
.sound-tile:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.sound-main { display: flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--text); font: inherit; font-weight: 600; font-size: .86em; padding: 8px 8px 4px; cursor: pointer; text-align: left; min-width: 0; }
.sound-main:active { transform: scale(.98); }
.sound-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.snd-emoji { font-size: 1.25em; line-height: 1; flex: none; display: inline-flex; }
.snd-emoji .cemoji { width: 22px; height: 22px; }
.sound-tools { display: flex; gap: 2px; padding: 0 4px 4px; }
.sound-tool { border: 0; background: none; color: var(--text-3); width: 24px; height: 24px; border-radius: 6px; display: inline-grid; place-items: center; cursor: pointer; padding: 0; font-size: .95em; }
.sound-tool svg { width: 14px; height: 14px; display: block; }
.sound-tool:hover { background: var(--bg-3); color: var(--text); }
.sound-tool.star { margin-left: auto; }
.sound-tool.star.on { color: #f5b301; }
.sound-tool.playing, .sound-chip-play.playing { color: var(--accent); }
.sound-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-1); max-width: 100%; }
.sound-chip-play { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; flex: none; }
.sound-chip-play svg { width: 14px; height: 14px; display: block; }
.sound-chip-play.playing { background: var(--bg-3); }
.sound-chip-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.call-btn.soundboard-btn svg { width: 19px; height: 19px; }
.extras-opt.opt-sounds .extras-icon svg { width: 24px; height: 24px; }
.sound-row-face { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 64px; flex: none; }
.sound-emoji-btn { font-size: 1.3em; padding: 4px 10px; }
.vol-slider { flex: 1; min-width: 80px; accent-color: var(--accent); }
.sound-editor { width: min(640px, calc(100vw - 24px)); }
.wave { position: relative; height: 96px; border-radius: 8px; background: var(--bg-1); border: 1px solid var(--line); margin: 6px 0 8px; overflow: hidden; touch-action: none; cursor: pointer; user-select: none; }
.wave.hidden { display: none; }
.wave-canvas { width: 100%; height: 100%; display: block; opacity: .55; }
.wave-sel { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--accent) 22%, transparent); border-left: 2px solid var(--accent); border-right: 2px solid var(--accent); cursor: grab; }
.wave-handle { position: absolute; top: 0; bottom: 0; width: 14px; cursor: ew-resize; }
.wave-handle.l { left: -8px; } .wave-handle.r { right: -8px; }
.wave-handle::after { content: ""; position: absolute; top: 50%; left: 4px; width: 6px; height: 26px; margin-top: -13px; border-radius: 3px; background: var(--accent); }
.wave-playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); pointer-events: none; }
.wave-playhead.hidden { display: none; }
.trim-row.hidden { display: none; }
.trim-row .input.sm { width: 86px; }
.emoji-choose { display: inline-flex; align-items: center; gap: 4px; font-size: 1.1em; }
.tone-row { display: flex; flex-direction: column; gap: 6px; min-width: 260px; }
.tone-row select { flex: 1; min-width: 0; }
.tone-list { display: flex; flex-direction: column; gap: 2px; }
.tone-item { display: flex; align-items: center; gap: 8px; font-size: .9em; }
.tone-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.danger-text { color: var(--danger); }

/* pop-out chats: floating bubbles in the app and windows of their own */
.chat-floats { position: fixed; inset: 0; pointer-events: none; z-index: 45; }
.chat-float { position: fixed; pointer-events: auto; display: flex; flex-direction: column; resize: both; overflow: hidden; min-width: 280px; min-height: 260px;
  max-width: calc(100vw - 8px); max-height: calc(100vh - 8px); background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 48px rgba(0,0,0,.5); }
.chat-float-head { display: flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px; background: var(--bg-1); border-bottom: 1px solid var(--line); cursor: grab; user-select: none; touch-action: none; flex: none; }
.chat-float-head .icon-btn { width: 28px; height: 28px; flex: none; }
.chat-float-head .icon-btn svg { width: 15px; height: 15px; }
.chat-float-title { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-float-glyph { color: var(--text-3); display: inline-flex; }
.chat-float-glyph svg { width: 16px; height: 16px; }
.chat-float-glyph.big svg { width: 24px; height: 24px; }
.chat-float-body { flex: 1; min-height: 0; position: relative; }
.chat-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--bg-2); }
html.dragging-pop .chat-frame { pointer-events: none; }
html.dragging-pop, html.dragging-pop * { cursor: grabbing !important; user-select: none; }
.chat-bubble-mini { display: none; }
.chat-float.min { resize: none; min-width: 0; min-height: 0; width: 56px !important; height: 56px !important; border-radius: 50%; overflow: visible; background: none; border: 0; box-shadow: none; }
.chat-float.min .chat-float-head { display: none; }
.chat-float.min .chat-float-body { position: absolute; width: 0; height: 0; overflow: hidden; visibility: hidden; }
.chat-float.min .chat-bubble-mini { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--accent); background: var(--bg-2);
  box-shadow: 0 10px 30px rgba(0,0,0,.45); cursor: pointer; padding: 0; position: relative; touch-action: none; overflow: visible; }
.chat-bubble-mini .avatar { width: 46px; height: 46px; font-size: 1em; }
.chat-float-badge { position: absolute; top: -4px; right: -4px; }
.chat-float-badge.hidden { display: none; }
@media (max-width: 760px) { .chat-float:not(.min) { left: 6px !important; right: 6px; width: auto !important; } }
/* inside a popped-out conversation: just that conversation */
html.chat-popout .sidebar, html.chat-popout .members, html.chat-popout .scrim { display: none !important; }
html.chat-popout .app { grid-template-columns: 1fr !important; }
html.chat-popout .call-mini { display: none; }
html.chat-embed .chan-header .head-glyph, html.chat-embed .chan-header .avatar, html.chat-embed .chan-header .title, html.chat-embed .chan-header .title-btn { display: none; }
html.chat-embed .chan-header { padding-top: 4px; padding-bottom: 4px; min-height: 0; }
html.chat-embed .chan-header .topic { border-left: 0; padding-left: 0; }
html.chat-popout .popout-msg { background: var(--bg-2); color: var(--text-2); }
.pin-meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pin-meta .faint { white-space: nowrap; flex: none; }

/* ================= v1.18.0 ================= */
/* link previews */
.link-previews { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 2px; align-items: flex-start; }
.link-card { --link-color: var(--line); display: flex; gap: 14px; max-width: min(520px, 100%); padding: 10px 12px 12px 14px; border-radius: 8px;
  background: var(--bg-1); border: 1px solid var(--line); border-left: 4px solid var(--link-color); box-sizing: border-box; }
.link-card.loading { width: 320px; max-width: 100%; height: 64px; background: linear-gradient(90deg, var(--bg-1), var(--bg-3), var(--bg-1)); background-size: 200% 100%; animation: linkshimmer 1.2s linear infinite; border-left-color: var(--line); }
@keyframes linkshimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.link-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.link-site { font-size: .76em; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-title { font-weight: 700; color: var(--accent); text-decoration: none; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.link-title:hover { text-decoration: underline; }
.link-desc { font-size: .88em; color: var(--text); opacity: .9; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.link-thumb { flex: none; display: block; }
.link-card:not(.large) .link-img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; display: block; }
.link-card.large { flex-direction: column; gap: 10px; }
.link-card.large .link-img { width: 100%; max-height: 280px; object-fit: cover; border-radius: 6px; display: block; }
.link-card.image-only { padding: 0; border: 0; background: none; }
.link-card.image-only .link-img { max-width: min(400px, 100%); max-height: 320px; border-radius: 8px; display: block; }
/* search */
.search-btn svg { width: 18px; height: 18px; }
.chan-header .search-btn { color: var(--text-2); }
.search-pop { width: 420px; max-height: min(600px, 78vh); }
.search-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 6px; }
.search-head .ic svg { width: 16px; height: 16px; display: block; color: var(--text-2); }
.search-input { flex: 1; min-width: 0; }
.search-kinds { display: flex; flex-wrap: wrap; gap: 5px; padding: 2px 12px 8px; border-bottom: 1px solid var(--line); }
.search-kind { border: 1px solid var(--line); background: none; color: var(--text-2); border-radius: 999px; padding: 2px 10px; font: inherit; font-size: .8em; font-weight: 600; cursor: pointer; }
.search-kind:hover { color: var(--text); border-color: var(--text-3); }
.search-kind.on { background: var(--text); color: var(--bg-2); border-color: var(--text); }
.search-status { padding: 6px 14px 0; }
.search-results { overflow-y: auto; padding: 4px 6px; flex: 1; min-height: 0; }
.search-text { color: var(--text-2); word-break: break-word; }
.search-text mark { background: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--text); border-radius: 3px; padding: 0 1px; }
.search-tags { display: inline-flex; gap: 4px; margin-left: 6px; }
.search-tag { font-size: .72em; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; color: var(--text-3); }
.search-more { margin: 4px 12px 10px; align-self: flex-start; }
.search-more.hidden { display: none; }

/* v1.19.0: each viewer's own volume for a shared screen */
.screen-vol { display: inline-flex; align-items: center; gap: 4px; margin: 0 2px; }
.screen-vol-range { width: 84px; accent-color: var(--accent, #8b5cf6); cursor: pointer; }
.screen-vol.muted .screen-vol-range { opacity: .45; }
.screen-vol-val { min-width: 34px; text-align: right; color: var(--muted, #9aa3b2); font-variant-numeric: tabular-nums; }
.screen-tile.floating .screen-vol-range { width: 60px; }
.screen-tile.maxed { z-index: 2000; }
.icon-btn.screen-full.on { color: var(--accent, #8b5cf6); }
@media (max-width: 520px) { .screen-vol-range { width: 56px; } .screen-vol-val { display: none; } }

/* v1.19.0: resizable side panels (Appearance setting). The default width is the narrowest; text that doesn't fit
   is cut off with an ellipsis rather than wrapped. */
.app { position: relative; }
.panel-grip { position: absolute; top: 0; bottom: 0; width: 7px; z-index: 20; cursor: col-resize; display: none; touch-action: none; }
.panel-grip::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 1px; background: transparent; transition: background .12s; }
.panel-grip:hover::after, :root.panel-resizing .panel-grip::after { background: var(--accent); width: 2px; left: 2px; }
:root.panel-resizing, :root.panel-resizing * { cursor: col-resize !important; user-select: none !important; }
@media (min-width: 901px) {
  :root.resizable-panels .app, :root.sized-sidebar .app { grid-template-columns: var(--sidebar-w, 260px) 1fr auto; }
  :root.resizable-panels .members { width: var(--members-w, 240px); }
}
:root.resizable-panels .sidebar, :root.resizable-panels .members { min-width: 0; overflow-x: hidden; }
:root.resizable-panels .sidebar :is(.label, .dm-name, .dm-sub, .name, .sub, .who b, .who span, .folder-name, .sb-head),
:root.resizable-panels .members :is(.nm, .member-sub, .members-head, h4, .faint) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
:root.resizable-panels .dm-label { min-width: 0; }

/* v1.19.0: pinned messages + shared list menu */
.pins-tabs { padding: 8px 8px 6px; border-bottom: 1px solid var(--line); }
.pins-tab { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.pins-tab .ic svg { width: 15px; height: 15px; display: block; }
.clist-pane { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.clist-items { overflow-y: auto; padding: 6px; flex: 1; min-height: 40px; }
.clist-item { display: flex; align-items: flex-start; gap: 8px; padding: 5px 6px; border-radius: 7px; position: relative; }
.clist-item:hover { background: var(--bg-hover); }
.clist-item.dragging { opacity: .4; }
.clist-item.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.clist-item.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.clist-grip { color: var(--text-3); cursor: grab; font-size: .75em; letter-spacing: -2px; padding-top: 3px; opacity: 0; user-select: none; }
.clist-item:hover .clist-grip { opacity: .8; }
.clist-check { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--accent); flex: none; cursor: pointer; }
.clist-bullet { width: 16px; text-align: center; color: var(--text-2); flex: none; font-weight: 800; }
.clist-text { flex: 1; min-width: 0; font-size: .92em; line-height: 1.4; overflow-wrap: anywhere; }
.clist-item.done .clist-text { text-decoration: line-through; color: var(--text-3); }
.clist-edit { flex: 1; min-width: 0; font: inherit; font-size: .92em; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--accent); background: var(--bg-0); color: var(--text); }
.clist-acts { display: flex; gap: 2px; opacity: 0; flex: none; }
.clist-acts .icon-btn { width: 24px; height: 24px; font-size: .85em; }
.clist-acts .icon-btn svg { width: 14px; height: 14px; }
.clist-item:hover .clist-acts, .clist-item:focus-within .clist-acts { opacity: 1; }
@media (hover: none) { .clist-acts, .clist-grip { opacity: .7; } }
.clist-add { display: flex; gap: 6px; align-items: center; padding: 8px; border-top: 1px solid var(--line); }
.clist-add.hidden { display: none; }
.clist-input { flex: 1; min-width: 0; font: inherit; padding: 6px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-0); color: var(--text); }
.clist-kind svg { width: 17px; height: 17px; }
.clist-foot { display: flex; align-items: center; gap: 8px; padding: 0 10px 8px; }
.clist-foot:empty { display: none; }
.pins-list.hidden, .clist-pane.hidden { display: none; }
/* forwarded messages */
.fwd-label { display: inline-flex; align-items: center; gap: 4px; font-size: .78em; color: var(--text-3); font-style: italic; margin: 1px 0 2px; }
.fwd-label svg { width: 12px; height: 12px; }
.fwd-pick { display: flex; flex-direction: column; gap: 8px; }
.fwd-list { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.fwd-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; border: 0; background: none; color: var(--text); font: inherit; text-align: left; }
.fwd-row:hover, .fwd-row:focus-visible { background: var(--bg-hover); outline: none; }
.fwd-row .fwd-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fwd-row .glyph { width: 28px; text-align: center; color: var(--text-3); }
.fwd-preview { border-left: 3px solid var(--line); padding: 4px 10px; color: var(--text-2); font-size: .9em; max-height: 90px; overflow: hidden; }
.msg-actions .msg-fwd svg { width: 16px; height: 16px; display: block; margin: auto; }
.fwd-wrap > .body { margin-top: 0; }
.check-row.disabled { opacity: .45; cursor: not-allowed; }
.check-row.disabled input { cursor: not-allowed; }

/* v1.20.0: search - who, and media in the results */
.search-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 2px 12px 8px; border-bottom: 1px solid var(--line); }
.search-filters .search-kinds { padding: 0; border: 0; flex: 1 1 auto; }
.search-who { width: auto; max-width: 100%; padding: 2px 8px; font-size: .8em; font-weight: 600; border-radius: 999px; height: auto; }
.search-who.on { background: var(--text); color: var(--bg-2); border-color: var(--text); }
.search-media { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: flex-start; }
.search-thumb { position: relative; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg-0); cursor: zoom-in; line-height: 0; }
.search-thumb img { display: block; max-width: 150px; max-height: 110px; object-fit: cover; }
.search-thumb.sticker { border: 0; background: none; }
.search-thumb.sticker img { max-width: 90px; max-height: 90px; object-fit: contain; }
.search-thumb.video { cursor: default; }
.search-thumb.video video { display: block; width: 220px; max-height: 140px; background: #000; }
.search-thumb.spoiled img, .search-thumb.spoiled video { filter: blur(14px); }
.search-spoiler { position: absolute; inset: 0; display: grid; place-items: center; font-size: .72em; font-weight: 800; letter-spacing: .04em; color: #fff; background: rgba(0,0,0,.35); pointer-events: none; line-height: 1; }
.search-thumb.video .search-spoiler { pointer-events: auto; cursor: pointer; }
.search-audio { display: flex; flex-direction: column; gap: 3px; min-width: 0; max-width: 100%; }
.search-audio audio { width: 240px; max-width: 100%; height: 32px; }
.search-file { display: inline-flex; align-items: center; gap: 2px; font-size: .85em; padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); text-decoration: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-file:hover { border-color: var(--text-3); }
/* v1.20.0: drop below the last entry to put it at the bottom */
.chan-scroll > .sb-end-drop { height: 8px; margin: 0 4px; border-radius: 7px; transition: height .12s; }
.chan-scroll > .sb-end-drop.last { flex: 1 0 40px; }
body.sb-dragging .chan-scroll > .sb-end-drop { height: 34px; }
body.sb-dragging .chan-scroll > .sb-end-drop.last { flex: 1 0 34px; }
.sb-end-drop.on { box-shadow: inset 0 2px 0 var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }

/* v1.20.0: blocking */
.blocked-run { position: relative; border-radius: 10px; margin: 2px 8px; }
.blocked-run:not(.revealed) .blocked-body { filter: blur(9px); opacity: .55; pointer-events: none; user-select: none; max-height: 220px; overflow: hidden; }
.blocked-run:not(.revealed) .blocked-body .msg-actions { display: none; }
.blocked-veil { position: absolute; inset: 0; width: 100%; border: 1px dashed var(--line); border-radius: 10px; background: color-mix(in srgb, var(--bg-2) 35%, transparent);
  display: grid; place-items: center; cursor: pointer; color: var(--text-2); font: inherit; font-weight: 700; font-size: .85em; padding: 6px; min-height: 44px; }
.blocked-veil:hover { color: var(--text); border-color: var(--text-3); }
.blocked-veil-text { background: var(--bg-3); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.blocked-run:not(.revealed) { min-height: 48px; }
.blocked-run.revealed .blocked-veil { display: none; }
.blocked-run .blocked-hide { display: none; position: absolute; top: 4px; right: 8px; z-index: 2; }
.blocked-run.revealed { box-shadow: inset 3px 0 0 var(--line); }
.blocked-run.revealed .blocked-hide { display: inline-flex; opacity: .6; }
.blocked-run.revealed:hover .blocked-hide { opacity: 1; }
.member.blocked-member { position: relative; cursor: pointer; }
.blocked-member-inner { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; filter: blur(7px); opacity: .5; pointer-events: none; user-select: none; }
.blocked-member-label { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--bg-3); border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; color: var(--text-2); font-weight: 700; }
.member .blocked-member-hide { width: 26px; height: 26px; opacity: 0; flex: none; font-size: .85em; }
.member:hover .blocked-member-hide, .member:focus-within .blocked-member-hide { opacity: .8; }
@media (hover: none) { .member .blocked-member-hide { opacity: .7; } }
.blocked-section { border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; }
.blocked-section > summary { cursor: pointer; padding: 10px 0; list-style: revert; }
.blocked-section[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.blocked-list { padding-bottom: 8px; }
.danger-text { color: #f87171; }
.search-filters .search-who { width: auto; flex: 0 0 auto; }
/* v1.20.0: narrow side panels - headings and names end with "…" instead of wrapping or overlapping */
:root.resizable-panels .section-title { min-width: 0; }
:root.resizable-panels .section-title > * { flex: none; }
:root.resizable-panels .section-title > .section-toggle { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; text-align: left; }
:root.resizable-panels .folder-head { min-width: 0; }
:root.resizable-panels .folder-head .folder-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
:root.resizable-panels .members .member > div { min-width: 0; }

/* v1.21.0: downloads */
.dl-folder-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0; }
.dl-folder-path { flex: 1 1 220px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-0); font-size: .85em; }
.dl-folder.disabled .dl-folder-path, .dl-folder.disabled > span { opacity: .5; }
.dl-toast { display: flex; gap: 10px; align-items: flex-start; min-width: 260px; }
.dl-toast .ic svg { width: 18px; height: 18px; display: block; margin-top: 2px; }
.dl-toast-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.dl-toast-text { overflow-wrap: anywhere; }
.dl-toast-bar { height: 4px; border-radius: 3px; background: var(--bg-hover); overflow: hidden; }
.dl-toast-bar > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.dl-toast-bar.busy > span { width: 35%; animation: dlbusy 1.1s ease-in-out infinite alternate; }
@keyframes dlbusy { from { margin-left: 0; } to { margin-left: 65%; } }
.dl-toast-acts { display: flex; gap: 6px; }
.dl-toast-acts:empty { display: none; }
.dl-toast.ok { border-left-color: #22c55e; }

/* v1.22.0: table headings stay on top of what scrolls under them (pictures and status dots used to show through) */
table.grid th { z-index: 3; box-shadow: 0 1px 0 var(--line); }
/* phones: the user list becomes cards with Edit beside each name; other admin tables scroll sideways, with a shadow
   at the edge showing there's more */
@media (max-width: 760px) {
  table.users-grid thead { display: none; }
  table.users-grid, table.users-grid tbody { display: block; width: 100%; }
  table.users-grid tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
  table.users-grid td { display: block; padding: 0; border: 0; min-width: 0; }
  table.users-grid tr:hover td { background: none; }
  table.users-grid td.u-user { grid-column: 1; grid-row: 1; }
  table.users-grid td.u-edit { grid-column: 2; grid-row: 1; align-self: center; }
  table.users-grid td.u-email, table.users-grid td.u-role, table.users-grid td.u-status, table.users-grid td.u-seen { grid-column: 1 / -1; font-size: .88em; padding-left: 42px; overflow-wrap: anywhere; }
  table.users-grid td[data-label]::before { content: attr(data-label) ": "; color: var(--text-3); font-size: .9em; }
  table.wide-grid { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
    background: linear-gradient(to right, var(--bg-2) 30%, transparent) left / 24px 100% no-repeat local,
                linear-gradient(to left, var(--bg-2) 30%, transparent) right / 24px 100% no-repeat local,
                radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.45), transparent) left / 12px 100% no-repeat scroll,
                radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.45), transparent) right / 12px 100% no-repeat scroll; }
  table.wide-grid th, table.wide-grid td { white-space: nowrap; }
}
.head-profile.head-avatar { border: 0; background: none; padding: 0; cursor: pointer; display: inline-flex; border-radius: 50%; }
.head-profile.head-avatar:hover { filter: brightness(1.1); box-shadow: 0 0 0 2px var(--line); }
.chan-header .title-btn.head-profile::after { content: none; }

/* v1.22.0: people picker when making a private channel */
.people-picker { display: flex; flex-direction: column; gap: 6px; }
.people-pick { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.people-pick .pick-item { cursor: pointer; }
.people-pick .pick-item input { margin: 0; }

/* v1.22.0: notification levels */
.chan .notify-ico, .folder-head .notify-ico { font-size: 11px; opacity: .7; margin-left: 4px; flex: none; }
.chan.notify-mute:not(.active) { opacity: .55; }
.chan.notify-mute .label, .chan.notify-mute .dm-name { font-weight: normal; }
.section-title.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.section-title.dragging { opacity: .5; }
.section-title[draggable="true"] { cursor: grab; }
.section-title[draggable="true"] button { cursor: pointer; }
.search-who-panel { margin: 6px 0; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); }
.search-who-panel .input[type=search] { flex: 1; min-width: 0; }
.search-who-list { max-height: 200px; overflow-y: auto; margin-top: 6px; }
button.search-who { cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* v1.22.0: per-keybind "without focus" switch */
.keybind-row .keybind-global { margin: 0; display: inline-flex; align-items: center; gap: 6px; }
.keybind-row .keybind-global.disabled { opacity: .5; }
.keybind-global-note { margin: 0 0 10px; }

/* v1.23.0: searching What's new */
.wn-search-row { gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.wn-search { flex: 1 1 220px; min-width: 0; }
.wn-results { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.wn-result { text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-1); color: inherit; font: inherit; font-size: .92em; cursor: pointer; }
.wn-result:hover { border-color: var(--accent); }
.wn-result ul { margin: 4px 0 0; padding-left: 18px; }
.wn-result-meta { font-size: .85em; margin-bottom: 2px; }
.wn-mark { background: color-mix(in srgb, var(--accent) 35%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.wn-flash { animation: wnflash 1.8s ease-out; border-radius: 6px; }
@keyframes wnflash { 0%, 40% { background: color-mix(in srgb, var(--accent) 25%, transparent); } 100% { background: transparent; } }
/* v1.23.0: sharing into the Android app */
.sharein-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.sharein-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; background: var(--bg-3); }
.sharein-file { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; max-width: 100%; }
.sharein-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.sharein-text { flex-basis: 100%; padding: 8px 10px; border-radius: 8px; background: var(--bg-1); white-space: pre-wrap; overflow-wrap: anywhere; }
.sharein-list { max-height: 50vh; overflow-y: auto; margin-top: 8px; display: flex; flex-direction: column; }
.sharein-to { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; background: none; border: 0; color: inherit; font: inherit; }
.sharein-to:hover, .sharein-to:focus-visible { background: var(--bg-3); }
.sharein-to .sharein-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

/* v1.24.0: Appear offline - a hollow grey dot (only you ever see it; everyone else sees you offline) */
.avatar .dot.invisible { background: var(--text-3); }
.avatar .dot.invisible::after { content: ""; position: absolute; left: 50%; top: 50%; width: 45%; height: 45%; transform: translate(-50%, -50%); border-radius: 50%; background: var(--bg-1); }
.status-dot.invisible { background: var(--text-3); }
.status-dot.invisible::after { content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--bg-2); }
/* v1.24.0: emoji suggestions while typing :name */
.emoji-ac .ac-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 2px 8px 4px; }
.emoji-ac .ac-keys { opacity: .8; }
.emoji-ac .ac-emoji { width: 24px; text-align: center; font-size: 20px; line-height: 24px; flex: none; }
.emoji-ac img.ac-emoji { width: 22px; height: 22px; object-fit: contain; }
.emoji-ac .ac-name { font-family: ui-monospace, monospace; font-size: .9em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 720px) { .emoji-ac .ac-keys { display: none; } }
.emoji-ac .ac-also { font-family: inherit; font-size: .9em; }

/* v1.25.0: submenus (drop-right) and two-line items */
.ctx-item.has-sub.open { background: var(--accent-soft); }
.ctx-arrow { margin-left: auto; opacity: .7; font-size: 1.1em; line-height: 1; }
.ctx-sub { min-width: 230px; max-width: 290px; }
.ctx-item.two-line { align-items: flex-start; }
.ctx-item.two-line .ctx-icon { margin-top: 2px; }
.ctx-two { display: flex; flex-direction: column; white-space: normal; overflow: visible; }
.ctx-main { font-weight: 600; }
.ctx-desc { font-size: .78em; opacity: .7; line-height: 1.3; white-space: normal; }
.ctx-item:hover .ctx-desc, .ctx-item:focus-visible .ctx-desc { opacity: .9; }
.ctx-back .ctx-icon { font-size: 1.2em; }
/* v1.25.0: table headings stick flush to the top of the scrolling pane (a sticky heading stops at the pane's
   padding, which left a strip where rows showed above it) and are fully opaque */
.tab-pane table.grid th { top: -18px; background: var(--bg-2); background-clip: padding-box; }
@media (max-width: 760px) { .tab-pane table.grid th { top: -14px; } }
/* v1.25.0: room around GIFs in the picker so the hover outline isn't cut off at the edges */
.gif-grid { padding: 4px; }
.gif-item { overflow: visible; }
.gif-item img { border-radius: 8px; }
.gif-item:hover { outline: 3px solid var(--accent); outline-offset: 0; }
/* v1.25.0: message previews open their conversation */
.toast.clickable { cursor: pointer; }
.toast.clickable:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg-3)); }
/* v1.25.0: unread count on the ☰ button */
.nav-btn { position: relative; }
.nav-badge { position: absolute; top: -2px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 800; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px var(--bg-1); pointer-events: none; }
.nav-badge.hidden { display: none; }
/* v1.25.0: typing to you - an animated ellipsis instead of the status dot in the direct-message list */
.avatar .dot.typing { width: 22px !important; height: 12px !important; right: -9px; bottom: -3px; border-radius: 7px; background: var(--bg-3) !important;
  display: flex; align-items: center; justify-content: center; gap: 2px; box-sizing: content-box; }
.avatar .dot.typing::after { content: none !important; }
.avatar .dot.typing i { width: 3.5px; height: 3.5px; border-radius: 50%; background: var(--text); display: block; animation: tdot 1.1s infinite ease-in-out; }
.avatar .dot.typing i:nth-child(2) { animation-delay: .15s; } .avatar .dot.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes tdot { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .avatar .dot.typing i { animation: none; opacity: .8; } }
/* v1.25.0: Suggest / Report */
.fb-public { margin: 0 0 8px; }
.fb-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.fb-form .fb-kind { flex: 0 0 auto; width: auto; }
.fb-form .fb-title { flex: 1; min-width: 0; }
.fb-form .fb-body { resize: vertical; min-height: 64px; }
.fb-search { margin-bottom: 8px; }
.fb-list { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--bg-1); }
.fb-list > summary { cursor: pointer; padding: 9px 12px; display: flex; align-items: center; gap: 8px; list-style: none; }
.fb-list > summary::-webkit-details-marker { display: none; }
.fb-list > summary::before { content: "▸"; color: var(--text-3); transition: transform .15s; }
.fb-list[open] > summary::before { transform: rotate(90deg); }
.fb-count { margin-left: auto; font-size: .78em; font-weight: 700; padding: 1px 8px; border-radius: 9px; background: var(--bg-3); }
.fb-empty { padding: 0 12px 10px; margin: 0; }
.fb-item { border-top: 1px solid var(--line); padding: 0 12px; }
.fb-item > summary { cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 8px 0; list-style: none; }
.fb-item > summary::-webkit-details-marker { display: none; }
.fb-ttl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.fb-item[open] .fb-ttl { white-space: normal; }
.fb-status { flex: none; font-size: .72em; font-weight: 700; padding: 2px 8px; border-radius: 9px; border: 1px solid var(--line); color: var(--text-2); }
.fb-status.acknowledged { border-color: var(--accent); color: var(--accent); }
.fb-status.implemented { border-color: var(--ok); color: var(--ok); }
.fb-status.trashed { border-color: var(--danger); color: var(--danger); }
.fb-item.archived .fb-ttl { text-decoration: line-through; opacity: .7; }
.fb-meta { margin: -2px 0 6px; }
.fb-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .92em; margin-bottom: 8px; }
.fb-tools { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 10px; }
.fb-ack.on { color: var(--accent); }
.fb-done:hover { color: var(--ok); } .fb-trash:hover { color: var(--danger); }

/* v1.26.0: the typing "…" takes the colour of the person's status */
.avatar .dot.typing { background: var(--text-3) !important; }
.avatar .dot.typing.on { background: var(--ok) !important; }
.avatar .dot.typing.away { background: var(--warn) !important; }
.avatar .dot.typing.dnd { background: var(--danger) !important; }
.avatar .dot.typing i { background: #fff; }
.avatar .dot.typing.away i { background: #1a1300; }

/* v1.26.0: unread counts show the notification level - pale yellow for "Mentions only" (normal colour once you're
   actually mentioned), grey for "Silence" */
.chan.notify-mention .badge:not(.mentioned), .badge.notify-mention { background: #b9a65a; color: #1d1a0c; opacity: .8; }
.chan.notify-silence .badge, .badge.notify-silence { background: var(--text-3); color: var(--bg-1); }

/* v1.26.0: gradient colours in the theme editor */
.theme-part { flex-wrap: wrap; }
.theme-part-main { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; cursor: pointer; }
.theme-part-main input[type=color] + input[type=color] { margin-left: -4px; }
.theme-grad-toggle { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; white-space: nowrap; }
.theme-part.grad .theme-part-main code { font-size: .78em; }

/* v1.26.0: more built-in fonts, all served by the server so phones show them too (licences in /fonts) */
@font-face { font-family: "Trixie Pixel"; src: url("/fonts/PressStart2P-Regular.woff") format("woff"); font-display: swap; }
@font-face { font-family: "Trixie Typewriter"; src: url("/fonts/SpecialElite-Regular.woff") format("woff"); font-display: swap; }
@font-face { font-family: "Trixie Marker"; src: url("/fonts/PermanentMarker-Regular.woff") format("woff"); font-display: swap; }
@font-face { font-family: "Trixie Elegant"; src: url("/fonts/DancingScript.woff") format("woff"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Trixie Retro"; src: url("/fonts/Lobster-Regular.woff") format("woff"); font-display: swap; }
@font-face { font-family: "Trixie Future"; src: url("/fonts/Orbitron.woff") format("woff"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Trixie Classic"; src: url("/fonts/PlayfairDisplay.woff") format("woff"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Trixie Bubbly"; src: url("/fonts/Chewy-Regular.woff") format("woff"); font-display: swap; }
.ff-pixel { font-family: "Trixie Pixel", monospace; font-size: .78em; line-height: 1.7; }
.ff-typewriter { font-family: "Trixie Typewriter", "Courier New", monospace; }
.ff-marker { font-family: "Trixie Marker", "Trixie Comic", cursive; }
.ff-elegant { font-family: "Trixie Elegant", "Trixie Script", cursive; font-size: 1.1em; }
.ff-retro { font-family: "Trixie Retro", cursive; }
.ff-future { font-family: "Trixie Future", system-ui, sans-serif; letter-spacing: .03em; }
.ff-classic { font-family: "Trixie Classic", "Trixie Serif", serif; }
.ff-bubbly { font-family: "Trixie Bubbly", "Trixie Rounded", cursive; }

/* v1.26.0: custom fonts */
.font-upload { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-1); margin: 10px 0 18px; }
.font-upload .font-name { flex: 1; min-width: 180px; }
.font-sample { font-size: 1.25em; line-height: 1.4; padding: 6px 2px; overflow-wrap: anywhere; }
.font-list h4 { margin: 16px 0 6px; }
.font-row { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; background: var(--bg-2); }
.font-row.pending { border-style: dashed; }
.font-row-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.font-row-head .spacer { flex: 1; }
.font-badge { font-size: .75em; padding: 1px 8px; border-radius: 10px; background: color-mix(in srgb, var(--warn) 25%, transparent); color: var(--text); }

/* v1.26.0: video clips */
.clip-picker { width: 460px; max-width: calc(100vw - 24px); display: flex; flex-direction: column; gap: 8px; }
.popover.pop-above .clip-picker { max-height: var(--pop-room, 460px); }
.clip-scroll { overflow-y: auto; min-height: 120px; max-height: 360px; padding: 2px; }
.clip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.clip-tile { display: flex; flex-direction: column; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); color: var(--text); cursor: pointer; text-align: left; min-width: 0; }
.clip-tile:hover, .clip-tile:focus-visible { border-color: var(--accent); background: var(--bg-hover); }
.clip-media { position: relative; aspect-ratio: 16 / 9; border-radius: 7px; overflow: hidden; background: #000; }
.clip-media img, .clip-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.clip-noimg { position: absolute; inset: 0; display: grid; place-items: center; font-size: 28px; }
.clip-len { position: absolute; right: 4px; bottom: 4px; z-index: 1; font-size: .7em; padding: 0 5px; border-radius: 6px; background: rgba(0,0,0,.7); color: #fff; }
.clip-name { font-size: .85em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clip-name .snd-emoji { font-size: 1em; }
.clip-editor .clip-video { width: 100%; max-height: 300px; background: #000; border-radius: 8px; margin: 6px 0; }
.clip-timeline { height: 54px; }
.clip-strip { width: 100%; height: 54px; display: block; border-radius: 6px; }
.clip-progress { margin: 6px 0; }
.clip-row { align-items: flex-start; }
.clip-row-video { width: 160px; max-width: 40vw; aspect-ratio: 16 / 9; background: #000; border-radius: 8px; flex: none; }
@media (max-width: 760px) { .clip-picker { width: calc(100vw - 16px); } .clip-grid { grid-template-columns: repeat(2, 1fr); } }
.clip-picker .input { flex: 1; min-width: 0; }
.popover.pop-above .clip-scroll { max-height: none; flex: 1; min-height: 0; }

/* v1.26.0: the same person on several devices in a call */
.call-person { position: relative; }
.call-person-device { position: absolute; left: -4px; bottom: -4px; font-size: 11px; line-height: 1; background: var(--bg-1); border-radius: 50%; padding: 1px; }
.call-person.own-device .avatar { outline: 2px dashed color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 1px; border-radius: 50%; }
.device-menu { min-width: 220px; }
.device-menu > div:first-child { grid-column: 1 / -1; }

/* v1.27.0: theme editor - colour pickers and the name side by side, the name above its colour code(s), and the
   Gradient switch on a line of its own underneath, so nothing overlaps or gets squeezed */
.theme-part { flex-direction: column; align-items: stretch; gap: 2px; }
.theme-part-main { align-items: center; }
.theme-part-text { display: flex; flex-direction: column; flex: 1; min-width: 6em; gap: 1px; line-height: 1.25; }
.theme-part-text .theme-part-name { flex: none; overflow-wrap: break-word; }
.theme-part-text .theme-part-hex { flex: none; font-size: .78em; display: flex; flex-direction: column; }
.theme-part .theme-grad-toggle { flex: none; align-self: flex-start; margin-left: 2px; }

/* v1.27.0: private clips and favourite clips */
.clip-grid-wrap .clip-grid + .sound-sec { margin-top: 10px; }
.clip-private { position: absolute; left: 4px; bottom: 4px; z-index: 1; font-size: .7em; padding: 0 4px; border-radius: 6px; background: rgba(0,0,0,.7); }
.clip-tile-star { position: absolute; top: 3px; right: 3px; z-index: 2; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; font-size: 14px; opacity: 0; transition: opacity .15s; cursor: pointer; }
.clip-tile:hover .clip-tile-star, .clip-tile-star.on, .clip-tile-star:focus-visible { opacity: 1; }
.clip-tile-star.on { color: #facc15; }
@media (hover: none) { .clip-tile-star { opacity: .85; } }
.clip-public-row { align-items: flex-start; gap: 8px; margin-top: 4px; }
.att-media .clip-star { opacity: .85; }

/* v1.28.0: send a clip as a spoiler - the eye at the top left of its tile in the picker */
.clip-tile-spoiler { position: absolute; top: 3px; left: 3px; z-index: 2; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; opacity: 0; transition: opacity .15s; cursor: pointer; }
.clip-tile-spoiler svg { width: 15px; height: 15px; }
.clip-tile:hover .clip-tile-spoiler, .clip-tile-spoiler.on, .clip-tile-spoiler:focus-visible { opacity: 1; }
.clip-tile-spoiler.on { background: var(--accent, #8b5cf6); }
@media (hover: none) { .clip-tile-spoiler { opacity: .85; } }
.clip-noimg svg { width: 32px; height: 32px; opacity: .6; }

/* v1.29.0: the typing "…" on an avatar is about the size of the status dot it replaces (it was over twice as big) */
.avatar .dot.typing { box-sizing: border-box; width: 18px !important; height: 12px !important; right: -5px; bottom: -2px; border-width: 2px;
  border-radius: 6px; gap: 1.5px; padding: 0; }
.avatar .dot.typing i { width: 2.5px; height: 2.5px; }
.avatar.sm .dot.typing { width: 16px !important; height: 10px !important; right: -4px; gap: 1px; }
.avatar.sm .dot.typing i { width: 2px; height: 2px; }
.avatar .dot.typing i { animation-name: tdot-sm; }
@keyframes tdot-sm { 0%, 60%, 100% { opacity: .4; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-1px); } }

/* v1.29.0: cameras in calls */
.screen-canvas.mirror, .share-preview.mirror { transform: scaleX(-1); }  /* your own front camera, like a mirror */
.camera-pop { width: 320px; max-width: calc(100vw - 32px); }
.camera-pop .share-preview { width: 100%; max-height: 240px; object-fit: contain; background: #000; border-radius: 8px; }
.call-btn.camera-btn:not(.on) { color: var(--text-2); }
.call-person .call-person-camera { right: auto; left: -4px; }
.profile-card .chat-profile-note { margin-top: 2px; }
.chat-profile-editor .name-sample { margin-bottom: 12px; }
/* v1.29.0: with the camera button the mini call bar's buttons go onto their own row when the sidebar is narrow */
.call-mini { flex-wrap: wrap; row-gap: 6px; }
.call-mini-info { flex: 1 1 110px; }
.call-mini .call-bar-ctl { flex: 0 1 auto; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }

/* v1.30.0: searching the settings */
.settings-search-wrap { margin: 0 0 8px; }
.settings-search { width: 100%; box-sizing: border-box; padding: 6px 10px; font-size: .9em; }
.tabs-nav.searching .tab.dim { opacity: .4; }
.settings-hit-group { margin-bottom: 14px; }
.settings-hit { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-bottom: 6px; color: var(--text); cursor: pointer; font: inherit; }
.settings-hit:hover, .settings-hit:focus-visible { background: var(--bg-hover); border-color: var(--accent); }
.settings-hit-tab { flex-direction: row; color: var(--text-2); font-weight: 600; background: none; }
@keyframes search-hit { 0%, 30% { box-shadow: 0 0 0 3px var(--accent); background: var(--accent-soft); } 100% { box-shadow: 0 0 0 3px transparent; } }
.search-hit { animation: search-hit 2.4s ease-out; border-radius: 8px; }
@media (max-width: 720px) { .settings-search-wrap { width: 100%; } }

.settings-index-holder { position: fixed; left: -20000px; top: 0; width: 800px; height: 600px; overflow: hidden; visibility: hidden; pointer-events: none; }

/* v1.31.0: folder profiles and the inherit switch */
.profile-inherit-row { margin-bottom: 10px; }
.profile-inherit-row .inherit-note { margin-top: 3px; }
.profile-own-fields.overridden { opacity: .55; }
.profile-own-fields.overridden:focus-within, .profile-own-fields.overridden:hover { opacity: .85; }

/* v1.31.0: the server's own icon */
.server-logo { object-fit: cover; }
.server-icon-preview { width: 40px; height: 40px; flex: none; border-radius: 50%; }

/* v1.32.0: message auditing - what each switch does, and the silent-auditing warning */
.maudit-explain { margin-top: 6px; display: grid; gap: 3px; line-height: 1.4; }
.maudit-live-warn { color: var(--danger); font-weight: 600; }
.maudit-warning { margin: 4px 0 12px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent); line-height: 1.4; }
.session-modal .session-pw { width: 100%; }
.ytsignin { display: grid; gap: 6px; margin-top: 6px; line-height: 1.4; }
.ytsignin .ytsignin-url { flex: 1; min-width: 0; }
.ytsignin-status { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.setting-row.ytsignin-sub .lbl { padding-left: 14px; border-left: 2px solid var(--line); }

/* v1.32.0: favourites are links - the conversation is also in its own place */
@keyframes sbReveal { 0%, 100% { box-shadow: none; } 30%, 70% { box-shadow: inset 0 0 0 2px var(--accent); } }
.chan.sb-reveal { animation: sbReveal 1.5s ease; }

/* v1.32.0: profile pages - a column of cards */
.modal.profile-page-modal { width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 40px); }
.modal.profile-page-modal .modal-body { padding-top: 6px; }
.pp-head { display: flex; gap: 18px; align-items: flex-start; padding: 6px 0 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pp-who { flex: 1; min-width: 200px; display: grid; gap: 4px; }
.pp-name { font-weight: 800; font-size: 1.5em; line-height: 1.2; word-break: break-word; }
.pp-tools:not(:empty) { padding: 12px 0 0; }
.pp-add { gap: 6px; align-items: center; }
/* v1.33.0: the page is a grid of widgets - cards span 1-3 columns and 1-4 rows, packed in order */
.pp-cards { --pp-row: 150px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(var(--pp-rows, 1), var(--pp-row));
  grid-auto-rows: var(--pp-row); gap: 12px; padding: 14px 0 4px; position: relative; }
/* v1.34.0: cards are placed where they were put; while editing, the grid's squares show where they can go */
.pp-slot { border: 1px dashed color-mix(in srgb, var(--line) 80%, transparent); border-radius: 12px; opacity: .55; pointer-events: none; }
.pp-drop-ghost { border: 2px dashed var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); border-radius: 12px; pointer-events: none; z-index: 1; }
.pp-card.moving { z-index: 5; opacity: .85; box-shadow: 0 12px 30px rgba(0,0,0,.45); }
.pp-card.moving::after { content: attr(data-at); position: absolute; left: 8px; bottom: 6px; font-size: 12px; font-weight: 700;
  background: var(--accent); color: #fff; padding: 1px 6px; border-radius: 6px; }
.pp-card.editing .pp-card-tools { cursor: grab; touch-action: none; user-select: none; }
.pp-card.moving .pp-card-tools { cursor: grabbing; }
.pp-nudge-pad { display: grid; grid-template-columns: repeat(3, auto); gap: 4px; justify-content: center; align-items: center; }
.pp-nudge-pad .pp-at { text-align: center; min-width: 44px; }
.pp-empty { padding: 24px 8px; text-align: center; grid-column: 1 / -1; }
.pp-card { position: relative; grid-column: span var(--w, 3); grid-row: span var(--h, 1); display: flex; flex-direction: column;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-width: 0; min-height: 0;
  overflow: hidden; overflow-wrap: anywhere; }
.pp-card-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.pp-card.editing { border-style: dashed; }
.pp-card.dragging { opacity: .45; }
.pp-card.drop-before { box-shadow: -3px 0 0 var(--accent); }
.pp-card.resizing { outline: 2px solid var(--accent); z-index: 2; }
.pp-card.resizing::after { content: attr(data-size); position: absolute; right: 26px; bottom: 6px; font-size: 12px; font-weight: 700;
  background: var(--accent); color: #fff; padding: 1px 6px; border-radius: 6px; }
.pp-card-title { margin: 0; font-size: 1.05em; flex: none; }
.pp-card-tools { display: flex; align-items: center; gap: 2px; margin: -6px -8px 4px; flex: none; }
.pp-grip { cursor: grab; opacity: .6; padding: 0 4px; }
.pp-resize { position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; cursor: nwse-resize; touch-action: none; z-index: 3;
  background: linear-gradient(135deg, transparent 50%, var(--accent) 50% 58%, transparent 58% 68%, var(--accent) 68% 76%, transparent 76%); opacity: .8; }
.pp-text { flex: 1; min-height: 0; overflow: auto; }
.pp-image { flex: 1; min-height: 0; width: 100%; object-fit: cover; border-radius: 8px; cursor: zoom-in; display: block; }
.pp-video { flex: 1; min-height: 0; width: 100%; object-fit: cover; border-radius: 8px; background: #000; display: block; }
/* v1.34.0: "Fit content to card" (on by default): the whole picture or video, inside the card */
.pp-card.fit .pp-image, .pp-card.fit .pp-video { object-fit: contain; }
.pp-card.fit .pp-image { border-radius: 0; }
.pp-card.fit .yt-thumb { background-size: contain !important; background-repeat: no-repeat; background-position: center; background-color: #000; }
.pp-audio { display: block; width: 100%; flex: none; }
.pp-caption { flex: none; max-height: 40%; overflow: auto; }
.pp-file-row { align-items: center; gap: 8px; flex: none; }
.pp-file { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pp-file-ico { font-size: 1.8em; }
.pp-file-name { min-width: 0; word-break: break-all; flex: 1; }
.pp-k-youtube .yt-embeds, .pp-k-youtube .yt-row { flex: 1; min-height: 0; margin: 0; display: flex; gap: 8px; }
.pp-k-youtube .yt-embed { flex: 1; min-width: 0; min-height: 0; max-width: none; display: flex; flex-direction: column; }
.pp-k-youtube .yt-thumb, .pp-k-youtube .yt-player { flex: 1; min-height: 0; aspect-ratio: auto; height: auto; }
.pp-k-youtube .yt-player iframe { width: 100%; height: 100%; }
.pp-grid-hint { margin-top: 6px; }
.pp-theme-tools { gap: 8px; align-items: center; margin-top: 8px; }
.pp-sizepick { display: grid; grid-template-columns: repeat(3, 26px); grid-auto-rows: 22px; gap: 3px; }
.pp-sizepick-cell { border: 1px solid var(--line); background: var(--bg-3); border-radius: 4px; padding: 0; cursor: pointer; }
.pp-sizepick-cell.on { background: var(--accent); border-color: var(--accent); }
.pp-sizepick-label { margin-top: 6px; text-align: center; }
.pp-theme-btn { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; margin-right: 6px; }
.pp-theme-btn svg { width: 16px; height: 16px; }
.pp-theme-btn.playing { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.pp-theme-btn:hover { filter: brightness(1.1); background: var(--accent); }
.pp-open-av { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 50%; }
.pp-open-av:hover { filter: brightness(1.08); }
.pcard-editor .pc-preview { margin-top: 8px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 8px; }
.pc-progress { height: 4px; border-radius: 2px; background: var(--bg-3); margin-top: 6px; overflow: hidden; }
.pc-progress > div { height: 100%; background: var(--accent); width: 0; transition: width .2s; }
@media (max-width: 640px) {
  .modal.profile-page-modal { width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; }
  .pp-head { gap: 12px; }
  .pp-cards { --pp-row: 110px; gap: 8px; }
  /* reading a page on a phone: two columns, the cards in reading order (editing keeps the real grid) */
  .pp-cards:not(.editing):not(.faithful) { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; grid-auto-rows: 120px; grid-auto-flow: row dense; }
  .pp-cards:not(.editing):not(.faithful) .pp-card { grid-column: span var(--wm, 2) !important; grid-row: span var(--h, 1) !important; }
}
.pp-card-kind { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-sizepick-pop { min-width: 170px; }
.pp-sizepick-pop .check { white-space: nowrap; }
/* v1.34.1: the profile card's buttons wrap onto a second line instead of running out of the card */
.profile-card .profile-actions { flex-wrap: wrap; gap: 6px; }
.profile-card .profile-actions .btn { flex: 0 1 auto; white-space: nowrap; }
/* v1.34.2: a resize previews live - cards it pushes down slide to their new place */
.pp-card.pushed { outline: 2px dashed color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: -2px; }
.pp-card.resizing .pp-card-body { pointer-events: none; }
/* v1.35.0: a context menu never runs off the window - if it's taller than the window it scrolls, with the
   quick-reactions row pinned at the top */
.ctx-pop { display: flex; flex-direction: column; overflow: hidden; box-sizing: border-box; }
.ctx-pop > .ctx-menu { overflow-y: auto; overscroll-behavior: contain; min-height: 0; scrollbar-width: thin; }
.ctx-pop > .ctx-menu > .ctx-row:first-child { position: sticky; top: 0; z-index: 1; background: var(--bg-2); }
/* v1.35.0: cards glide to their new size and place while you edit */
.pp-card.gliding { z-index: 1; }
.pp-layout-tools { gap: 6px; align-items: center; margin-top: 6px; }
/* v1.35.0: "Faithful mobile layout" (on by default): on a phone the page keeps its three columns - the same layout,
   just smaller - with rows scaled to keep the cards' shape */
.modal.profile-page-modal .modal-body { container-type: inline-size; }
@media (max-width: 640px) {
  .pp-cards.faithful { --pp-row: calc((100cqw - 12px) / 3 * .57); gap: 6px; }
  .pp-cards.faithful .pp-card { padding: 6px 7px; border-radius: 9px; font-size: .78em; }
  .pp-cards.faithful .pp-card-tools { margin: -3px -4px 2px; }
  .pp-cards.faithful .pp-card-title { font-size: 1em; }
  .pp-cards.faithful .btn.sm { padding: 3px 7px; font-size: 11px; }
  .pp-cards.faithful .pp-image, .pp-cards.faithful .pp-video { border-radius: 5px; }
}
/* v1.35.0: choosing a picture, sound or clip from the server for a profile card */
.modal.pp-src-picker { width: min(620px, calc(100vw - 24px)); }
.pp-src-tabs { gap: 6px; margin-bottom: 10px; }
.pp-src-status:not(:empty) { margin: 10px 2px 0; }
.pp-src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-top: 10px; max-height: min(52vh, 440px); overflow-y: auto; padding: 2px; }
.pp-src-item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; padding: 8px 6px 6px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg-3); cursor: pointer; min-width: 0; }
.pp-src-item:hover, .pp-src-item:focus-visible { border-color: var(--accent); outline: none; background: color-mix(in srgb, var(--accent) 10%, var(--bg-3)); }
.pp-src-item img { width: 100%; height: 76px; object-fit: contain; border-radius: 6px; }
.pp-src-k-clip img { object-fit: cover; background: #000; }
.pp-src-emoji { font-size: 40px; line-height: 76px; height: 76px; }
.pp-src-name { font-size: 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-src-play { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; }
.pp-src-play:hover { background: var(--accent); filter: brightness(1.1); }
@media (max-width: 640px) {
  .pp-cards.faithful .pp-file-row { flex-wrap: nowrap; gap: 4px; }
  .pp-cards.faithful .pp-file-row .pp-file-name, .pp-cards.faithful .pp-file-row > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; word-break: normal; }
  .pp-cards.faithful .pp-card[style*="--h:1"] .pp-file-row > :not(a) { display: none; }
  .pp-cards.faithful .pp-audio { height: 32px; }
}
.pp-src-picker .pp-src-grid { flex: 0 0 auto; min-height: 120px; }
/* v1.36.0: App Sounds - each call sound: on/off, which sound, listen */
.app-sound-ctl { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.app-sound-ctl .app-sound-select { min-width: 0; max-width: 220px; }
.app-sound-ctl.off .app-sound-select, .app-sound-ctl.off .app-sound-play { opacity: .5; }
.app-sounds-sub { margin-top: 14px; }
/* the notification sound settings shown in both Notifications and App Sounds */
.linked-pill { margin-left: 8px; padding: 1px 7px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--text); font-size: 11px; cursor: pointer; vertical-align: 1px; }
.linked-pill:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
@media (max-width: 640px) { .app-sound-ctl { flex-wrap: wrap; } .app-sound-ctl .app-sound-select { max-width: 100%; flex: 1; } }
.app-sound-ctl .app-sound-select { width: 200px; }
/* v1.38.0: live formatting in the message box. The box's own text is see-through; a formatted copy sits exactly
   behind it. The box uses a font with no italic or bold face of its own (so nothing changes a letter's width):
   italic is a slanted copy of the regular letters, bold is drawn with an outline. */
@font-face { font-family: "Trixie Compose"; font-style: normal; font-weight: 400;
  src: local("Segoe UI Variable Text"), local("SegoeUIVariable"), local("Segoe UI"), local("SegoeUI"), local("Roboto"), local("Roboto-Regular"),
       local("Noto Sans"), local("NotoSans-Regular"), local("Helvetica Neue"), local("Arial"), local("DejaVu Sans"), local("Liberation Sans"); }
.composer { position: relative; }
.composer.live-fmt textarea { font-family: "Trixie Compose", var(--font); color: transparent; caret-color: var(--text); position: relative; z-index: 1;
  -webkit-text-fill-color: transparent; }
.composer.live-fmt textarea::placeholder { color: var(--text-3); -webkit-text-fill-color: var(--text-3); }
.composer.live-fmt textarea::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.lf-mirror { display: none; position: absolute; z-index: 0; pointer-events: none; overflow: hidden; box-sizing: border-box; white-space: pre-wrap;
  overflow-wrap: break-word; word-break: normal; color: var(--text); font-family: "Trixie Compose", var(--font); font-weight: 400; font-style: normal;
  font-kerning: normal; }
.composer.live-fmt .lf-mirror { display: block; }
.lf-mirror .lf-mk { opacity: .45; }
.lf-mirror .lf-b { -webkit-text-stroke: .045em currentColor; }
.lf-mirror .lf-i { font-style: italic; font-synthesis: style; }
.lf-mirror .lf-u { text-decoration: underline; text-underline-offset: 2px; }
.lf-mirror .lf-s { text-decoration: line-through; }
.lf-mirror .lf-code { background: color-mix(in srgb, var(--text) 12%, transparent); border-radius: 3px; }
.lf-mirror .lf-spoiler { background: color-mix(in srgb, var(--text) 22%, transparent); border-radius: 3px; }
.lf-mirror .lf-link, .lf-mirror .lf-mention { color: var(--accent); }
.lf-mirror .lf-miss { text-decoration: underline wavy #e5484d; text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-skip-ink: none; }
.lf-mirror .lf-mention { background: color-mix(in srgb, var(--accent) 14%, transparent); border-radius: 3px; }
.lf-mirror .lf-quote { color: var(--text-2); }
/* v1.38.0: server notifications - the red number on the administration gear, and their list */
.server-admin-btn { position: relative; }
.notes-badge { position: absolute; top: -3px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger);
  color: #fff; font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; box-sizing: border-box; pointer-events: none;
  box-shadow: 0 0 0 2px var(--bg-1); }
.note-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--bg-2); }
.note-row.done { opacity: .65; }
.note-main { flex: 1; min-width: 0; }
.note-kind { font-weight: 700; }
.note-btns { gap: 6px; flex: none; }
@media (max-width: 640px) { .note-row { flex-wrap: wrap; } }
/* v1.40.0: the full-size picture's own menu (right-click, press and hold, or ⋯) instead of the phone's */
.lightbox img { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.lightbox-more { font-size: 18px; line-height: 1; padding-left: 10px; padding-right: 10px; }
/* v1.40.0: right-click menus and the little messages ("Image copied") show above everything - they were hidden behind
   a picture opened full size */
.popover.ctx-pop { z-index: 95; }
#toasts { z-index: 96; }
/* v1.41.0: colour tags show their colour as you type */
.lf-mirror .lf-color .lf-mk { color: var(--text); }
/* v1.41.0: muted / deafened bubbles on the people shown under a voice channel in the sidebar */
.voice-av-state { position: absolute; right: -3px; bottom: -3px; z-index: 1; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg-0); color: var(--danger); display: grid; place-items: center; box-shadow: 0 0 0 1.5px var(--bg-1); }
.voice-av-state svg { width: 9px; height: 9px; }
.voice-av.has-state { z-index: 1; }
.voice-av.has-state.muted { opacity: 1; }
.voice-av.has-state.sharing::after { top: -1px; bottom: auto; }
/* v1.41.0: GIF search on profile cards - the message box picker's grid, scrolling for more */
.pp-gif-scroll { margin-top: 10px; max-height: min(58vh, 520px); min-height: 220px; overflow-y: auto; padding: 2px; }
.pp-gif-scroll .gif-grid { columns: 3; }
@media (max-width: 560px) { .pp-gif-scroll .gif-grid { columns: 2; } }
/* v1.41.0: someone's volume in the right-click menu of a person in your call */
.ctx-volume { display: flex; align-items: center; gap: 8px; padding: 2px 9px 6px; min-width: 210px; flex: 1; }
.ctx-volume .vol-slider { flex: 1; min-width: 0; }
.ctx-volume .vol-value { min-width: 38px; text-align: right; font-size: .9em; }
.ctx-row:has(.ctx-volume) { padding: 0; }
.voice-default-note { display: block; margin: 1px 0 2px; }
.field > span .voice-default-note { display: inline; margin-left: 8px; text-transform: none; letter-spacing: 0; font-weight: 400; }
/* v1.42.0: swipe a message left to reply too - the arrow then shows on its right */
.msg.swiping.swipe-left::before { left: auto; right: -34px; }
/* v1.42.0: if the coloured copy of the text can't be made to wrap exactly like the box, the plain text shows instead */
.composer.live-fmt.lf-mismatch textarea { color: var(--text); -webkit-text-fill-color: var(--text); }
.composer.live-fmt.lf-mismatch .lf-mirror { visibility: hidden; }
/* v1.43.0: the formatting preview in the edit box - the same see-through box over a coloured copy as the message box */
.lf-host { position: relative; }
.lf-host.live-fmt textarea { font-family: "Trixie Compose", var(--font); color: transparent; caret-color: var(--text); position: relative; z-index: 1;
  -webkit-text-fill-color: transparent; }
.lf-host.live-fmt textarea::placeholder { color: var(--text-3); -webkit-text-fill-color: var(--text-3); }
.lf-host.live-fmt textarea::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.lf-host.live-fmt .lf-mirror { display: block; }
.lf-host.live-fmt.lf-mismatch textarea { color: var(--text); -webkit-text-fill-color: var(--text); }
.lf-host.live-fmt.lf-mismatch .lf-mirror { visibility: hidden; }
.edit-lf { border-radius: 8px; background: var(--bg-1); }
.edit-lf textarea { display: block; background: transparent; }
/* v1.43.0: the corner of a box you can stretch (the edit box) and of scrollable areas: see-through with grey grip lines,
   instead of the plain white square phones drew there */
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-resizer { background: linear-gradient(135deg, transparent 0 46%, rgba(150,150,150,.55) 46% 52%, transparent 52% 64%,
  rgba(150,150,150,.55) 64% 70%, transparent 70% 82%, rgba(150,150,150,.55) 82% 88%, transparent 88%); }
/* v1.43.0: scrapbooks - the pin menu's third tab (a small picture of it) and the full-screen canvas */
.sb-pane { padding: 8px; }
.sb-mini { position: relative; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 10px; cursor: pointer; border: 1px solid var(--line);
  background: var(--bg-2); }
.sb-mini:hover { border-color: var(--accent); }
.sb-mini-board { position: absolute; left: 0; top: 0; transform-origin: 0 0; background-color: var(--bg-2); pointer-events: none;
  background-image: radial-gradient(rgba(128,128,128,.3) 1.2px, transparent 1.6px); background-size: 28px 28px; }
.sb-pane-foot { display: flex; align-items: center; gap: 8px; padding: 8px 2px 2px; }
.sb-overlay { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: var(--bg-0); animation: fade .12s ease-out; outline: none; }
.sb-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--bg-1); }
.sb-title { display: flex; align-items: center; gap: 8px; min-width: 0; margin-right: auto; }
.sb-title .ic svg { width: 22px; height: 22px; }
.sb-chan { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 30vw; }
.sb-actions, .sb-zoom { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sb-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.sb-actions .ic svg { width: 16px; height: 16px; }
.sb-actions .gif-ic { font-size: 10px; font-weight: 800; border: 1.5px solid currentColor; border-radius: 4px; padding: 0 3px; line-height: 14px; }
.sb-swatch { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line); display: inline-block; }
.sb-zoom-lbl { min-width: 46px; text-align: center; font-size: .85em; color: var(--text-2); }
.sb-view { flex: 1; overflow: auto; position: relative; outline: none; touch-action: pan-x pan-y; background: var(--bg-0); }
.sb-view.panning { cursor: grabbing; }
.sb-view.drop-on { box-shadow: inset 0 0 0 3px var(--accent); }
.sb-sizer { position: relative; }
.sb-board { position: absolute; left: 0; top: 0; transform-origin: 0 0; background-color: var(--bg-2);
  background-image: radial-gradient(rgba(128,128,128,.3) 1.2px, transparent 1.6px); background-size: 28px 28px; }
.sb-item { position: absolute; box-sizing: border-box; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.sb-item.dragging { cursor: grabbing; }
.sb-item > img, .sb-item > video { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 4px; pointer-events: none;
  box-shadow: 0 6px 18px rgba(0,0,0,.35); background: rgba(0,0,0,.15); }
.sb-k-image > img { border: 5px solid #fff; box-sizing: border-box; border-radius: 3px; }
.sb-item .sb-note { width: 100%; height: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 4px; overflow: hidden; line-height: 1.3;
  box-shadow: 0 6px 18px rgba(0,0,0,.3); overflow-wrap: anywhere; }
.sb-item .sb-note p { margin: 0 0 .4em; }
.sb-note-edit { width: 100%; height: 100%; box-sizing: border-box; padding: 10px 12px; border: 0; border-radius: 4px; resize: none; outline: 2px solid var(--accent);
  font: inherit; line-height: 1.3; touch-action: auto; user-select: text; -webkit-user-select: text; }
.sb-item.selected { outline: 2px solid var(--accent); outline-offset: 3px; }
.sb-h { position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); box-sizing: border-box; z-index: 2; touch-action: none; }
.sb-resize { right: -11px; bottom: -11px; cursor: nwse-resize; border-radius: 4px; }
.sb-rotate { left: calc(50% - 8px); top: -34px; cursor: grab; }
.sb-rotate::after { content: ""; position: absolute; left: 5px; top: 14px; width: 2px; height: 18px; background: var(--accent); }
@media (pointer: coarse) { .sb-h { width: 26px; height: 26px; } .sb-resize { right: -16px; bottom: -16px; } .sb-rotate { left: calc(50% - 13px); top: -46px; } .sb-rotate::after { left: 10px; top: 24px; height: 18px; } }
.sb-play { position: absolute; left: 8px; bottom: 8px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 14px;
  cursor: pointer; display: grid; place-items: center; z-index: 1; }
.sb-play:hover { background: var(--accent); }
.sb-tools { position: absolute; z-index: 2000000; display: flex; gap: 2px; padding: 3px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); }
.sb-tools .icon-btn { width: 34px; height: 34px; font-size: 16px; }
.sb-status { padding: 6px 12px; border-top: 1px solid var(--line); background: var(--bg-1); min-height: 1.4em; }
.sb-pop { display: grid; gap: 8px; padding: 4px; max-width: 280px; }
.sb-swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sb-sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.sb-sw.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.sb-sw-theme { background: var(--bg-2); color: var(--text-2); font-size: 12px; font-weight: 700; }
.sb-custom-color { width: 34px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; }
.sb-missing { width: 100%; height: 100%; display: grid; place-items: center; border: 1px dashed var(--line); }
@media (max-width: 640px) {
  .sb-head { gap: 6px; padding: 6px 8px; }
  .sb-actions .lbl { display: none; }
  .sb-chan { max-width: 40vw; }
}
/* v1.43.0: spelling suggestions at the top of the message box's right-click menu */
.ctx-item.strong .ctx-label { font-weight: 700; }
/* v1.44.0: the edit box only stretches up and down - stretching it sideways pulled it out of line with the message */
.edit-box textarea { resize: vertical; max-width: 100%; }
/* v1.44.0: the What's New window after an update, and platform badges */
.modal.wn-pop { width: min(720px, calc(100vw - 32px)); max-width: none; }
.wn-pop .modal-body { max-height: min(70vh, 720px); overflow: auto; }
.wn-pop-lead { margin-top: 0; }
.wn-pop-key { margin-bottom: 8px; line-height: 2; }
.wn-pop-sec { margin-top: 14px; }
.wn-pop-h { margin: 6px 0; font-size: 1.05em; }
.wn-pop-ver { margin: 6px 0 10px; }
.wn-pop-vh { margin-bottom: 4px; font-weight: 600; }
.wn-pop-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.wn-pop-item { display: grid; gap: 4px; padding: 8px 12px; border-radius: 10px; background: var(--bg-1); }
.wn-pop-item.wn-elsewhere { opacity: .72; }
.wn-pop-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.wn-pop-badges.wn-inline { display: inline-flex; margin-right: 6px; vertical-align: 1px; }
.wn-pop-sub { margin: 4px 0 0; padding-left: 18px; }
.wn-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; line-height: 16px; border: 1px solid transparent; white-space: nowrap; }
.wn-badge.wn-global { background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--text-2); }
.wn-badge.wn-mobile { background: color-mix(in srgb, #22c55e 18%, transparent); color: #4ade80; }
.wn-badge.wn-desktop { background: color-mix(in srgb, #3b82f6 18%, transparent); color: #60a5fa; }
.wn-badge.wn-web { background: color-mix(in srgb, #f59e0b 18%, transparent); color: #fbbf24; }
.wn-badge.wn-this { border-color: currentColor; }
:root[data-theme="light"] .wn-badge.wn-mobile { color: #15803d; } :root[data-theme="light"] .wn-badge.wn-desktop { color: #1d4ed8; } :root[data-theme="light"] .wn-badge.wn-web { color: #b45309; }
/* v1.44.0: the radio - the call bar's button and its popout */
.call-btn.radio-btn { position: relative; }
.call-btn.radio-btn.radio-live::after { content: ""; position: absolute; right: 5px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg-1); }
.radio-pop { display: grid; gap: 10px; padding: 4px; width: min(400px, calc(100vw - 44px)); box-sizing: border-box; }
.radio-head { display: flex; align-items: center; gap: 10px; }
.radio-title { display: grid; }
.radio-now { display: flex; gap: 10px; align-items: center; min-height: 56px; }
.radio-thumb { width: 96px; height: 54px; border-radius: 6px; flex: none; background: var(--bg-3); overflow: hidden; display: grid; place-items: center; }
.radio-thumb::before { content: "📻"; grid-area: 1 / 1; font-size: 22px; }
.radio-thumb img { grid-area: 1 / 1; width: 100%; height: 100%; object-fit: cover; position: relative; }
.radio-now-info { min-width: 0; flex: 1; display: grid; gap: 3px; }
.radio-now-title, .radio-item-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radio-bar { height: 5px; border-radius: 3px; background: var(--bg-3); overflow: hidden; }
.radio-bar-fill { height: 100%; background: var(--accent); width: 0; transition: width .4s linear; }
.radio-ctl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.radio-vote { display: grid; justify-items: center; gap: 1px; padding: 6px 4px; line-height: 1.15; }
.radio-vote .radio-ic { font-size: 16px; }
.radio-vote.radio-stop:not(.primary) .radio-ic { filter: saturate(.6); }
.radio-vote:disabled { opacity: .45; cursor: default; }
.radio-count { font-size: 11px; opacity: .8; }
.radio-add-row { display: flex; gap: 6px; }
.radio-add-row .input { flex: 1; min-width: 0; }
.radio-sub { text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.radio-list { display: grid; gap: 4px; max-height: 240px; overflow: auto; }
.radio-item { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 8px; background: var(--bg-1); }
.radio-item.bad { opacity: .65; }
.radio-item-main { min-width: 0; flex: 1; }
.radio-num { width: 18px; text-align: right; flex: none; }
.radio-admin-av { width: 40px; height: 40px; }

/* v1.47.0: spelling suggestions on phones - a strip above the message box (its buttons don't take the focus, so the
   keyboard stays open) */
.spell-bar { position: absolute; left: 6px; right: 6px; bottom: calc(100% + 6px); z-index: 30; display: flex; gap: 6px; align-items: center;
  overflow-x: auto; scrollbar-width: none; padding: 6px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(0,0,0,.35); animation: fade .1s ease-out; }
.spell-bar::-webkit-scrollbar { display: none; }
.spell-chip { flex: 0 0 auto; border: 1px solid var(--line); background: var(--bg-3); color: var(--text); border-radius: 999px; padding: 6px 12px;
  font: inherit; font-size: 14px; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.spell-chip.spell-sugg { font-weight: 600; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.spell-chip.spell-add, .spell-chip.spell-close { color: var(--text-2); }
.spell-chip.spell-close { margin-left: auto; padding: 6px 10px; }
.spell-chip:active { background: color-mix(in srgb, var(--accent) 25%, var(--bg-3)); }
.spell-none { padding: 0 4px; }
/* v1.47.0: two-factor and forgot password */
.otp-input { font-family: var(--mono, ui-monospace, Consolas, monospace); letter-spacing: 2px; text-transform: uppercase; font-size: 18px; }
.otp-note { margin: 2px 0 10px; line-height: 1.45; }
.otp-links { margin: -4px 0 10px; }
.forgot-row { margin-top: 10px; }
.tfa-device b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-status { display: grid; gap: 3px; margin: 4px 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font-size: 13.5px; }
.email-test-to { max-width: 300px; }
/* v1.47.1: the SMTP conversation on the Email tab */
.email-log { margin-top: 6px; }
.email-log summary { cursor: pointer; }
.email-log-text { margin: 6px 0 0; max-height: 220px; overflow: auto; padding: 8px 10px; border-radius: 8px; background: var(--bg-1); font-size: 11.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-all; }

/* v1.48.0: an account awaiting an administrator's approval */
.app.pending-mode .members, .app.pending-mode .grip-members { display: none !important; }
.pending-side { padding: 14px 16px; line-height: 1.5; }
.pending-screen { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 16px; min-height: 0; overflow: auto; }
.pending-card { max-width: 440px; width: 100%; text-align: center; background: var(--bg-1);
  border: 1px solid var(--line); border-radius: 14px; padding: 32px 26px; }
.pending-icon { font-size: 44px; line-height: 1; margin-bottom: 14px; }
.pending-title { margin: 0 0 10px; font-size: 1.35em; }
.pending-card p { margin: 0 0 20px; line-height: 1.55; }
.pending-actions { justify-content: center; gap: 10px; flex-wrap: wrap; }

/* v1.49.0: sign-in - which account (one email on several), what email is for, and "check your Spam folder" */
.acct-stage { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.acct-list { display: flex; flex-direction: column; gap: 8px; }
.acct-choice { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text); cursor: pointer; font: inherit; }
.acct-choice:hover, .acct-choice:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.acct-choice:disabled { opacity: .5; cursor: not-allowed; }
.acct-who { min-width: 0; }
.acct-who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-back { align-self: flex-start; }
.email-why { margin: -2px 0 12px; line-height: 1.45; }
.spam-note { margin-top: 6px; opacity: .85; }

/* v1.50.0: zoom and pan in the picture viewer */
.lightbox-stage { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden;
  touch-action: none; cursor: zoom-out; }
.lightbox .lightbox-stage img { max-height: calc(100vh - 110px); transform-origin: 50% 50%; cursor: inherit; }
/* v1.51.0: full resolution - its own pixel size, scaled into the same space (no will-change: zooming re-draws sharply) */
.lightbox .lightbox-stage img.lb-native { max-width: none; max-height: none; flex: none; }
.lightbox.zoomed .lightbox-stage { cursor: grab; }
.lightbox.zoomed .lightbox-stage:active { cursor: grabbing; }
.lightbox-zoomctl { display: inline-flex; align-items: center; gap: 2px; }
.lightbox-zoom { min-width: 34px; font-variant-numeric: tabular-nums; }
.lightbox-zoom-pct { display: inline-block; min-width: 3.2em; text-align: center; }

/* v1.50.0: message pop-ups with a reply box */
.msg-pop { display: flex; flex-direction: column; gap: 8px; min-width: 260px; }
.msg-pop-text { overflow-wrap: anywhere; }
.msg-pop-reply { display: flex; gap: 6px; align-items: center; cursor: default; }
.msg-pop-input { flex: 1; min-width: 0; padding: 6px 10px; font-size: .92em; }

/* v1.51.0: dismiss a message pop-up */
.msg-pop { position: relative; }
.msg-pop-close { position: absolute; top: -10px; left: -10px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  padding: 0; border: 1px solid color-mix(in srgb, var(--text) 35%, transparent); background: var(--bg-3); color: var(--text); line-height: 0; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.45); z-index: 2; box-sizing: border-box; }
.msg-pop-close svg { display: block; }
.msg-pop-close:hover, .msg-pop-close:focus-visible { color: var(--text); background: var(--danger); border-color: var(--danger); }
@media (hover: hover) { .msg-pop .msg-pop-close { opacity: .85; } .msg-pop:hover .msg-pop-close { opacity: 1; } }

/* v1.51.0: searchable sound lists */
.sound-pick { position: relative; display: inline-flex; min-width: 0; flex: 1 1 auto; max-width: 320px; }
.sound-pick-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 150px; text-align: left; cursor: pointer; font: inherit; color: var(--text); }
.sound-pick-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sound-pick-caret { opacity: .6; font-size: .85em; }
.sound-pick.disabled .sound-pick-btn { opacity: .55; cursor: not-allowed; }
.sound-pick-native { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; padding: 0; border: 0; }
.sound-pick-panel { position: fixed; z-index: 120; display: flex; flex-direction: column; gap: 6px; padding: 8px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-height: 0; }
.sound-pick-search { flex: none; }
.sound-pick-list { overflow-y: auto; min-height: 0; flex: 1; overscroll-behavior: contain; }
.sound-pick-group { font-size: .72em; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 8px 6px 4px; }
.sound-pick-opt { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 7px; cursor: pointer; }
.sound-pick-opt:hover, .sound-pick-opt.hi { background: var(--bg-hover); }
.sound-pick-opt.sel { color: var(--accent-strong); font-weight: 600; }
.sound-pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sound-pick-check { color: var(--accent); }
.sound-pick-play { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-3); color: var(--text-2);
  display: grid; place-items: center; padding: 0; cursor: pointer; }
.sound-pick-play svg { width: 12px; height: 12px; }
.sound-pick-play:hover { color: var(--text); border-color: var(--accent); }
.sound-pick-play-gap { flex: none; width: 26px; }
.sound-pick-empty { padding: 8px 6px; }

/* v1.56.0: Trixie Editor - the button beside the server name, the chat canvas tab, Server administration -> Trixie Editor */
.server-head .editor-open-btn { flex: none; }
.server-head .editor-open-btn svg { width: 19px; height: 19px; }
.cv-pane { padding: 12px; }
.cv-card { display: flex; gap: 12px; align-items: flex-start; }
.cv-art { flex: none; width: 54px; height: 54px; border-radius: 12px; background: var(--bg-3, rgba(127,127,127,.12)); color: var(--accent); display: grid; place-items: center; }
.cv-art svg { width: 32px; height: 32px; }
.cv-text { flex: 1; min-width: 0; }
.cv-desc { margin-top: 3px; line-height: 1.4; }
.editor-status { margin: 8px 0 14px; display: grid; gap: 4px; }
.editor-trust { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin: 4px 0; }
.editor-fp { display: block; margin-top: 6px; font-size: .78em; word-break: break-all; user-select: all; }
.editor-features { display: grid; gap: 2px; margin-top: 4px; }
/* (four tabs - Pinned, List, Scrapbook, Canvas - share the menu's width; on a narrow screen the icons go first) */
.pins-tab { min-width: 0; }
.pins-tab > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) {
  .pins-tabs:has(.tab-canvas) .pins-tab { padding: 6px 4px; gap: 4px; font-size: .9em; }
  .pins-tabs:has(.tab-canvas) .pins-tab:not(.active) .ic { display: none; }
}

/* v1.56.1: Trixie Editor's pane - over the conversation (placed on .main by placeEditorPane), the sidebar staying put */
.editor-pane { position: absolute; z-index: 30; display: flex; flex-direction: column; background: var(--bg-2); border-left: 1px solid var(--line); min-width: 0; }
.editor-pane.hidden { display: none; }
.editor-pane-bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--bg-1, var(--bg-2)); }
.editor-pane-bar .ic svg { width: 18px; height: 18px; display: block; color: var(--accent); }
.editor-pane-bar b { font-size: .95em; }
.editor-frame { flex: 1; width: 100%; border: 0; background: #fff; min-height: 0; }
.server-head .editor-open-btn.active { color: var(--accent); background: var(--bg-3); }
@media (max-width: 720px) {
  .editor-pane { position: fixed; inset: 0 !important; width: auto !important; height: auto !important; z-index: 60; }
}

/* v1.56.6: entries the server puts in a conversation (joins, leaves, a poll closing) */
.msg.sys-entry { display: block; padding: 4px 16px 4px 72px; position: relative; color: var(--text-2); }
.msg.sys-entry .sys-row { display: flex; align-items: baseline; gap: 0; }
.msg.sys-entry .sys-icon { position: absolute; left: 30px; width: 20px; text-align: center; font-weight: 700; }
.msg.sys-entry .sys-row .sys-icon { top: auto; }
.msg.sys-entry .sys-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; vertical-align: -3px; }
.msg.sys-join .sys-icon { color: var(--ok, #3ba55d); }
.msg.sys-leave .sys-icon { color: #ed4245; }
.msg.sys-entry .sys-name { color: var(--text); cursor: pointer; font-weight: 600; }
.msg.sys-entry .sys-name:hover { text-decoration: underline; }
.msg.sys-entry .sys-q { color: var(--text); }
.msg.sys-entry .time { font-size: 0.78em; margin-left: 2px; opacity: 0.8; }
.msg.sys-entry .reply-ref { margin-bottom: 2px; }
.sys-poll-card { display: flex; align-items: center; gap: 12px; margin-top: 6px; padding: 10px 12px; max-width: 440px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); }
.sys-poll-card .spr-emoji { flex: none; width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center;
  font-size: 24px; background: var(--bg-hover); }
.sys-poll-card .spr-emoji svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.sys-poll-card .spr-emoji .cemoji { width: 28px; height: 28px; }
.sys-poll-card .spr-main { flex: 1; min-width: 0; }
.sys-poll-card .spr-title { font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.sys-poll-card .spr-check { flex: none; width: 16px; height: 16px; border-radius: 50%; background: #3ba55d; display: grid; place-items: center; }
.sys-poll-card .spr-check svg { width: 11px; height: 11px; fill: none; stroke: #fff; stroke-width: 3; }
.sys-poll-card .spr-view { flex: none; }
@media (max-width: 700px) { .msg.sys-entry { padding-left: 52px; } .msg.sys-entry .sys-icon { left: 18px; } }
/* v1.56.6: an emoji on a poll choice */
.poll-opt-emoji { flex: none; font-size: 1.15em; line-height: 1; position: relative; }
.poll-opt-emoji .cemoji { width: 20px; height: 20px; vertical-align: middle; }
.poll-emoji-btn { flex: none; width: 34px; height: 34px; font-size: 18px; opacity: 0.7; }
.poll-emoji-btn.set { opacity: 1; }
.poll-emoji-btn .cemoji { width: 22px; height: 22px; }
/* v1.56.7: server entries can be reacted to */
.msg.sys-entry .reactions { margin-top: 4px; }

/* v1.56.8: links straight to videos, sounds and big pictures play in the conversation */
.link-card.link-media { padding: 0; border: 0; background: none; max-width: min(480px, 100%); }
.link-card.media-video video { display: block; max-width: 100%; max-height: 360px; border-radius: 8px; background: #000; }
.link-card.media-audio audio { display: block; width: min(360px, 100%); }
.link-card.media-image img { max-height: 360px; }

/* v1.56.9: videos found on a page, and videos on other sites fetched to play here */
.link-media-cap { display: block; margin-top: 4px; font-size: 0.85em; color: var(--text-2); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: min(480px, 100%); }
a.link-media-cap:hover { text-decoration: underline; }
.site-video { display: flex; flex-direction: column; gap: 6px; max-width: min(520px, 100%); }
.site-video-actions { display: flex; align-items: center; gap: 8px; }
.site-video-actions .ytdl-btn { position: relative; }
.site-video video.site-player { display: block; max-width: 100%; max-height: 360px; border-radius: 8px; background: #000; }

/* v1.56.13: the Android app already keeps its page clear of the system bars (and the gesture area), so the page
   mustn't add the same space again - that left a gap under the message box on tall phones */
html.android-app .composer-wrap { padding-bottom: 4px; }
html.android-app .sidebar { padding-top: 0; }

/* v1.56.14: forwards quote what they carry; fixed embeds sit quietly under a link's own card */
.fwd-quote { border-left: 3px solid var(--line); padding: 1px 0 1px .8em; margin: 2px 0; }
.fwd-quote > .body { margin-top: 0; color: var(--text-2); }
.link-fix { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.link-fix-head { display: flex; align-items: center; gap: 4px; font-size: .78em; color: var(--text-3); }
.link-fix-head .ic svg { width: 12px; height: 12px; display: block; }
.link-fix-head a { color: var(--text-3); text-decoration: none; }
.link-fix-head a:hover { text-decoration: underline; color: var(--text-2); }

/* v1.56.15: "Forwarded to …" with a Switch to button */
.toast.fwd-toast { display: flex; align-items: center; gap: 12px; }
.fwd-toast-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.fwd-toast-go { flex: none; }
/* v1.56.15: horizontal rule (--- on its own line), in the theme's colours; and its button in the formatting bar */
.md-hr { border: 0; height: 2px; margin: .45em 0; border-radius: 2px; width: 100%;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 75%, var(--line)) 12%, color-mix(in srgb, var(--accent) 75%, var(--line)) 88%, transparent); }
.fmt-hr { display: inline-block; width: 16px; height: 2px; border-radius: 1px; background: currentColor; vertical-align: middle; }
/* v1.57.0: italics while typing keep their real italic letters; app.js spaces each word to the width of the typed text */
/* v1.57.0: Sent / Seen under your latest message */
.msg-receipt { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin-top: 2px; font-size: .72em; color: var(--text-3);
  line-height: 1.2; user-select: none; }
.msg-receipt .rc-ico { display: inline-flex; width: 1.35em; height: 1.35em; align-items: center; justify-content: center; }
/* v1.60.0 (TM-381): icons only - the words and names are in the tooltip */
.msg-receipt { font-size: .8em; }
.msg-receipt .rc-ico svg { width: 100%; height: 100%; }
.msg-receipt.seen { color: var(--accent); }
.msg-receipt.seen { cursor: default; }
/* v1.58.0 (TM-332): YouTube playlist cards */
.yt-playlist .yt-thumb { position: relative; }
.yt-list-badge { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.75); color: #fff; font-size: .75em; font-weight: 600;
  padding: 2px 7px; border-radius: 4px; pointer-events: none; }
/* v1.58.0: ticket references in What's New */
.wn-ticket { font-size: .72em; color: var(--text-3); margin-left: 6px; letter-spacing: .02em; white-space: nowrap; vertical-align: 1px; }
/* v1.59.0 (TM-378): a post's picture when it has no video */
img.site-player { display: block; max-width: 100%; max-height: 420px; border-radius: 6px; }
