/* nyx: floating panels on near-black, hairline borders, square-ish avatars. One gold accent. */
:root {
  --bg: #121212;
  --panel: #171717;
  --raised: #1f1f1f;
  --hover: #242424;
  --line: #262626;
  --line-2: #3a3a3a;
  --edge: #ffffffaa;      /* outlined buttons */
  --text: #eeeeee;
  --mist: #a1a1a1;
  --dim: #8a8a8a; /* the faintest text; anything darker was hard to read on the panels */
  --gold: #f2c66d;        /* the accent */
  --gold-2: #fff0cc;
  --gold-ink: #2b1f06;
  --online: #4ade80;
  --idle: #facc15;
  --dnd: #f87171;
  --link: #a99cff;

  --f-body: 'Work Sans', ui-sans-serif, system-ui, sans-serif;
  --f-display: 'Space Grotesk', var(--f-body);
  --f-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  --r: 10px;
  --r-s: 8px;
  --gap: 8px;
  --nav: 300px;
  --side: 300px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: default; opacity: .5; }
a { color: var(--link); }
img { display: block; }
h1, h2, h3, h4, h5 { font-family: var(--f-display); font-weight: 400; margin: 0; }
strong, b { font-weight: 650; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--gold) 33%, transparent); }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

.ic { display: inline-grid; place-items: center; flex: none; }
.ic svg { display: block; }
.muted { color: var(--mist); }
.small { font-size: 13px; }
.display { font-family: var(--f-display); font-weight: 400; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }
.stack-sm { display: grid; gap: 6px; justify-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.chip { display: inline-block; padding: 0 5px; border-radius: 4px; background: var(--hover); color: var(--text); }
.chip.mono { font: 11px/1.8 var(--f-mono); color: var(--mist); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 14px;
  border-radius: var(--r-s); font-weight: 500; font-size: 14px; background: #ffffff10; border: 1px solid var(--line-2);
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover:not(:disabled) { background: #ffffff1a; border-color: #ffffff55; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.outline { background: #ffffff15; border: 2px solid var(--edge); }
.btn.outline:hover:not(:disabled) { background: #ffffff22; border-color: #fff; }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: #fff; border-color: #fff; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn.gold:hover:not(:disabled) { background: var(--gold-2); border-color: var(--gold-2); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--dnd); }
.btn.danger.primary { background: var(--dnd); border-color: var(--dnd); color: #2a0b06; }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn.outline.small { border-width: 1px; }
.btn.verified { color: var(--online); border-color: #4ade8088; }
.btn.warn { color: var(--idle); border-color: #facc1588; }
.link, .btn.link { background: none; border: 0; color: var(--link); padding: 0; min-height: 0; }
.link:hover { text-decoration: underline; }

.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; color: var(--mist); transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.on { color: var(--gold); }
.icon-btn.off { color: var(--dnd); }
.icon-btn.danger:hover { color: var(--dnd); }
.icon-btn.tiny { width: 22px; height: 22px; border-radius: 5px; }
.icon-btn.tiny .ic svg { width: 14px; height: 14px; }

input:not([type=checkbox]):not([type=radio]):not([type=color]), textarea, select {
  width: 100%; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r-s); padding: 9px 11px; outline: none;
  transition: border-color .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--mist); }
textarea { resize: none; line-height: 1.5; }
select { width: auto; padding: 5px 8px; height: 32px; }
input::placeholder, textarea::placeholder { color: var(--dim); }
.form-error { color: var(--dnd); font-size: 13px; margin: 0; }
.form-error:empty { display: none; }
.field { display: grid; gap: 6px; }
.field-label { font-size: 13px; font-weight: 500; color: var(--mist); display: flex; align-items: center; gap: 8px; }
.hint { font-size: 12px; color: var(--dim); }
.field.locked .row { opacity: .45; pointer-events: none; }
.form-foot { display: flex; justify-content: flex-end; }

/* ---------- auth: glass panel over a night grid ---------- */
.auth {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; overflow: auto;
  background-image:
    linear-gradient(to right, #eeeeee12 1px, transparent 1px),
    linear-gradient(to bottom, #eeeeee12 1px, transparent 1px),
    linear-gradient(to top, #0d0e15 10%, #4a4f86 200%);
  background-size: 40px 40px, 40px 40px, cover;
}
.glass { position: relative; border-radius: var(--r); background: #0000004d; backdrop-filter: blur(4px); }
.glass::before {
  content: ''; position: absolute; inset: 0; padding: 1px; border-radius: inherit; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, var(--gold), var(--gold-2));
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.auth-card { width: min(560px, 100%); padding: 18px 20px 20px; animation: rise .6s var(--ease) both; }
.auth-card > p { margin: 4px 0 0; max-width: 60ch; }
.auth-title { font-size: 36px; line-height: 1.1; letter-spacing: -.01em; }
.auth-form { display: grid; gap: 12px; margin-top: 22px; }
.auth-form h2 { font-size: 22px; }
.auth-form > p { margin: -8px 0 0; font-size: 14px; }
.auth-form input { background: #00000055; }
.pair { display: flex; gap: 6px; }
.pair > .btn { flex: 1; min-height: 42px; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes fade-in { from { opacity: 0; } }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: var(--nav) minmax(0, 1fr); gap: var(--gap); padding: var(--gap); height: 100dvh; }
body.with-members .app { grid-template-columns: var(--nav) minmax(0, 1fr) var(--side); }
.members:empty { display: none; }

.nav { display: flex; flex-direction: column; gap: var(--gap); min-height: 0; }
.nav-top { display: flex; gap: var(--gap); }
.nav-btn {
  flex: 1; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: var(--r-s);
  background: var(--panel); border: 1px solid var(--line); font-weight: 500; font-size: 14px; position: relative;
  transition: background .15s, border-color .15s;
}
.nav-btn:hover { background: var(--raised); border-color: var(--line-2); }
.nav-btn.active { border-color: var(--edge); background: var(--raised); }
.nav-btn.center { justify-content: center; }
.nav-btn.plus-on .ic { color: var(--gold); }
.nav-btn.plus-on svg { fill: var(--gold); }
.nav-square { width: 36px; height: 36px; flex: none; border-radius: var(--r-s); background: var(--panel); border: 1px solid var(--line); color: var(--text); }
.nav-square:hover { border-color: var(--line-2); }
.badge { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 5px; background: var(--text); color: var(--bg); font: 700 12px/20px var(--f-mono); text-align: center; }
.badge.dot { min-width: 8px; width: 8px; height: 8px; padding: 0; border-radius: 2px; background: var(--gold); }

.spaces { display: grid; align-content: start; gap: 2px; padding: 4px; max-height: 30%; min-height: 46px; overflow-y: auto; flex: none; }
.space-row { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 7px; border-radius: var(--r-s); border: 1px solid transparent; transition: background .12s, border-color .12s; }
.space-row:hover { background: var(--raised); }
.space-row.active { background: var(--raised); border-color: var(--line-2); }
.space-icon { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 6px; background: var(--hover); overflow: hidden; font: 600 11px var(--f-display); color: var(--mist); }
.space-icon img { width: 100%; height: 100%; object-fit: cover; }
.space-name { font: 500 14px var(--f-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-empty { margin: 0; padding: 12px 8px; color: var(--dim); font-size: 13px; }

.nav-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); flex: none; }
.tile-btn {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: var(--r-s); min-width: 0;
  background: var(--panel); border: 1px solid var(--line); font-weight: 500; font-size: 14px; white-space: nowrap; transition: background .15s, border-color .15s;
}
.tile-btn:hover { background: var(--raised); border-color: var(--line-2); }

.side { flex: 1; min-height: 140px; display: flex; flex-direction: column; overflow: hidden; }
.space-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; height: 40px; padding: 0 8px 0 12px; border-bottom: 1px solid var(--line); flex: none; }
.space-head > span { font: 500 15px var(--f-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.space-head:hover { background: var(--raised); }
.space-head.home > span { color: var(--mist); font-size: 14px; }
.side-list { flex: 1; overflow-y: auto; padding: 4px; }
.side-empty { padding: 12px 8px; color: var(--mist); display: grid; gap: 10px; justify-items: start; font-size: 14px; }
.side-empty p { margin: 0; }

.ch-group + .ch-group { margin-top: 12px; }
.ch-label { display: flex; align-items: center; justify-content: space-between; padding: 6px 4px 4px 8px; font-size: 12px; color: var(--dim); }
.ch-row { position: relative; display: flex; align-items: center; }
.ch { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px; border-radius: 6px; color: var(--mist); border: 1px solid transparent; transition: background .12s, color .12s; }
.ch > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch .ic { color: var(--dim); }
.ch:hover { background: var(--raised); color: var(--text); }
.ch.active { background: var(--raised); color: var(--text); border-color: var(--line-2); }
.ch.unread { color: var(--text); font-weight: 600; }
.ch.unread::after { content: ''; margin-left: auto; width: 6px; height: 6px; border-radius: 2px; background: var(--gold); flex: none; }
.ch.connected .ic { color: var(--online); }
.ch-edit { position: absolute; right: 4px; opacity: 0; width: 26px; height: 26px; }
.ch-row:hover .ch-edit, .ch-edit:focus-visible { opacity: 1; }

.vc-users { display: grid; gap: 1px; padding: 2px 0 6px 26px; }
.vc-user { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 6px; border-radius: 6px; font-size: 14px; color: var(--mist); }
.vc-user > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-user:hover { background: var(--raised); color: var(--text); }
.vc-user .av { box-shadow: 0 0 0 2px var(--panel), 0 0 0 3.5px transparent; transition: box-shadow .15s; }
.vc-user.speaking .av { box-shadow: 0 0 0 2px var(--panel), 0 0 0 3.5px var(--online); } /* the ring is always there; only its color changes, so nothing seems to grow */
.live { font: 700 10px/1 var(--f-mono); padding: 3px 5px; border-radius: 4px; background: var(--dnd); color: #2a0b06; }

.dm-list { display: grid; gap: 2px; }
.dm { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border-radius: 6px; color: var(--mist); border: 1px solid transparent; }
.dm:hover { background: var(--raised); color: var(--text); }
.dm.active { background: var(--raised); color: var(--text); border-color: var(--line-2); }
.dm.unread { color: var(--text); }
.dm.unread .dm-name { font-weight: 650; }
.dm.unread::after { content: ''; width: 6px; height: 6px; border-radius: 2px; background: var(--gold); flex: none; }
.dm-text { display: grid; min-width: 0; flex: 1; }
.dm-name, .dm-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-name { font-size: 15px; }
.dm-sub { font-size: 12px; color: var(--dim); }
.live-dot { color: var(--online); }

.voicebar { display: flex; align-items: center; gap: 2px; padding: 8px 6px 8px 12px; border-radius: var(--r); background: var(--panel); border: 1px solid #4ade8040; animation: rise .3s var(--ease); }
.vb-info { flex: 1; min-width: 0; display: grid; }
.vb-state { font-size: 13px; font-weight: 600; }
.vb-state.ok { color: var(--online); }
.vb-state.wait { color: var(--idle); }
.vb-where { font-size: 12px; color: var(--mist); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vb-info:hover .vb-where { text-decoration: underline; }
.vb-actions { display: flex; }

.nav-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; flex: none; }
.nav-buttons .nav-btn { gap: 6px; padding: 0 8px; font-size: 13px; min-width: 0; justify-content: center; }
.nav-buttons .nav-btn > :not(.ic):not(.pres) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-buttons .key-banner { grid-column: 1 / -1; }
.me-card { display: flex; align-items: center; gap: 2px; padding: 8px; flex: none; }
.me { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 2px; border-radius: var(--r-s); }
.me-text { display: grid; min-width: 0; }
.me-name { font: 500 18px/1.15 var(--f-display); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-sub { font-size: 13px; color: var(--mist); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me:hover .me-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.me-ctl { display: flex; }

/* avatars: rounded squares; presence: a square */
.av { position: relative; flex: none; display: inline-grid; place-items: center; border-radius: 22%; color: #fff; font: 600 1em var(--f-display); }
.av img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.av > span:not(.pres) { line-height: 1; }
.pres {
  position: absolute; right: -3px; bottom: -3px; width: 30%; height: 30%; min-width: 9px; min-height: 9px; max-width: 16px; max-height: 16px;
  border-radius: 3px; border: 2px solid var(--panel); background: var(--dim);
}
.pres.online { background: var(--online); }
.pres.idle { background: var(--idle); }
.pres.dnd { background: var(--dnd); }
.pres.offline, .pres.invisible { background: var(--bg); box-shadow: inset 0 0 0 2px var(--dim); }
.pres.inline { position: static; display: inline-block; width: 10px; height: 10px; min-width: 0; min-height: 0; border: 0; border-radius: 2px; }
.name { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.tag { font: 700 10px/1 var(--f-mono); padding: 3px 5px; border-radius: 4px; background: var(--gold); color: var(--gold-ink); }
.plus-star { color: var(--gold); display: inline-grid; }
.plus-star svg { fill: var(--gold); }

/* ---------- main column ---------- */
.main { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; min-height: 0; }
.chan-head {
  flex: none; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 6px 4px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); color: var(--dim);
}
.head-name { color: var(--text); font-weight: 600; white-space: nowrap; }
.head-topic { color: var(--mist); font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-user { display: flex; align-items: center; gap: 8px; }
.head-user .pres { border-color: var(--panel); }
.head-actions { margin-left: auto; display: flex; gap: 2px; }
.head-actions .ring { color: var(--online); animation: ring 1.6s ease-in-out infinite; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(-12deg); } 20%, 40% { transform: rotate(12deg); } 50% { transform: rotate(0); } }
.nav-toggle { display: none; }

.empty-main, .prejoin { flex: 1; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 32px 16px; text-align: center; }
.empty-main p, .prejoin p { margin: 0; max-width: 44ch; }
.empty-main .display { font-size: 34px; }
.prejoin .display { font-size: 28px; }
.prejoin-orbit { display: flex; margin-bottom: 6px; }
.prejoin-orbit .av + .av { margin-left: -12px; }
.prejoin-orbit .av { box-shadow: 0 0 0 3px var(--bg); }
.prejoin-moon { width: 88px; height: 88px; border-radius: 22%; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); color: var(--mist); }
.prejoin-note { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mist); }

/* chat */
.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; gap: 6px; }
.chat.drop::after {
  content: 'Drop to attach'; position: absolute; inset: 0; display: grid; place-items: center; border-radius: var(--r);
  border: 2px dashed var(--edge); background: #121212e6; font: 500 18px var(--f-display); pointer-events: none;
}
.scroller { flex: 1; overflow-y: auto; overflow-anchor: none; }
.msgs { display: flex; flex-direction: column; min-height: 100%; justify-content: flex-end; padding: 8px 0; }
.msgs-loading { display: flex; gap: 6px; justify-content: center; padding: 40px; }
.msgs-loading span, .dots i { width: 6px; height: 6px; border-radius: 2px; background: var(--mist); animation: blink 1.2s infinite both; }
.msgs-loading span:nth-child(2), .dots i:nth-child(2) { animation-delay: .15s; }
.msgs-loading span:nth-child(3), .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.chan-start { display: grid; gap: 6px; justify-items: start; padding: 20px 14px 12px; }
.chan-start .display { font-size: 30px; }
.chan-start p { margin: 0; }
.chan-start-icon { width: 60px; height: 60px; border-radius: 22%; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); color: var(--mist); }
.day { display: flex; align-items: center; gap: 12px; margin: 16px 14px 4px; font: 11px var(--f-mono); color: var(--dim); }
.day::before, .day::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.msg { position: relative; padding: 2px 56px 2px 14px; border-radius: var(--r-s); }
.msg.head { margin-top: 12px; }
.msg:hover, .msg:focus-within { background: #ffffff06; }
.msg.mentioned { background: color-mix(in srgb, var(--gold) 5%, transparent); box-shadow: inset 2px 0 0 var(--gold); }
.msg.fresh { animation: msg-in .3s var(--ease); }
.msg.flash { animation: flash 1.6s ease-out; }
@keyframes msg-in { from { opacity: 0; transform: translateY(5px); } }
@keyframes flash { 0%, 30% { background: color-mix(in srgb, var(--gold) 13%, transparent); } }
.msg-row { display: flex; gap: 12px; }
.msg-av { flex: none; align-self: flex-start; margin-top: 3px; border-radius: 22%; }
.msg-main { min-width: 0; flex: 1; }
.msg-meta { display: flex; align-items: baseline; gap: 8px; }
.msg-name .name { font-weight: 600; }
.msg-name:hover .name { text-decoration: underline; }
.msg-meta time { font-size: 12px; color: var(--dim); }
/* the time on hover for follow-up messages: one line, in the avatar column, and it never makes the row taller */
.side-time { flex: none; width: 40px; height: 0; overflow: visible; white-space: nowrap; text-align: right; font: 10px/2.2 var(--f-mono); color: var(--dim); opacity: 0; display: flex; justify-content: flex-end; }
.msg:hover .side-time { opacity: 1; }
.content { overflow-wrap: anywhere; line-height: 1.55; }
.content.big { font-size: 40px; line-height: 1.2; }
.content .md-h { font-family: var(--f-display); font-weight: 400; margin: 6px 0 4px; line-height: 1.2; }
.content h3.md-h { font-size: 28px; }
.content h4.md-h { font-size: 22px; }
.content h5.md-h { font-size: 18px; }
.content code { font: 13px var(--f-mono); background: var(--raised); padding: 1px 5px; border-radius: 4px; }
.content pre { margin: 6px 0; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-s); overflow-x: auto; max-width: 760px; }
.content pre code { padding: 0; background: none; }
.content blockquote { margin: 4px 0; padding-left: 10px; border-left: 3px solid var(--line-2); }
.content a { text-decoration: underline; text-underline-offset: 2px; }
.mention { padding: 0 3px; border-radius: 4px; background: color-mix(in srgb, var(--gold) 13%, transparent); color: var(--gold); font-weight: 600; cursor: pointer; }
.spoiler { background: var(--line-2); color: transparent; border-radius: 4px; cursor: pointer; transition: color .2s, background .2s; }
.spoiler.open { background: var(--raised); color: inherit; cursor: auto; }
.edited { font-size: 11px; color: var(--dim); margin-left: 4px; }
.ref { display: flex; align-items: center; gap: 6px; margin: 6px 0 2px 24px; font-size: 13px; color: var(--mist); max-width: calc(100% - 24px); }
.ref > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref b { color: var(--text); font-weight: 600; }
.ref:hover > span:last-child { color: var(--text); }

.tools {
  position: absolute; right: 12px; top: -16px; display: flex; gap: 1px; padding: 3px; border-radius: var(--r-s);
  background: var(--panel); border: 1px solid var(--line-2); opacity: 0; transform: translateY(3px); pointer-events: none; transition: opacity .12s, transform .12s;
}
.msg:hover .tools, .msg:focus-within .tools { opacity: 1; transform: none; pointer-events: auto; }
.tool-emoji { width: 32px; height: 32px; border-radius: 6px; font-size: 17px; display: grid; place-items: center; transition: transform .15s var(--spring); }
.tool-emoji:hover { background: var(--hover); transform: scale(1.15); }

.atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.att-img { border-radius: var(--r-s); overflow: hidden; max-width: min(420px, 100%); border: 1px solid var(--line); }
.att-img img { max-width: 100%; max-height: 340px; object-fit: contain; background: var(--panel); }
.att-media { max-width: min(480px, 100%); max-height: 340px; border-radius: var(--r-s); background: #000; }
.att-file { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-s); background: var(--panel); border: 1px solid var(--line); color: var(--text); text-decoration: none; max-width: 420px; }
.att-file:hover { border-color: var(--line-2); }
.att-name { font-weight: 500; overflow-wrap: anywhere; }
.att-size { font: 11px var(--f-mono); color: var(--mist); }
.att-file audio { margin-top: 6px; max-width: 100%; }

.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.reaction { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line-2); font-size: 15px; transition: border-color .12s, transform .15s var(--spring); }
.reaction:hover { border-color: var(--mist); }
.reaction:active { transform: scale(.94); }
.reaction .count { font: 600 12px var(--f-mono); color: var(--mist); }
.reaction.mine { background: color-mix(in srgb, var(--gold) 8%, transparent); border-color: color-mix(in srgb, var(--gold) 60%, transparent); }
.reaction.mine .count { color: var(--gold); }

.editing { display: grid; gap: 4px; margin: 4px 0; }
.editing .hint { margin: 0; }

/* composer: one big outlined box */
.composer-wrap { flex: none; }
.composer-bits:empty { display: none; }
.composer-bits { display: grid; gap: 6px; padding: 0 2px 6px; }
.replying { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mist); }
.replying > span:nth-child(2) { flex: 1; }
.replying b { color: var(--text); }
.pending { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-file, .pending .chip { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 6px; border-radius: var(--r-s); background: var(--panel); border: 1px solid var(--line-2); font-size: 13px; max-width: 240px; animation: rise .2s var(--ease); }
.pending .chip > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pending .chip img { width: 28px; height: 28px; border-radius: 5px; object-fit: cover; }
.pending .chip.busy { opacity: .6; }
.composer { display: flex; align-items: flex-end; gap: 2px; min-height: 64px; padding: 14px 8px 14px 8px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line-2); transition: border-color .15s; }
.composer:focus-within { border-color: var(--mist); }
.composer textarea { flex: 1; background: none !important; border: 0 !important; padding: 5px 6px; max-height: 280px; min-height: 32px; }
.composer .icon-btn { margin-bottom: 1px; }
.composer .send { color: var(--gold); }
.typing { height: 20px; display: flex; align-items: center; gap: 8px; padding: 0 4px; font-size: 12px; color: var(--mist); }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 4px; height: 4px; border-radius: 1px; }

/* right panel: members or the other person's profile */
.members { overflow-y: auto; padding: 8px; }
.mem-group + .mem-group { margin-top: 14px; }
.mem-label { padding: 4px 8px 6px; font-size: 12px; color: var(--dim); }
.mem-label span { font-family: var(--f-mono); }
.mem { display: flex; align-items: center; gap: 10px; width: 100%; padding: 5px 8px; border-radius: 6px; }
.mem:hover { background: var(--raised); }
.mem.off { opacity: .45; }
.mem.off:hover { opacity: 1; }
.mem-text { display: grid; min-width: 0; flex: 1; }
.mem-text .name { font-size: 14px; font-weight: 500; overflow: hidden; }
.mem-sub { font-size: 12px; color: var(--mist); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner { color: var(--gold); }

.profile { width: 300px; position: relative; }
.profile.in-panel { width: auto; }
.pf-banner { width: 100%; height: 96px; object-fit: cover; border-radius: var(--r-s) var(--r-s) 0 0; }
.pf-banner.tinted { background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 25%, var(--panel))); }
.in-panel .pf-banner { border-radius: 6px; }
.pf-body { padding: 14px; display: grid; gap: 2px; justify-items: start; }
.in-panel .pf-body { padding: 12px 8px; }
.has-banner .pf-av { margin-top: -48px; }
.pf-av { margin-bottom: 10px; }
.pf-av .av { box-shadow: 0 0 0 4px var(--panel); }
.pf-av .pres { border-color: var(--panel); border-width: 3px; }
.pf-name { font: 500 24px/1.15 var(--f-display); }
.pf-name .name { font-weight: 500; }
.pf-handle { font: 600 13px var(--f-mono); color: var(--mist); }
.pf-status { margin: 6px 0 0; font-size: 14px; }
.pf-bio { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); width: 100%; font-size: 14px; overflow-wrap: anywhere; }
.pf-facts { display: grid; gap: 4px; justify-items: start; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); width: 100%; font-size: 14px; }
.pf-facts .chip.mono { margin-top: 4px; }
.pf-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

/* ---------- call stage ---------- */
.stage { position: relative; display: flex; flex-direction: column; min-height: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.stage.full { flex: 1; }
.stage.split { height: min(48vh, 460px); flex: none; }
.stage-grid { flex: 1; min-height: 0; padding: 10px; display: grid; gap: 8px; align-content: center; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.stage-grid.focused { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); align-content: stretch; }
.stage-grid.focused .tile:not(.focus) { display: none; }
.tile {
  position: relative; width: 100%; aspect-ratio: 16 / 10; max-height: 100%; border-radius: var(--r-s); overflow: hidden; cursor: pointer; /* fills its column, so two tiles don't leave a gap */
  background: var(--bg); border: 1px solid var(--line); display: grid; place-items: center; animation: tile-in .3s var(--ease); transition: border-color .15s;
}
@keyframes tile-in { from { opacity: 0; transform: scale(.97); } }
.stage-grid.focused .tile.focus { aspect-ratio: auto; height: 100%; cursor: zoom-out; }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.tile.screen video { object-fit: contain; background: #000; }
.tile.mirror video { transform: scaleX(-1); }
.tile.has-video video { opacity: 1; }
.tile.has-video .tile-face { visibility: hidden; }
.tile-face .av { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px transparent; transition: box-shadow .2s var(--ease); }
.tile.speaking:not(.screen) { border-color: var(--online); }
.tile.speaking:not(.screen) .tile-face .av { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--online); }
.tile-label {
  position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); display: flex; align-items: center; gap: 6px;
  padding: 3px 8px 3px 3px; border-radius: 6px; font-size: 13px; font-weight: 500; background: #000000a0; backdrop-filter: blur(6px);
}
.tile-label > span:not(.ic) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-label > .ic { color: var(--dnd); }
.trust { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; }
.trust.ok { color: var(--mist); }
.trust.good { color: var(--online); }
.trust.warn { color: var(--idle); }
.trust.bad { color: var(--dnd); }
.trust.wait { color: var(--dim); animation: blink 1.2s infinite; }
.stage-bar { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 0 10px 10px; }
.e2ee { justify-self: start; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--online); padding: 6px 8px; border-radius: 6px; }
.e2ee:hover { background: var(--raised); }
.stage-controls { display: flex; gap: 6px; }
.stage-controls .icon-btn { width: 44px; height: 44px; border-radius: var(--r-s); background: var(--raised); border: 1px solid var(--line-2); color: var(--text); }
.stage-controls .icon-btn:hover { border-color: var(--edge); }
.stage-controls .icon-btn.off { color: var(--dnd); }
.stage-controls .icon-btn.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.stage-controls .icon-btn.danger { background: var(--dnd); color: #2a0b06; border-color: var(--dnd); }
.stage-quality { justify-self: end; font: 11px var(--f-mono); color: var(--dim); }

/* ---------- overlays ---------- */
.tip {
  position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; max-width: 260px; padding: 5px 9px; border-radius: 6px;
  background: var(--raised); border: 1px solid var(--line-2); font-size: 13px; opacity: 0; transition: opacity .12s;
}
.tip.show { opacity: 1; }
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 90; display: grid; gap: 6px; justify-items: center; width: min(460px, calc(100% - 32px)); }
.toast { display: flex; align-items: center; gap: 14px; padding: 9px 14px; border-radius: var(--r-s); font-size: 14px; background: var(--raised); border: 1px solid var(--edge); box-shadow: 0 16px 40px -12px #000; animation: toast-in .3s var(--spring); }
.toast.out { opacity: 0; transform: translateY(8px); transition: .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }

.pop { position: fixed; z-index: 60; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line-2); overflow: hidden; box-shadow: 0 24px 60px -16px #000; animation: pop-in .16s var(--ease); }
@keyframes pop-in { from { opacity: 0; transform: scale(.97) translateY(4px); } }
.menu { display: grid; padding: 5px; min-width: 220px; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; font-size: 14px; }
.menu-item:hover, .menu-item.on { background: var(--raised); }
.menu-item.danger { color: var(--dnd); }
.menu-item small { display: block; font-size: 12px; color: var(--mist); }
.menu-item b { font-weight: 500; }
.menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.menu-field { padding: 4px; }

.emoji-pop { width: 340px; }
.emoji-grid { max-height: 320px; overflow-y: auto; padding: 8px; }
.emoji-label { position: sticky; top: -8px; padding: 8px 4px 4px; font-size: 12px; color: var(--dim); background: var(--panel); }
.emoji-set { display: grid; grid-template-columns: repeat(8, 1fr); }
.emoji { aspect-ratio: 1; border-radius: 6px; font-size: 22px; display: grid; place-items: center; transition: transform .15s var(--spring); }
.emoji:hover { background: var(--hover); transform: scale(1.12); }

.backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: #000000b0; animation: fade-in .16s; }
.backdrop.out { opacity: 0; transition: opacity .16s; }
.modal { width: min(480px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line-2); animation: modal-in .24s var(--spring); }
.backdrop.out .modal { transform: scale(.98); transition: transform .16s; }
@keyframes modal-in { from { opacity: 0; transform: scale(.96) translateY(6px); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 10px 2px 18px; }
.modal-head h2 { font-size: 22px; }
.modal-body { padding: 10px 18px 18px; overflow-y: auto; }
.modal-body > p:first-child { margin-top: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 6px; padding: 0 18px 18px; }
.modal-body .stack > p { margin: 0; }

.choices { display: grid; gap: 6px; }
.choice { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-s); background: var(--bg); cursor: pointer; border: 1px solid var(--line-2); }
.choice:has(input:checked) { border-color: var(--edge); }
.choice input { accent-color: var(--gold); }
.choice .ic { color: var(--mist); }
.choice span { display: grid; }
.choice small { color: var(--mist); font-size: 12px; }
.copy-row { display: flex; gap: 6px; }
.copy-row .btn { white-space: nowrap; }
.copy-row input { font: 13px var(--f-mono); }
.invite-card { display: flex; align-items: center; gap: 14px; }
/* an invite link in a message */
.invite-embed { display: flex; align-items: center; gap: 12px; max-width: 420px; margin-top: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.invite-embed:empty { display: none; }
.invite-embed > div { flex: 1; min-width: 0; }
.invite-embed b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-embed p { margin: 0; }
.inv-icon.small { width: 44px; height: 44px; font-size: 14px; flex: none; }
.invite-card h3 { font-size: 22px; }
.invite-card p { margin: 0; }
.inv-icon { width: 60px; height: 60px; border-radius: 22%; object-fit: cover; display: grid; place-items: center; background: var(--raised); font: 600 18px var(--f-display); }
.icon-row { display: flex; align-items: center; gap: 14px; }
.icon-preview { width: 68px; height: 68px; border-radius: 22%; overflow: hidden; display: grid; place-items: center; background: var(--raised); font: 600 20px var(--f-display); }
.icon-preview img { width: 100%; height: 100%; object-fit: cover; }

.lightbox { width: auto; max-width: min(1100px, 100%); background: transparent; border: 0; }
.lightbox .modal-body { padding: 0; display: grid; place-items: center; }
.lightbox img { max-width: 100%; max-height: calc(100dvh - 120px); border-radius: var(--r-s); cursor: zoom-out; }
.lightbox .modal-foot { padding: 10px 0 0; }

.notice { display: grid; gap: 10px; padding: 12px; border-radius: var(--r-s); background: var(--bg); border: 1px solid var(--line-2); margin: 0 0 12px; }
.notice p { margin: 0; }
.notice.warn { display: flex; gap: 10px; align-items: flex-start; color: var(--idle); border-color: #facc1555; }

/* safety code: the constellation both people compare */
.sky-card {
  display: grid; place-items: center; padding: 14px; border-radius: var(--r-s); border: 1px solid var(--line-2);
  background-image: linear-gradient(to right, #eeeeee0d 1px, transparent 1px), linear-gradient(to bottom, #eeeeee0d 1px, transparent 1px), linear-gradient(to top, #0d0e15, #262a4d);
  background-size: 20px 20px, 20px 20px, cover;
}
.sky-card.small { padding: 8px; }
.constellation { max-width: 100%; height: auto; overflow: visible; }
.constellation .lines line { stroke: #eeeeee77; stroke-width: 1; stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw 1.6s var(--ease) .2s forwards; }
.constellation .stars circle { fill: var(--text); }
.constellation .stars circle.glow { fill: var(--gold); opacity: .16; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.digits { display: grid; grid-template-columns: repeat(3, auto); justify-content: center; gap: 6px 18px; margin: 14px 0 6px; font: 500 18px var(--f-mono); letter-spacing: .06em; }
.digits.small { font-size: 14px; margin: 6px 0 0; justify-content: start; }
.safety-modal .modal-body > p:last-child { text-align: center; margin-bottom: 0; }
.peer-list { display: grid; gap: 8px; margin-top: 14px; }
.peer { display: flex; align-items: center; gap: 12px; }
.peer-text { flex: 1; display: grid; }
.peer-text .st { font-size: 12px; }
.st.good { color: var(--online); } .st.ok { color: var(--mist); } .st.warn { color: var(--idle); } .st.bad { color: var(--dnd); } .st.wait { color: var(--dim); }
.key-box { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: var(--r-s); background: var(--bg); border: 1px solid var(--line); margin: 10px 0; }

/* settings */
.settings { width: min(900px, 100%); height: min(640px, calc(100dvh - 32px)); }
.settings .modal-body { flex: 1; padding: 0; display: flex; min-height: 0; }
.settings-wrap { display: grid; grid-template-columns: 210px 1fr; width: 100%; min-height: 0; }
.settings-nav { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-right: 1px solid var(--line); overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; font-size: 14px; color: var(--mist); border: 1px solid transparent; }
.nav-item:hover { background: var(--raised); color: var(--text); }
.nav-item.on { background: var(--raised); color: var(--text); border-color: var(--line-2); }
.nav-item[data-tab=plus] .ic { color: var(--gold); }
.nav-item[data-tab=plus] svg { fill: var(--gold); }
.nav-item.danger { color: var(--dnd); }
.settings-content { overflow-y: auto; padding: 6px 22px 22px; min-height: 0; }
.tab { display: grid; gap: 12px; align-content: start; animation: fade-in .2s; }
.tab > p { margin: 0; max-width: 64ch; }
.tab-title { margin: 8px 0 2px; font-size: 24px; }
.profile-edit { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
.pf-preview { position: sticky; top: 0; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line-2); background: var(--panel); }
.plus-note { display: inline-flex; align-items: center; gap: 4px; font: 700 10px var(--f-mono); color: var(--gold); }
.plus-note svg { fill: var(--gold); }
input.color { width: 44px; height: 32px; padding: 0; border: 0; background: none; border-radius: 6px; cursor: pointer; }

.plus-hero { display: flex; gap: 16px; align-items: center; padding: 18px; }
.plus-hero p { margin: 4px 0 0; color: var(--mist); max-width: 46ch; }
.plus-hero .display { font-size: 30px; }
.plus-orb { width: 56px; height: 56px; flex: none; border-radius: 22%; display: grid; place-items: center; background: var(--gold); }
.plus-orb svg { fill: var(--gold-ink); stroke: var(--gold-ink); }
.compare { width: 100%; border-collapse: collapse; font-size: 14px; }
.compare th, .compare td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
.compare thead th { font-size: 12px; color: var(--dim); font-weight: 500; }
.compare tbody th { font-weight: 500; }
.compare td { color: var(--mist); }
.compare td.hi { color: var(--gold); font-weight: 600; }
.plus-tab > .btn { justify-self: start; }

.bot-list { display: grid; gap: 6px; }
.bot { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-s); background: var(--bg); border: 1px solid var(--line); flex-wrap: wrap; }
.bot-text { display: grid; flex: 1; min-width: 140px; }
.bot-text span { font: 12px var(--f-mono); }
.bot-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.create-bot { flex-wrap: nowrap; }
.create-bot input { max-width: 260px; }
.token-box:empty { display: none; }
.quickstart summary { cursor: pointer; font-weight: 500; color: var(--mist); }
.quickstart pre { margin: 10px 0 6px; padding: 10px 12px; border-radius: var(--r-s); background: var(--bg); border: 1px solid var(--line); overflow-x: auto; font: 13px var(--f-mono); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px; border-radius: var(--r-s); background: var(--bg); border: 1px solid var(--line); cursor: pointer; }
.toggle span { display: grid; }
.toggle small { color: var(--mist); font-size: 13px; }
.toggle input { order: 2; width: 18px; height: 18px; accent-color: var(--gold); }

.offline-bar {
  position: fixed; top: 0; left: 50%; transform: translate(-50%, -100%); z-index: 95; padding: 5px 12px; border-radius: 0 0 6px 6px;
  background: var(--idle); color: #2b2200; font: 600 12px var(--f-mono); transition: transform .3s var(--ease), visibility .3s; visibility: hidden;
}
body.offline .offline-bar { transform: translate(-50%, 0); visibility: visible; }
.scrim { display: none; }

/* ---------- smaller screens ---------- */
@media (max-width: 1180px) {
  body.with-members .app { grid-template-columns: var(--nav) minmax(0, 1fr); }
  .members { position: fixed; right: var(--gap); top: calc(var(--gap) + 52px); bottom: var(--gap); width: 280px; z-index: 20; box-shadow: -20px 0 40px -20px #000; animation: slide-l .25s var(--ease); }
}
@keyframes slide-l { from { transform: translateX(20px); opacity: 0; } }
@media (max-width: 780px) {
  .app, body.with-members .app { grid-template-columns: minmax(0, 1fr); }
  .nav { position: fixed; top: 0; left: 0; bottom: 0; width: min(var(--nav), calc(100vw - 48px)); padding: var(--gap); background: var(--bg); z-index: 30; transform: translateX(-100%); transition: transform .28s var(--ease); }
  body.nav-open .nav { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: #000a; opacity: 0; pointer-events: none; transition: opacity .25s; }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .nav-toggle { display: inline-grid; margin-left: -8px; }
  .head-topic { display: none; }
  .msg { padding-right: 12px; padding-left: 8px; }
  .tools { right: 6px; }
  .settings-wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .settings-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .settings-nav .menu-sep { display: none; }
  .nav-item { white-space: nowrap; }
  .settings-content { padding: 6px 14px 18px; }
  .profile-edit { grid-template-columns: 1fr; }
  .pf-preview { position: static; order: -1; }
  .stage-bar { grid-template-columns: 1fr; justify-items: center; }
  .stage-quality { display: none; }
  .stage-controls .icon-btn { width: 40px; height: 40px; }
  .emoji-pop { width: min(340px, calc(100vw - 16px)); }
  .profile:not(.in-panel) { width: min(300px, calc(100vw - 16px)); }
  .members { left: var(--gap); width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
  .constellation .lines line { stroke-dashoffset: 0; }
}
#voicebar:empty { display: none; }
@media (min-width: 781px) { .chan-head.bare { display: none; } }
.composer textarea:focus-visible { outline: none; }

/* ---------- Nyx+ avatar decorations (colors follow the profile theme) ---------- */
@property --ang { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.av.deco::before, .av.deco::after { content: ''; position: absolute; pointer-events: none; }
.deco-orbit::before { inset: -4px; border-radius: 30%; border: 1.5px solid color-mix(in srgb, var(--c1, var(--gold)) 50%, transparent); }
.deco-orbit::after { inset: -10px; border-radius: 50%; background: radial-gradient(circle at 50% 3px, var(--c1, var(--gold)) 0 3px, transparent 4px); animation: spin 7s linear infinite; }
.deco-eclipse::before { inset: -3px; border-radius: 28%; box-shadow: 0 0 0 2px var(--c1, var(--gold)), 0 0 16px 1px var(--c1, var(--gold)); animation: breathe 3.2s ease-in-out infinite; }
.deco-eclipse::after { width: 42%; height: 42%; top: -18%; right: -18%; border-radius: 50%; box-shadow: inset .32em -.18em 0 0 var(--c2, var(--c1, var(--gold))); filter: drop-shadow(0 0 4px var(--c2, var(--c1, var(--gold)))); }
.deco-aurora::before { inset: -4px; border-radius: 30%; padding: 3px; background: conic-gradient(from var(--ang), var(--c1, #7fd3bd), var(--c2, #a99cff), var(--c1, #7fd3bd)); mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); animation: ang 4s linear infinite; }
.deco-aurora::after { inset: -4px; border-radius: 30%; box-shadow: 0 0 14px color-mix(in srgb, var(--c1, #7fd3bd) 60%, transparent); }
.deco-stardust::before, .deco-stardust::after { inset: -11px; background:
  radial-gradient(circle at 8% 22%, #fff 0 1.3px, transparent 2.2px), radial-gradient(circle at 88% 12%, var(--c1, var(--gold)) 0 1.7px, transparent 2.8px),
  radial-gradient(circle at 94% 78%, #fff 0 1.1px, transparent 2px), radial-gradient(circle at 12% 90%, var(--c2, var(--c1, var(--gold))) 0 1.5px, transparent 2.6px); animation: twinkle 2.2s ease-in-out infinite alternate; }
.deco-stardust::after { background: radial-gradient(circle at 50% 2%, #fff 0 1.2px, transparent 2.2px), radial-gradient(circle at 2% 55%, var(--c1, var(--gold)) 0 1.3px, transparent 2.3px),
  radial-gradient(circle at 98% 45%, #fff 0 1.3px, transparent 2.3px), radial-gradient(circle at 60% 99%, var(--c2, var(--c1, var(--gold))) 0 1.2px, transparent 2.2px); animation-delay: -1.1s; }
.deco-halo::after { width: 70%; height: 16%; left: 15%; top: -17%; border-radius: 50%; border: 2px solid var(--c1, var(--gold)); box-shadow: 0 0 10px var(--c1, var(--gold)), inset 0 0 6px var(--c1, var(--gold)); animation: bob 3s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ang { to { --ang: 360deg; } }
@keyframes breathe { 50% { opacity: .55; } }
@keyframes twinkle { from { opacity: .25; } to { opacity: 1; } }
@keyframes bob { 50% { transform: translateY(-3px); } }

/* ---------- Nyx+ name styles and fonts ---------- */
.ns-gradient .nm, .ns-shimmer .nm { -webkit-background-clip: text; background-clip: text; color: transparent; }
.ns-gradient .nm { background-image: linear-gradient(90deg, var(--c1, var(--gold)), var(--c2, #fff)); }
.ns-shimmer .nm { background-image: linear-gradient(90deg, var(--c1, var(--gold)) 0%, #fff 25%, var(--c2, var(--c1, var(--gold))) 50%, #fff 75%, var(--c1, var(--gold)) 100%); background-size: 200% auto; animation: shimmer 3s linear infinite; }
.ns-glow .nm { color: var(--c1, var(--gold)); text-shadow: 0 0 10px color-mix(in srgb, var(--c1, var(--gold)) 70%, transparent); }
@keyframes shimmer { to { background-position: -200% center; } }
.nf-display .nm { font-family: var(--f-display); font-weight: 600; letter-spacing: -.01em; }
.nf-mono .nm { font-family: var(--f-mono); font-weight: 600; font-size: .94em; letter-spacing: -.03em; }
.nf-serif .nm { font-family: 'Fraunces', Georgia, serif; font-weight: 600; letter-spacing: -.005em; }
/* gradient text gets a hair of room so descenders aren't clipped */
.ns-gradient .nm, .ns-shimmer .nm { padding-bottom: .06em; margin-bottom: -.06em; }
.pf-name, .me-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pf-name .nm, .me-name .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-name .plus-star svg { width: 14px; height: 14px; }

/* ---------- Nyx+ profile themes and effects ---------- */
.profile { overflow: hidden; border-radius: inherit; }
.profile.in-panel { border-radius: 8px; }
.profile.themed {
  padding: 6px; background: linear-gradient(160deg, color-mix(in srgb, var(--c1, var(--gold)) 70%, #0b0b0f), color-mix(in srgb, var(--c2, var(--c1, var(--gold))) 70%, #0b0b0f));
}
.profile.themed .pf-banner { border-radius: 6px 6px 0 0; }
.profile.themed .pf-body { background: #0e0e12e6; border-radius: 6px; }
.profile.themed:not(.has-banner) .pf-body { margin-top: 44px; padding-top: 0; }
.profile.themed:not(.has-banner) .pf-av { margin-top: -38px; }
.profile.themed.has-banner .pf-body { border-radius: 0 0 6px 6px; }
.profile.themed .pf-av .av { box-shadow: 0 0 0 4px #0e0e12; }
.profile.themed .pf-av .pres { border-color: #0e0e12; }
.profile.themed .pf-bio, .profile.themed .pf-facts { border-color: #ffffff17; }
.pf-body, .pf-banner { position: relative; z-index: 1; }
.plus-chip { display: inline-flex; align-items: center; gap: 4px; color: var(--gold); }
.plus-chip svg { fill: var(--gold); }
.fx { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 2; }
.fx i { position: absolute; left: var(--x); top: var(--y); }
.fx-starfall i { top: -60px; width: 1.5px; height: 46px; background: linear-gradient(transparent, #fff); border-radius: 2px; transform: rotate(25deg); animation: fall-streak var(--d) linear var(--t) infinite; opacity: .35; }
.fx-starfall i:nth-child(3n) { background: linear-gradient(transparent, var(--c1, var(--gold))); }
.fx-fireflies i { width: var(--s); height: var(--s); border-radius: 50%; background: var(--c1, var(--gold)); box-shadow: 0 0 8px 2px var(--c1, var(--gold)); animation: drift var(--d) ease-in-out var(--t) infinite alternate; }
.fx-aurora i { left: -20%; width: 140%; height: 70px; top: calc(var(--y) * .5); background: linear-gradient(90deg, transparent, var(--c1, #7fd3bd), var(--c2, #a99cff), transparent); filter: blur(22px); opacity: .5; animation: sway var(--d) ease-in-out var(--t) infinite alternate; }
.fx-snow i { top: -10px; width: var(--s); height: var(--s); border-radius: 50%; background: #fff; opacity: .85; animation: snow var(--d) linear var(--t) infinite; }
@keyframes fall-streak { to { transform: translate(-180px, 640px) rotate(25deg); } }
@keyframes drift { 0% { transform: translate(0, 0); opacity: .2; } 50% { opacity: 1; } 100% { transform: translate(18px, -26px); opacity: .3; } }
@keyframes sway { from { transform: translateX(-12%) skewX(-8deg); } to { transform: translateX(12%) skewX(8deg); } }
@keyframes snow { 0% { transform: translate(0, 0); } 50% { transform: translate(12px, 320px); } 100% { transform: translate(-6px, 660px); } }

/* ---------- Nyx+ app themes ---------- */
body[data-theme=ember] { --bg: #16100c; --panel: #1c140e; --raised: #251b13; --hover: #2c2017; --line: #2f241a; --line-2: #463628; --gold: #f0a868; --gold-2: #ffd2a8; --gold-ink: #2e1606; }
body[data-theme=indigo] { --bg: #0f1020; --panel: #14152a; --raised: #1b1c36; --hover: #21233f; --line: #25274a; --line-2: #383b66; --gold: #a99cff; --gold-2: #d9d2ff; --gold-ink: #17123a; }
body[data-theme=forest] { --bg: #0d1310; --panel: #121a15; --raised: #18231c; --hover: #1d2a21; --line: #203026; --line-2: #30463a; --gold: #7fd3a0; --gold-2: #c4f0d4; --gold-ink: #0b2516; }
body[data-theme=rose] { --bg: #150e12; --panel: #1b1218; --raised: #24171f; --hover: #2b1c25; --line: #301f2a; --line-2: #47303f; --gold: #f4a6c0; --gold-2: #ffd7e4; --gold-ink: #3a1020; }

/* Gradient themes: the gradient sits behind the whole app and the panels turn into tinted glass over it.
   Things that float over content (menus, dialogs, toasts) stay solid so text never sits on a busy background. */
body:is([data-theme=dusk], [data-theme=aurora], [data-theme=nebula], [data-theme=tide], [data-theme=sunrise], [data-theme=blossom]) {
  --bg: #00000047; --panel: #0000003d; --raised: #ffffff10; --hover: #ffffff17; --line: #ffffff14; --line-2: #ffffff26;
  background: var(--grad) fixed;
}
body:is([data-theme=dusk], [data-theme=aurora], [data-theme=nebula], [data-theme=tide], [data-theme=sunrise], [data-theme=blossom])
  :is(.modal, .pop, .toast, .tip, .emoji-label, .pf-preview, .cmd-pop, .tools, .incoming) { background: var(--solid); }
/* things that slide over the chat on smaller screens need a solid color too, or the messages show through */
@media (max-width: 1180px) {
  body:is([data-theme=dusk], [data-theme=aurora], [data-theme=nebula], [data-theme=tide], [data-theme=sunrise], [data-theme=blossom]) .members { background: var(--solid); }
}
@media (max-width: 780px) {
  body:is([data-theme=dusk], [data-theme=aurora], [data-theme=nebula], [data-theme=tide], [data-theme=sunrise], [data-theme=blossom]) .nav { background: var(--solid); }
}
body[data-theme=dusk] { --grad: linear-gradient(160deg, #2b1a4a 0%, #5b2449 55%, #7a3a2c 100%); --solid: #24142c; --gold: #ffb38a; --gold-2: #ffe0cc; --gold-ink: #3a1608; }
body[data-theme=aurora] { --grad: linear-gradient(160deg, #06252b 0%, #0f3d36 45%, #1c2456 100%); --solid: #0b2226; --gold: #7ff0c8; --gold-2: #ccfbe9; --gold-ink: #06281c; }
body[data-theme=nebula] { --grad: linear-gradient(150deg, #1d0f3d 0%, #3b1a6b 50%, #0f2a5c 100%); --solid: #1a1236; --gold: #c9a8ff; --gold-2: #ebdeff; --gold-ink: #1e0f40; }
body[data-theme=tide] { --grad: linear-gradient(170deg, #071a33 0%, #0b3a5a 55%, #0f5a63 100%); --solid: #0a1e30; --gold: #8fd8ff; --gold-2: #d4f0ff; --gold-ink: #062238; }
body[data-theme=sunrise] { --grad: linear-gradient(165deg, #3a1508 0%, #6b2d12 50%, #5a1a3a 100%); --solid: #2c140c; --gold: #ffc46b; --gold-2: #ffe8c2; --gold-ink: #3a1e02; }
body[data-theme=blossom] { --grad: linear-gradient(155deg, #3a1230 0%, #4a1f4f 50%, #2a2350 100%); --solid: #2a1228; --gold: #ffa8d2; --gold-2: #ffe0ef; --gold-ink: #3a0c24; }

/* ---------- settings: perk pickers ---------- */
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { display: grid; justify-items: center; gap: 6px; min-width: 72px; padding: 10px 8px 8px; border-radius: var(--r-s); background: var(--bg); border: 1px solid var(--line-2); font-size: 12px; color: var(--mist); transition: border-color .12s, color .12s; }
.opt:hover:not(:disabled) { border-color: var(--mist); color: var(--text); }
.opt.on { border-color: var(--edge); color: var(--text); background: var(--raised); }
.opt:disabled { opacity: .75; cursor: not-allowed; }
.opt .av { margin: 6px; }
.fx-thumb { position: relative; width: 56px; height: 40px; border-radius: 6px; overflow: hidden; background: var(--raised); --y: 50%; }
.fx-thumb .fx-starfall i { height: 18px; }
.font-thumb { font-size: 20px; line-height: 1.6; color: var(--text); }
.font-thumb.nf-display { font-family: var(--f-display); }
.font-thumb.nf-mono { font-family: var(--f-mono); }
.font-thumb.nf-serif { font-family: 'Fraunces', serif; font-weight: 600; }
.font-thumb.nf-display, .font-thumb.nf-mono { font-weight: 600; }
.theme-thumb { display: flex; gap: 3px; width: 64px; height: 40px; padding: 5px; border-radius: 6px; border: 1px solid #ffffff22; }
.theme-thumb i { flex: 1; border-radius: 3px; background: #ffffff10; }
.theme-thumb i:last-child { background: var(--a); }
.plus-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; }
.plus-cta p { font-size: 13px; }
.plus-cta .btn { flex: none; white-space: nowrap; }
.settings-section { display: grid; gap: 10px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.settings-section h3 { font-size: 18px; }
.settings-section p { margin: 0; }
.space-settings { width: min(560px, 100%); }
.emoji-manage { display: grid; gap: 4px; max-height: 240px; overflow-y: auto; }
.em-row { display: flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 6px; }
.em-row:hover { background: var(--raised); }
.em-row img { width: 28px; height: 28px; object-fit: contain; }
.em-row code { flex: 1; font: 13px var(--f-mono); }
.emoji-add input { max-width: 220px; }
.sound-list { display: grid; gap: 6px; }
.sound-list .row { flex-wrap: nowrap; }
input.range { width: 180px; accent-color: var(--gold); }

/* ---------- custom emoji ---------- */
.cemoji { display: inline-block; width: 1.4em; height: 1.4em; object-fit: contain; vertical-align: -.35em; }
.content.big .cemoji { width: 48px; height: 48px; vertical-align: middle; }
.reaction .cemoji { width: 18px; height: 18px; vertical-align: middle; }
.emoji img { width: 28px; height: 28px; object-fit: contain; }
.emoji.locked { opacity: .35; }

/* ---------- incoming call ---------- */
.incoming {
  position: fixed; right: 16px; bottom: 16px; z-index: 70; width: min(320px, calc(100vw - 32px)); display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px 14px;
  padding: 14px; border-radius: var(--r); background: var(--panel); border: 1px solid color-mix(in srgb, var(--online) 50%, transparent); box-shadow: 0 24px 60px -16px #000;
  animation: rise .3s var(--spring);
}
.incoming.out { opacity: 0; transform: translateY(8px); transition: .2s; }
.incoming-av .av { animation: calling 1.4s ease-out infinite; }
@keyframes calling { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--online) 60%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
.incoming-text { display: grid; }
.incoming-text .name { font-size: 17px; }
.incoming-text > span { font-size: 13px; color: var(--mist); }
.incoming-actions { grid-column: 1 / -1; display: flex; gap: 6px; }
.incoming-actions .btn { flex: 1; }

/* ---------- friends ---------- */
.nav-top { display: grid; gap: var(--gap); }
.nav-row { display: flex; gap: var(--gap); }
.nav-btn .badge { margin-left: auto; }
.friends { flex: 1; display: flex; flex-direction: column; gap: var(--gap); min-height: 0; }
.tabs { display: flex; gap: 4px; margin-left: 12px; }
.tab-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 6px; font-size: 14px; color: var(--mist); border: 1px solid transparent; }
.tab-btn:hover { background: var(--raised); color: var(--text); }
.tab-btn.on { background: var(--raised); color: var(--text); border-color: var(--line-2); }
.add-friend { display: grid; gap: 10px; padding: 14px; }
.add-friend h3 { font-size: 18px; }
.add-friend p { margin: 2px 0 0; }
.add-friend .row { flex-wrap: nowrap; }
.add-friend input { max-width: 360px; }
.friend-list { flex: 1; overflow-y: auto; display: grid; align-content: start; gap: 2px; padding: 0 4px; }
.friend-empty { padding: 24px 8px; }
.friend { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--r-s); border-top: 1px solid var(--line); }
.friend:hover { background: var(--panel); }
.friend-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.friend-text { display: grid; min-width: 0; }
.friend-text small { color: var(--mist); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-actions { display: flex; gap: 4px; }
.friend-actions .icon-btn { width: 36px; height: 36px; background: var(--raised); border: 1px solid var(--line-2); }
.blocked-msg { padding-top: 4px; padding-bottom: 4px; }
.blocked-line { display: flex; align-items: center; gap: 8px; margin-left: 52px; font-size: 13px; color: var(--dim); }
.mem.blocked { opacity: .35; }

/* ---------- roles ---------- */
.role-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.role-chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 6px; border-radius: 5px; background: var(--raised); border: 1px solid var(--line-2); font-size: 12px; }
.role-chip i { width: 8px; height: 8px; border-radius: 2px; background: var(--rc); }
.role-chip button { display: grid; place-items: center; color: var(--mist); }
.role-chip button:hover { color: var(--dnd); }
.role-chip.add { color: var(--mist); cursor: pointer; }
.role-chip.add:hover { color: var(--text); border-color: var(--mist); }
.role-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--mist); flex: none; }
.ch-lock { color: var(--dim); display: inline-grid; margin-left: auto; }
.roles-split { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: start; }
.role-list { display: grid; gap: 2px; position: sticky; top: 0; }
.role-list > .btn { margin-top: 8px; justify-self: start; }
.role-row { display: flex; align-items: center; gap: 2px; border-radius: 6px; border: 1px solid transparent; }
.role-row.on { background: var(--raised); border-color: var(--line-2); }
.role-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 7px 8px; font-size: 14px; }
.role-pick span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-edit { display: grid; gap: 12px; }
.perm-list { display: grid; gap: 4px; }
.perm-list .toggle { padding: 9px 12px; }
.toggle.locked { opacity: .5; }
.member-manage { display: grid; gap: 4px; }
.mm-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--r-s); border: 1px solid var(--line); }
.mm-text { flex: 1; min-width: 0; display: grid; }
.mm-text small { color: var(--mist); font-size: 12px; }
.mm-text .role-chips { margin-top: 4px; }
.channel-settings { width: min(720px, 100%); }
.channel-settings .modal-body > .settings-section:first-child { margin-top: 0; padding-top: 0; border: 0; }
.perm-grid { display: grid; gap: 2px; overflow-x: auto; }
.pg-row { display: grid; grid-template-columns: minmax(110px, 1.5fr) repeat(var(--cols), minmax(48px, 1fr)); align-items: center; gap: 4px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.pg-head { font-size: 12px; color: var(--dim); border: 0; }
.pg-head span:not(:first-child) { text-align: center; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-role { display: flex; align-items: center; gap: 8px; font-size: 14px; min-width: 0; }
.pg-cell { justify-self: center; display: grid; place-items: center; width: 32px; height: 28px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--dim); }
.pg-cell.allow { color: #0b2516; background: var(--online); border-color: var(--online); }
.pg-cell.deny { color: #2a0b06; background: var(--dnd); border-color: var(--dnd); }
.pg-cell:disabled { opacity: .35; }

/* ---------- slash commands ---------- */
.composer-wrap { position: relative; }
.cmd-pop {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 10; display: grid; gap: 1px; padding: 6px; max-height: 340px; overflow-y: auto;
  border-radius: var(--r); background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 -16px 40px -16px #000c; animation: pop-in .14s var(--ease);
}
.cmd-head { padding: 4px 8px 6px; font-size: 12px; color: var(--dim); }
.cmd-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 6px; }
.cmd-item.on, .cmd-item:hover { background: var(--raised); }
.cmd-src { width: 20px; height: 20px; display: grid; place-items: center; color: var(--gold); }
.cmd-text { flex: 1; min-width: 0; display: grid; }
.cmd-text b { font: 500 14px var(--f-mono); }
.cmd-sig { color: var(--dim); font-weight: 400; }
.cmd-text small { color: var(--mist); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-from { font-size: 12px; color: var(--dim); }
.cmd-usage { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; font: 13px var(--f-mono); }
.cmd-usage small { flex-basis: 100%; font: 12px var(--f-body); color: var(--mist); }
.cmd-opt { padding: 1px 6px; border-radius: 4px; border: 1px dashed var(--line-2); color: var(--mist); }
.cmd-opt.req { border-style: solid; }
.cmd-opt.on { border-color: var(--gold); color: var(--gold); }
.thinking { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mist); }
.ref.used { cursor: default; }
.ref.used code { font: 12px var(--f-mono); color: var(--text); }
.msg.ephemeral { background: color-mix(in srgb, var(--gold) 5%, transparent); }
.eph-note { display: flex; align-items: center; gap: 6px; margin: 4px 0 2px 52px; font-size: 12px; color: var(--dim); }
.composer.locked { align-items: center; gap: 10px; min-height: 56px; padding: 0 16px; color: var(--mist); font-size: 14px; }
.composer.locked .btn { margin-left: auto; }

/* ---------- keys and linking ---------- */
.key-banner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: var(--r-s); background: var(--panel); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); font-size: 13px; }
.key-banner .ic { color: var(--gold); }
.key-banner .btn { min-height: 28px; }
.link-modal { width: min(520px, 100%); }
.steps { margin: 12px 0; padding-left: 20px; display: grid; gap: 12px; }
.steps li { padding-left: 4px; }
.steps .sky-card, .steps .link-code { margin-top: 8px; }
.link-code { font: 600 28px var(--f-mono); letter-spacing: .12em; padding: 10px 14px; border-radius: var(--r-s); background: var(--bg); border: 1px solid var(--line-2); text-align: center; }
.link-wait { display: flex; align-items: center; gap: 10px; color: var(--mist); font-size: 14px; }
.code-input { max-width: 200px; font: 15px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; }
.link-box:empty { display: none; }
.tab section > h3, .settings-section h3 { font-size: 18px; }

@media (max-width: 780px) {
  .roles-split { grid-template-columns: 1fr; }
  .role-list { position: static; }
  .tabs { margin-left: 0; overflow-x: auto; }
  .add-friend .row { flex-wrap: wrap; }
}

/* ---------- unread and mention badges ---------- */
.badge.ping { background: var(--dnd); color: #2a0b06; }
.ch .badge.ping, .dm .badge.ping { margin-left: auto; min-width: 18px; font-size: 11px; line-height: 18px; padding: 0 5px; }
.ch.muted, .space-row.muted .space-name { opacity: .5; }
.ch.unread .badge.ping ~ *, .ch:has(.badge.ping)::after { display: none; }
.dm.unread:has(.badge.ping)::after { display: none; }
.new-line { display: flex; align-items: center; gap: 10px; margin: 10px 14px 4px; color: var(--dnd); font: 600 11px var(--f-mono); }
.new-line::before { content: ''; flex: 1; height: 1px; background: color-mix(in srgb, var(--dnd) 60%, transparent); }
.unread-bar, .present-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 8px 6px 12px; border-radius: var(--r-s); font-size: 13px; animation: rise .2s var(--ease); }
.unread-bar { background: color-mix(in srgb, var(--dnd) 16%, var(--panel)); border: 1px solid color-mix(in srgb, var(--dnd) 45%, transparent); }
.ub-jump { font-weight: 600; }
.ub-jump:hover { text-decoration: underline; }
.present-bar { background: var(--panel); border: 1px solid var(--line-2); color: var(--mist); }

/* ---------- mentions ---------- */
.mention.all { background: color-mix(in srgb, var(--gold) 13%, transparent); color: var(--gold); }
.mention.role { background: color-mix(in srgb, var(--rc) 18%, transparent); color: var(--rc); }

/* ---------- header tools ---------- */
.search-box { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line-2); color: var(--dim); margin-right: 4px; }
.search-box:focus-within { border-color: var(--mist); }
.head-search { border: 0 !important; background: none !important; padding: 0 !important; width: 150px; font-size: 13px; transition: width .2s var(--ease); }
.head-search:focus { width: 220px; }
.radio { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; }
.radio.on { border-color: var(--gold); box-shadow: inset 0 0 0 3px var(--panel); background: var(--gold); }

/* ---------- pins ---------- */
.pins { width: 380px; max-height: 460px; overflow-y: auto; padding: 8px; display: grid; gap: 6px; }
.pins-head { display: flex; justify-content: space-between; padding: 4px 6px; }
.pins-empty { padding: 6px; margin: 0; }
.pin { display: grid; gap: 6px; padding: 10px; border-radius: var(--r-s); background: var(--bg); border: 1px solid var(--line); }
.pin-meta, .result-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.pin-meta time, .result-meta time { color: var(--dim); font-size: 12px; margin-left: auto; }
.pin .content, .result .content { font-size: 14px; max-height: 120px; overflow: hidden; }

/* ---------- search ---------- */
.search-panel { display: grid; gap: 6px; align-content: start; }
.search-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 6px 8px; }
.result { display: grid; gap: 6px; padding: 10px; border-radius: var(--r-s); background: var(--bg); border: 1px solid var(--line); text-align: left; }
.result:hover { border-color: var(--line-2); }
.result mark { background: color-mix(in srgb, var(--gold) 30%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }
.search-panel > .btn { justify-self: center; }

/* ---------- edits ---------- */
button.edited { background: none; border: 0; padding: 0; font: inherit; font-size: 11px; color: var(--dim); cursor: pointer; margin-left: 4px; }
button.edited:hover { color: var(--text); text-decoration: underline; }
.versions { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.versions li { padding: 10px 12px; border-radius: var(--r-s); background: var(--bg); border: 1px solid var(--line); }
.versions li.current { border-color: var(--line-2); }
.v-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dim); margin-bottom: 4px; }
.msg.pinned .msg-meta::after { content: 'Pinned'; font: 10px var(--f-mono); color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); padding: 0 4px; border-radius: 3px; }

/* ---------- lists and tables in messages ---------- */
.content ul, .content ol { margin: 4px 0; padding-left: 22px; }
.content li { margin: 1px 0; }
.md-table { overflow-x: auto; margin: 6px 0; max-width: 760px; }
.md-table table { border-collapse: collapse; font-size: 14px; }
.md-table th, .md-table td { border: 1px solid var(--line-2); padding: 5px 10px; text-align: left; }
.md-table th { background: var(--panel); font-weight: 600; }

/* ---------- group DMs ---------- */
.group-av { position: relative; flex: none; display: inline-block; }
.group-av .av { position: absolute; box-shadow: 0 0 0 2px var(--panel); }
.group-av .av:first-child { left: 0; top: 0; }
.group-av .av:nth-child(2) { right: 0; bottom: 0; }
.group-av .av:only-child { inset: 0; margin: auto; }
.group-panel { display: grid; gap: 2px; }
.group-panel .mem { display: flex; align-items: center; gap: 4px; padding: 2px 4px 2px 0; }
.mem-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 3px 8px; border-radius: 6px; }
.mem-who:hover { background: var(--raised); }
.group-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 8px; }

/* ---------- threads ---------- */
.thread-rows { display: grid; padding: 0 0 4px 22px; position: relative; }
.thread-rows::before { content: ''; position: absolute; left: 16px; top: 0; bottom: 12px; width: 1px; background: var(--line-2); }
.thread-row { display: flex; align-items: center; height: 28px; padding: 0 8px; border-radius: 6px; font-size: 13px; color: var(--mist); position: relative; }
.thread-row::before { content: ''; position: absolute; left: -6px; width: 8px; height: 1px; background: var(--line-2); }
.thread-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-row:hover, .thread-row.active { background: var(--raised); color: var(--text); }
.thread-row.unread { color: var(--text); font-weight: 600; }
.thread-chip { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; padding: 6px 10px; border-radius: var(--r-s); background: var(--panel); border: 1px solid var(--line-2); font-size: 13px; color: var(--mist); }
.thread-chip b { color: var(--text); font-weight: 600; }
.thread-chip:hover { border-color: var(--mist); }
.tc-open { color: var(--link); }
.crumb { display: inline-flex; align-items: center; gap: 2px; padding: 3px 6px 3px 2px; border-radius: 6px; color: var(--mist); font-size: 14px; }
.crumb:hover { background: var(--raised); color: var(--text); }
.thread-quote { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-left: 3px solid var(--line-2); color: var(--mist); font-size: 14px; }

/* ---------- link previews and embeds ---------- */
.embeds { display: grid; gap: 6px; margin-top: 6px; max-width: 520px; }
.embed { display: grid; gap: 4px; padding: 10px 12px; border-radius: var(--r-s); background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--ec, var(--line-2)); }
.embed-site { font-size: 12px; color: var(--mist); }
.embed-title { font-weight: 600; color: var(--link); text-decoration: none; }
a.embed-title:hover { text-decoration: underline; }
.embed-desc { font-size: 14px; color: var(--mist); max-height: 7.5em; overflow: hidden; }
.embed-fields { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.embed-field { flex-basis: 100%; font-size: 14px; }
.embed-field.inline { flex-basis: 30%; }
.embed-field b { display: block; font-size: 13px; }
.embed-img { margin-top: 4px; border-radius: 6px; overflow: hidden; justify-self: start; }
.embed-img img { max-width: 100%; max-height: 260px; object-fit: cover; }

/* ---------- stickers ---------- */
.sticker { display: block; width: 160px; height: 160px; object-fit: contain; margin-top: 4px; }
.sticker-pop { width: 340px; max-height: 360px; overflow-y: auto; padding: 8px; }
.sticker-set { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.sticker-btn { aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center; padding: 6px; }
.sticker-btn:hover { background: var(--hover); }
.sticker-btn img { width: 100%; height: 100%; object-fit: contain; }
.sticker-btn.locked { opacity: .35; }
.sticker-empty { padding: 8px; margin: 0; }
.sticker-thumb { width: 40px; height: 40px; object-fit: contain; }

/* ---------- super reactions ---------- */
.reaction.super { border-color: color-mix(in srgb, var(--gold) 55%, transparent); background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 18%, var(--panel)), color-mix(in srgb, var(--c2, #a99cff) 14%, var(--panel))); box-shadow: 0 0 12px -4px var(--gold); }
.reaction.super span:first-child { animation: wobble 2.4s ease-in-out 3; display: inline-block; }
.reaction.super .count { color: var(--gold); }
@keyframes wobble { 0%, 80%, 100% { transform: none; } 85% { transform: scale(1.25) rotate(-8deg); } 92% { transform: scale(1.15) rotate(6deg); } }
.super-toggle { display: flex; align-items: center; gap: 6px; width: calc(100% - 16px); margin: 8px 8px 0; padding: 6px 10px; border-radius: 6px; border: 1px solid var(--line-2); font-size: 13px; color: var(--mist); }
.super-toggle.on { border-color: var(--gold); color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, transparent); }
.super-toggle .plus-note { margin-left: auto; }
.burst { position: fixed; z-index: 120; pointer-events: none; }
.burst i { position: absolute; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px var(--gold); animation: spark .8s var(--ease) forwards; }
.burst i:nth-child(3n) { background: #fff; }
.burst i:nth-child(3n+1) { background: var(--c2, #a99cff); }
@keyframes spark { from { transform: rotate(var(--a)) translateX(0) scale(1); opacity: 1; } to { transform: rotate(var(--a)) translateX(var(--d)) scale(.2); opacity: 0; } }

/* ---------- soundboard ---------- */
.board { width: 340px; max-height: 360px; overflow-y: auto; padding: 8px; }
.board-set { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 6px; }
.board-btn { display: flex; align-items: center; gap: 6px; padding: 8px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.board-btn:hover { border-color: var(--mist); }
.board-btn:active { transform: scale(.97); }
.board-btn.locked { opacity: .4; }
.tile.played { animation: played .9s var(--ease); }
@keyframes played { 0% { box-shadow: inset 0 0 0 3px var(--gold); } 100% { box-shadow: inset 0 0 0 0 transparent; } }

/* ---------- animated avatars that wait for hover ---------- */
.av.still img { visibility: hidden; }
.av.still canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; }
:is(.msg, .mem, .dm, .vc-user, .mem-who, .friend):hover .av.still img { visibility: visible; }
:is(.msg, .mem, .dm, .vc-user, .mem-who, .friend):hover .av.still canvas { display: none; }

/* ---------- bot components ---------- */
.components { display: grid; gap: 6px; margin-top: 8px; }
.comp-row { display: flex; flex-wrap: wrap; gap: 6px; }
.comp-btn { min-height: 32px; text-decoration: none; color: var(--text); }
.comp-btn.cs-primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.comp-btn.cs-success { background: var(--online); border-color: var(--online); color: #0b2516; }
.comp-btn.cs-danger { background: var(--dnd); border-color: var(--dnd); color: #2a0b06; }
.comp-btn.busy { opacity: .6; }
.comp-select { min-width: 220px; max-width: 100%; height: auto; min-height: 34px; }

/* ---------- webhooks ---------- */
.hook-list { display: grid; gap: 4px; }
.hook { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-s); background: var(--bg); border: 1px solid var(--line); }
.hook .ic { color: var(--mist); }
.hook-text { flex: 1; min-width: 0; display: grid; }
.hook-text code { font: 11px var(--f-mono); color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- audit log ---------- */
.audit-list { display: grid; gap: 2px; }
.audit-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px; border-bottom: 1px solid var(--line); }
.audit-row > .ic { width: 28px; height: 28px; color: var(--mist); }
.audit-text { display: grid; gap: 2px; font-size: 14px; }
.audit-text small { color: var(--dim); font-size: 12px; }
.tab > .btn { justify-self: start; }
.settings-section > .row > input { flex: 1; width: auto; min-width: 160px; }

/* ---------- account and security ---------- */
.auth-links { display: flex; justify-content: space-between; margin-top: -4px; }
.auth-links:not(:has(> :not([hidden]))) { display: none; }
.passkey-btn { justify-self: center; }
/* the server's own voices (Nyx, AutoMod): nobody else can get this badge */
.tag.official { display: inline-flex; align-items: center; gap: 3px; background: #5865f2; color: #fff; }
.tag.official svg { stroke: currentColor; }
.tag.good, .tag.warn { display: inline-flex; align-items: center; gap: 3px; background: none; border: 1px solid; }
.tag.good { color: var(--online); }
.tag.warn { color: var(--idle); }
.account-row { align-items: center; gap: 10px; }
.account-value { font-size: 15px; }
.account-list { display: grid; gap: 6px; }
.account-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-s); background: var(--bg); border: 1px solid var(--line); }
.account-item > .ic { color: var(--mist); }
.account-item.current { border-color: var(--line-2); }
.account-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.account-text b { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.totp-modal, .codes-modal { width: min(440px, 100%); }
.totp-qr { justify-self: center; padding: 10px; border-radius: var(--r-s); background: #fff; line-height: 0; }
.totp-qr svg { width: 180px; height: 180px; }
.totp-secret { font: 14px var(--f-mono); letter-spacing: .06em; user-select: all; }
.backup-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin: 0; padding: 12px 12px 12px 34px; border-radius: var(--r-s); background: var(--bg); border: 1px solid var(--line); font: 15px var(--f-mono); }
.theme-groups { display: grid; gap: 14px; }

/* ---------- server admin ---------- */
.invite-form { display: flex; flex-wrap: wrap; gap: 6px; }
.invite-form input { flex: 1; min-width: 180px; width: auto; }
.invite-form select { width: auto; }
.invite-code { font: 14px var(--f-mono); letter-spacing: .06em; user-select: all; }
.account-item.spent { opacity: .55; }
.settings-section > input[type=search] { max-width: 320px; }

/* ---------- phones ---------- */
/* iPhones zoom into any field with text under 16px, so touch screens get 16px fields */
@media (pointer: coarse) { input, textarea, select, .composer textarea { font-size: 16px; } }
/* no hover on touch screens: actions come from a long press instead (see messageSheet) */
@media (hover: none) {
  .tools { display: none; }
  .msg { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
  .msg:hover { background: none; }
  .msg.pressing { background: var(--raised); transition: background .3s; }
}
.sheet-body { display: grid; gap: 8px; }
.sheet-reacts { display: flex; justify-content: space-between; padding: 2px 4px 8px; border-bottom: 1px solid var(--line); }
.sheet-reacts .tool-emoji { font-size: 26px; width: 46px; height: 46px; border-radius: var(--r-s); }
.sheet-reacts .tool-emoji:active { background: var(--raised); }
.sheet .menu-item { min-height: 46px; font-size: 15px; }
.sheet .menu-item.danger { color: var(--dnd); }
.tabs { scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.pair { flex-wrap: wrap; }
.pair > .btn { white-space: nowrap; }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
@media (max-width: 780px) {
  /* keep clear of the notch and the home bar, most of all when installed to the home screen */
  .app { padding: max(var(--gap), env(safe-area-inset-top)) max(var(--gap), env(safe-area-inset-right)) max(var(--gap), env(safe-area-inset-bottom)) max(var(--gap), env(safe-area-inset-left)); }
  .nav { padding-top: max(var(--gap), env(safe-area-inset-top)); padding-bottom: max(var(--gap), env(safe-area-inset-bottom)); padding-left: max(var(--gap), env(safe-area-inset-left)); }
  .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }
  /* dialogs slide up from the bottom, like a phone app */
  .backdrop { place-items: end stretch; padding: 0; }
  .modal { width: 100%; max-height: 92dvh; border-radius: var(--r) var(--r) 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); animation: sheet-in .28s var(--ease); }
  .backdrop.out .modal { transform: translateY(30px); }
  .modal.settings { height: 92dvh; }
  /* search folds into its icon and opens over the header */
  .chan-head { position: relative; }
  .search-box { display: flex; border: 0; background: none; margin: 0; padding: 0 6px; height: 36px; color: var(--mist); }
  .search-box .head-search { width: 0 !important; min-width: 0; }
  .search-box:focus-within { position: absolute; inset: 6px 8px; height: auto; z-index: 3; background: var(--panel); border: 1px solid var(--mist); border-radius: 6px; padding: 0 10px; }
  .search-box:focus-within .head-search { width: 100% !important; }
}

/* phones: the call stays in reach while you read a chat */
#callpill { display: none; }
@media (max-width: 780px) {
  #callpill:not(:empty) { display: block; position: fixed; z-index: 15; left: 50%; transform: translateX(-50%); top: calc(max(var(--gap), env(safe-area-inset-top)) + 58px); max-width: calc(100vw - 32px); }
  .callpill { display: flex; align-items: center; gap: 2px; padding: 3px 4px 3px 12px; border-radius: 999px; background: var(--solid, var(--raised)); border: 1px solid #4ade8055; box-shadow: 0 10px 30px -10px #000; animation: rise .3s var(--ease); }
  .cp-where { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; font-weight: 500; }
  .cp-where span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cp-dot { width: 8px; height: 8px; border-radius: 2px; flex: none; background: var(--online); }
  .cp-dot.wait { background: var(--idle); }
  .callpill .icon-btn { width: 34px; height: 34px; }
}

/* ---------- reports ---------- */
.report { display: grid; gap: 8px; padding: 12px; border-radius: var(--r-s); background: var(--bg); border: 1px solid var(--line); }
.report-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.report-msg { margin: 0; padding: 8px 12px; border-left: 3px solid var(--line-2); background: var(--panel); border-radius: 4px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 160px; overflow: auto; }
.report-list { margin: 0; padding-left: 18px; font-size: 13px; }

/* ---------- enhanced role styles: names flow through the role's gradient and glow softly ---------- */
.rs-gradient .nm, .rs-holo .nm {
  -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% auto;
  padding-bottom: .06em; margin-bottom: -.06em; animation: role-flow 6s linear infinite;
}
.rs-gradient .nm { background-image: linear-gradient(90deg, var(--r1), var(--r2), var(--r1)); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--r1) 70%, transparent)); }
.rs-holo .nm { background-image: linear-gradient(90deg, #ffb3e6, #b8a6ff, #8fe3ff, #b6ffcf, #ffb3e6); filter: drop-shadow(0 0 6px #b8a6ffcc); }
/* "animate on hover" in Appearance also calms role names in busy lists */
.rs-still .nm { animation-play-state: paused; }
:is(.msg, .mem, button, a):hover .rs-still .nm, .rs-still:hover .nm { animation-play-state: running; }
@keyframes role-flow { to { background-position: -200% center; } }
.role-preview { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-s); background: var(--bg); border: 1px solid var(--line); font-weight: 600; }
.role-colors { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.meter { height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; max-width: 360px; }
.meter i { display: block; height: 100%; background: var(--gold); border-radius: 3px; }
.storage { justify-items: stretch; }

/* ---------- end-to-end encrypted DMs ---------- */
.e2ee-badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 5px; font-size: 12px; font-weight: 500; border: 1px solid; white-space: nowrap; flex: none; }
.e2ee-badge.on { color: var(--online); border-color: #4ade8040; }
.e2ee-badge.off { color: var(--idle); border-color: #facc1540; }
.e2ee-badge.wait { color: var(--mist); border-color: var(--line-2); }
@media (max-width: 780px) { .e2ee-badge span { display: none; } .e2ee-badge { padding: 0 5px; } }
.e2ee-note { display: flex; align-items: center; gap: 6px; margin: 2px 0; font-size: 13px; color: var(--idle); }
.e2ee-note.locked { color: var(--mist); font-style: italic; }
.att-gone { opacity: .5; }

/* ---------- moderation ---------- */
.menu-note { margin: 0; padding: 6px 10px 2px; font-size: 12px; color: var(--mist); }
.owner.timed { color: var(--idle); }

/* ---------- forums ---------- */
.forum { display: flex; flex-direction: column; gap: 10px; min-height: 0; flex: 1; overflow-y: auto; padding: 4px 2px 12px; }
.forum-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px; }
.forum-bar p { margin: 0; }
.posts { display: grid; gap: 8px; }
.post { display: flex; gap: 14px; align-items: center; text-align: left; padding: 14px 16px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); transition: border-color .15s; }
.post:hover { border-color: var(--line-2); }
.post-text { display: grid; gap: 4px; flex: 1; min-width: 0; }
.post-title { font: 500 17px/1.3 var(--f-display); color: var(--mist); }
.post.unread .post-title { color: var(--text); }
.post-preview { color: var(--mist); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12px; color: var(--dim); margin-top: 4px; }
.post-meta .av { margin-right: -6px; }
.post-stat { display: inline-flex; align-items: center; gap: 4px; }
.post-thumb { width: 84px; height: 84px; flex: none; object-fit: cover; border-radius: var(--r-s); border: 1px solid var(--line); }
.forum-empty { padding: 48px 16px; text-align: center; }
.forum-empty h3 { font: 500 22px var(--f-display); margin: 0 0 6px; }
.post-images { display: flex; gap: 6px; flex-wrap: wrap; }
.post-images:empty { display: none; }
.post-images img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--r-s); }
.post-modal { width: min(560px, 100%); }
@media (max-width: 780px) { .post-thumb { width: 64px; height: 64px; } }

/* ---------- voice messages ---------- */
.composer.recording { align-items: center; gap: 10px; padding-left: 10px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dnd); animation: breathe 1.2s ease-in-out infinite; }
.rec-label { color: var(--mist); font-size: 14px; }
.rec-time { flex: 1; font: 14px var(--f-mono); font-variant-numeric: tabular-nums; }
.voice-msg { display: flex; align-items: center; gap: 10px; width: min(360px, 100%); padding: 8px 12px 8px 8px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line-2); }
.voice-msg audio { display: none; }
.vm-play { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--gold-ink); flex: none; }
.vm-play:hover { background: var(--gold-2); }
.vm-wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 30px; cursor: pointer; }
.vm-wave i { flex: 1; min-width: 2px; border-radius: 2px; background: var(--line-2); transition: background .1s; }
.vm-wave i.played { background: var(--gold); }
.vm-wave:focus-visible { outline: 2px solid var(--mist); outline-offset: 4px; border-radius: 4px; }
.vm-time { font: 12px var(--f-mono); color: var(--mist); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }

/* ---------- calls: volume ---------- */
.vol-row { display: flex; align-items: center; gap: 8px; width: 100%; font-size: 13px; color: var(--mist); }
.vol-row .range { flex: 1; min-width: 0; width: auto; }
.vol-value { flex: none; min-width: 38px; text-align: right; font: 12px var(--f-mono); font-variant-numeric: tabular-nums; }
.vol-pop { padding: 10px 12px; width: 300px; max-width: calc(100vw - 24px); box-sizing: border-box; }
.tab-sub { font-size: 16px; margin: 18px 0 4px; }
/* who's talking: a still ring that fades in and out (it used to pulse, which read as bouncing) */
.tile, .tile .tile-face .av, .vc-user .av { transition: border-color .15s, box-shadow .15s; }

/* cosmetics rest until you point at their row (the default, like Discord) or never move: dozens of them animating at
   once kept the GPU busy on an idle screen. Popped-out profiles still play. */
:is(.anim-hover, .anim-never) .av.deco::before, :is(.anim-hover, .anim-never) .av.deco::after,
:is(.anim-hover, .anim-never) .ns-shimmer .nm, :is(.anim-hover, .anim-never) .profile.in-panel .fx i { animation-play-state: paused; }
.anim-hover :is(.msg, .mem, .dm, .vc-user, .mem-who, .friend, .profile, #me-panel):hover .av.deco::before,
.anim-hover :is(.msg, .mem, .dm, .vc-user, .mem-who, .friend, .profile, #me-panel):hover .av.deco::after,
.anim-hover :is(.msg, .mem, .dm, .vc-user, .mem-who, .friend, .profile, #me-panel):hover .ns-shimmer .nm,
.anim-hover .profile.in-panel:hover .fx i { animation-play-state: running; }

/* ---------- Server tab sub-tabs ---------- */
.admin-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 16px; }
.admin-tabs button { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--mist); font-size: 13px; }
.admin-tabs button.on { color: var(--ink, var(--text)); background: var(--raised); border-color: var(--text); }

/* ---------- Server tab > Overview (group 01 admin-observe) ---------- */
.obs-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.obs-col { display: grid; gap: 10px; justify-items: start; }
.obs-col > .obs-tiles, .obs-col > .notice { justify-self: stretch; }
.obs-tile { display: grid; gap: 2px; align-content: start; padding: 10px 12px; border-radius: var(--r-s); background: var(--bg); border: 1px solid var(--line); min-width: 0; }
.obs-label { color: var(--mist); font-size: 12px; }
.obs-value { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.obs-sub { color: var(--dim); font-size: 12px; }
.obs-health { display: grid; gap: 4px; }
.obs-row { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.obs-row:last-child { border-bottom: 0; }
.obs-row-body { display: grid; gap: 6px; justify-items: start; min-width: 0; }
.obs-row-body p { overflow-wrap: anywhere; }
.obs-meter { width: 100%; max-width: 360px; height: 6px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.obs-meter i { display: block; height: 100%; border-radius: inherit; background: var(--gold); }
.obs-meter i.warn { background: var(--idle); }
.obs-meter i.bad { background: var(--dnd); }
.tag.obs-off { background: none; border: 1px solid var(--line-2); color: var(--mist); }
.obs-sub-title { font: 600 14px var(--f-body); margin: 6px 0 0; }
.obs-errors { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.obs-errors details { padding: 8px 10px; border-radius: var(--r-s); background: var(--bg); border: 1px solid var(--line); }
.obs-errors summary { cursor: pointer; overflow-wrap: anywhere; }
.obs-errors code { font: 12px var(--f-mono); color: var(--dnd); }
.obs-stack { margin: 8px 0 0; font: 11px/1.5 var(--f-mono); color: var(--mist); white-space: pre-wrap; overflow-wrap: anywhere; }
.obs-chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.obs-chart { margin: 0; padding: 10px 12px; border-radius: var(--r-s); background: var(--bg); border: 1px solid var(--line); min-width: 0; }
.obs-chart figcaption { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.obs-plot { position: relative; }
.obs-plot svg { display: block; width: 100%; height: 120px; overflow: visible; }
.obs-max { position: absolute; top: -4px; left: 0; font-size: 11px; line-height: 1; padding-right: 4px; background: var(--bg); pointer-events: none; }
.obs-grid { stroke: var(--line); stroke-width: 1; }
.obs-bar-mark { fill: var(--gold); }
.obs-line { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.obs-area { fill: color-mix(in srgb, var(--gold) 10%, transparent); }
.obs-hit { fill: transparent; }
.obs-hit:hover { fill: color-mix(in srgb, var(--text) 6%, transparent); }
.obs-axis { display: flex; justify-content: space-between; font-size: 11px; margin-top: 4px; }
.obs-table { margin-top: 10px; }
.obs-table summary { cursor: pointer; color: var(--mist); font-size: 13px; }
.obs-table td, .obs-table th { font-variant-numeric: tabular-nums; white-space: nowrap; }
.obs-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 320px; overflow-y: auto; }
.obs-feed-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--r-s); background: var(--bg); border: 1px solid var(--line); }
.obs-feed-text { min-width: 0; overflow-wrap: anywhere; }
.obs-feed-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--raised); color: var(--mist); }
.obs-feed-ic.k-signup { color: var(--online); }
.obs-feed-ic.k-space { color: var(--gold); }
.obs-feed-ic.k-report { color: var(--idle); }
@media (prefers-reduced-motion: no-preference) {
  .obs-feed-item.fresh { animation: obs-fresh 2.4s var(--ease); }
  @keyframes obs-fresh { from { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--bg)); } }
}
.obs-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.obs-two h4 { font: 600 14px var(--f-body); margin: 0 0 6px; }
.obs-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.obs-rank li { display: grid; gap: 3px; min-width: 0; }
.obs-rank-head { display: flex; justify-content: space-between; gap: 8px; }
.obs-rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.obs-bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.obs-bar i { display: block; height: 100%; border-radius: inherit; background: var(--gold); }
.obs-releases { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.obs-notes { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 780px) {
  .obs-two { grid-template-columns: 1fr; }
  .obs-row { grid-template-columns: 1fr; gap: 4px; }
  .obs-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .obs-feed-item { grid-template-columns: auto 1fr; }
  .obs-feed-item time { grid-column: 2; }
}

/* ---------- official cards: AutoMod flags and alerts, system notices, rich embeds (group 06, public/js/cards.js) ---------- */
.ocard { --official: #5865f2; display: grid; gap: 8px; max-width: 560px; margin-top: 4px; padding: 10px 12px; border-radius: var(--r-s); background: var(--panel); border: 1px solid var(--line); }
.oc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--mist); }
.oc-head > .ic { color: var(--official); }
.oc-head time, .oc-log time { font-size: 12px; color: var(--dim); }
.oc-head .link { color: var(--link); font-weight: 600; }
.oc-quote { display: grid; gap: 4px; padding: 8px 10px; border-radius: 6px; background: var(--bg); border-left: 3px solid var(--line-2); }
.cq-author { display: inline-flex; align-items: center; gap: 6px; justify-self: start; font-size: 14px; }
.cq-text { margin: 0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cq-text mark { color: inherit; background: color-mix(in srgb, var(--dnd) 30%, transparent); box-shadow: inset 0 -2px 0 var(--dnd); border-radius: 3px; padding: 0 2px; }
.oc-quote.gone .cq-text { color: var(--dim); }
.cq-gone { font-size: 12px; color: var(--dnd); }
.oc-facts { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--mist); }
.oc-facts b { color: var(--text); font-weight: 600; }
.oc-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 13px; color: var(--mist); }
.oc-log li { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.oc-log li > .ic { color: var(--online); }
.oc-note { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--idle); }
.oc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.oc-bar:empty { display: none; }
.oc-flag.handled { border-color: color-mix(in srgb, var(--online) 30%, var(--line)); }
.oc-alert { border-color: color-mix(in srgb, var(--dnd) 45%, var(--line)); }
.oc-title { display: flex; align-items: center; gap: 8px; font: 600 16px/1.3 var(--f-display); color: var(--dnd); }
.oc-alert.resolved { border-color: var(--line); }
.oc-alert.resolved .oc-title { color: var(--mist); }
.oc-text { margin: 0; font-size: 14px; color: var(--mist); overflow-wrap: anywhere; }
.oc-done { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--online); }
.oc-notice { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.oc-icon { width: 36px; height: 36px; border-radius: 22%; display: grid; place-items: center; color: #9aa2ff; background: color-mix(in srgb, var(--official) 22%, transparent); }
.oc-notice.lv-warning .oc-icon { color: var(--idle); background: color-mix(in srgb, var(--idle) 18%, transparent); }
.oc-notice.lv-success .oc-icon { color: var(--online); background: color-mix(in srgb, var(--online) 18%, transparent); }
.oc-title-sm { display: block; font-weight: 600; }
.oc-side { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.oc-side:empty { display: none; }
.oc-av { border-radius: 22%; }
@media (max-width: 780px) {
  .oc-notice { grid-template-columns: auto minmax(0, 1fr); }
  .oc-side { grid-column: 1 / -1; }
  .oc-bar .btn { flex: 1 1 auto; }
}

/* rich embeds: author line, thumbnail at the top right, fields in a grid, footer with a time */
.embed-top { display: flex; gap: 12px; }
.embed-main { display: grid; gap: 4px; flex: 1; min-width: 0; align-content: start; }
.embed-author { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.embed-author a { color: var(--text); text-decoration: none; }
.embed-author a:hover { text-decoration: underline; }
.embed-icon { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex: none; }
.embed-thumb { flex: none; width: 80px; height: 80px; border-radius: 6px; overflow: hidden; }
.embed-thumb img { width: 100%; height: 100%; object-fit: cover; }
.embed-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 16px; }
.embed-field { grid-column: 1 / -1; min-width: 0; overflow-wrap: anywhere; }
.embed-field.inline { grid-column: auto; }
.embed-footer { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--mist); }
.embed-footer .embed-icon { width: 18px; height: 18px; }
.embed-footer span + time::before { content: '\00b7'; margin-right: 6px; }
@media (max-width: 780px) {
  .embed-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .embed-thumb { width: 64px; height: 64px; }
}

/* ---------- Server tab: People (admin-people.js) ---------- */
.ap-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ap-chips button { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--mist); font-size: 13px; }
.ap-chips button[aria-checked=true] { color: var(--text); background: var(--raised); border-color: var(--text); }
.ap-modal { width: min(620px, 100%); }
.ap-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ap-head b { font-size: 17px; flex-wrap: wrap; }
.ap-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0; font-size: 14px; }
.ap-facts dt { color: var(--mist); }
.ap-facts dd { margin: 0; overflow-wrap: anywhere; }
.ap-sec { display: grid; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.ap-sec h4 { font: 500 15px var(--f-display); margin: 0; }
.ap-sec ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 14px; }
.ap-sec li { overflow-wrap: anywhere; }
.ap-sec li .tag { margin-left: 6px; }
.ap-compose { display: grid; gap: 6px; justify-items: end; }
.ap-names { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ap-names .form-foot { grid-column: 1 / -1; }
.ap-sent li { white-space: pre-wrap; }
.ap-note { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: var(--r-s); background: var(--bg); border: 1px solid var(--line); }
.ap-note > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ap-note p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ap-hand { display: flex; gap: 6px; flex-wrap: wrap; }
.ap-hand input { width: 150px; }
.ap-tree ul { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 1px solid var(--line-2); display: grid; gap: 2px; }
.ap-tree > ul { padding-left: 0; border: 0; }
.ap-node { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; padding: 4px 8px; border-radius: var(--r-s); min-height: 32px; }
.ap-node:hover:not(:disabled) { background: var(--hover); }
.ap-node:disabled { opacity: .55; }
.ap-wide { justify-self: stretch; width: 100%; }
@media (max-width: 560px) {
  .ap-facts, .ap-names { grid-template-columns: minmax(0, 1fr); }
  .ap-facts dt { margin-top: 6px; }
  .account-item.ap-orphan { flex-wrap: wrap; }
}

/* ---------- writing and sending: file previews with upload bars, sending state, silent and scheduled messages,
   pictures that fade in over a blur, download bars (composer-extra.js) ---------- */
.ptiles { display: flex; gap: 8px; flex-wrap: wrap; }
.ptile { position: relative; width: 86px; display: grid; gap: 4px; justify-items: center; padding: 6px 6px 7px; border-radius: var(--r-s); background: var(--panel); border: 1px solid var(--line-2); font-size: 11px; animation: rise .2s var(--ease); }
.ptile img, .ptile-file { width: 72px; height: 72px; border-radius: 6px; object-fit: cover; }
.ptile-file { display: grid; place-content: center; justify-items: center; gap: 2px; background: var(--raised); color: var(--mist); font: 10px var(--f-mono); }
.ptile-name { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--mist); }
.ptile-bar, .att-dl { display: block; height: 4px; border-radius: 2px; background: var(--line-2); overflow: hidden; }
.ptile-bar { width: 72px; }
.ptile-bar i, .att-dl i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s linear; }
.ptile.busy img { opacity: .7; }
.ptile-x.icon-btn { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; background: var(--raised); border: 1px solid var(--line-2); }
.ptiles.in-msg { margin-top: 6px; }
.msg.local .msg-body > :not(.local-state):not(.ptiles), .msg.local .ptile img { opacity: .55; }
.local-state { display: flex; align-items: center; gap: 8px; margin-top: 3px; font-size: 12px; color: var(--mist); }
.local-state.failed { flex-wrap: wrap; }
.spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--mist); animation: spin .8s linear infinite; flex: none; }
.local-retry { display: inline-flex; align-items: center; gap: 6px; color: var(--dnd); font-weight: 500; }
.local-retry:hover { text-decoration: underline; }
.msg.local.failed { box-shadow: inset 2px 0 0 var(--dnd); }
.composer .send-opts { color: var(--mist); }
@media (max-width: 780px) { .composer .send-opts { display: none; } }
.sched-bar { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 10px; border-radius: var(--r-s); background: var(--panel); border: 1px solid var(--line-2); font-size: 13px; color: var(--mist); text-align: left; }
.sched-bar:hover { border-color: var(--mist); color: var(--text); }
.sched-failed { color: var(--dnd); }
.sched-open { margin-left: auto; color: var(--link); }
.sched-modal { width: min(520px, 100%); }
.sched-list { display: grid; gap: 10px; max-height: 60vh; overflow-y: auto; }
.sched-list > p { margin: 0; }
.sched-row { display: grid; gap: 6px; padding: 10px 12px; border-radius: var(--r-s); background: var(--raised); border: 1px solid var(--line); overflow-wrap: anywhere; }
.sched-row.failed { border-color: color-mix(in srgb, var(--dnd) 55%, transparent); }
.sched-when { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.sched-error { margin: 0; font-size: 13px; color: var(--dnd); }
.sched-quote { white-space: normal; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.att-img img { opacity: 0; transition: opacity .35s var(--ease); }
.att-img.loaded img { opacity: 1; }
.att-img.sized { position: relative; max-width: 100%; background: var(--panel); }
.att-img.sized img { position: relative; width: 100%; height: 100%; max-height: none; object-fit: cover; }
.att-blur { position: absolute; inset: 0; background-size: cover; background-position: center; filter: blur(12px); transform: scale(1.15); }
button.att-file { text-align: left; width: 100%; }
.att-file .att-dl { width: min(200px, 100%); margin-top: 5px; visibility: hidden; }
.att-file.downloading { border-color: var(--line-2); }
.att-file.downloading .att-dl { visibility: visible; }

/* ---------- 08 chat-messages: polls, forwards, code, players, spoilers, pins, inbox, reactions (message-features.js, inbox.js) ---------- */
.msg-body.forwarded { border-left: 2px solid var(--line-2); padding-left: 10px; }
.fwd { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 12px; color: var(--mist); margin-bottom: 2px; }
.fwd .ic { color: var(--dim); }
.fwd b { font-weight: 600; color: var(--text); }
.translation { margin: 4px 0; padding: 6px 10px; border-radius: var(--r-s); background: var(--panel); border: 1px solid var(--line); display: grid; gap: 2px; max-width: 760px; }
.translation-text { white-space: pre-wrap; overflow-wrap: anywhere; }
/* code blocks: language, copy, colors */
.content pre { position: relative; }
.code-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -4px -6px 6px 0; font: 11px var(--f-mono); color: var(--dim); }
.code-copy { padding: 2px 8px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--mist); font: 500 11px var(--f-body); }
.code-copy:hover { color: var(--text); border-color: var(--mist); }
.tk-k { color: #c9a8ff; }
.tk-s { color: #a6e3a1; }
.tk-c { color: var(--dim); font-style: italic; }
.tk-n { color: #f9c784; }
/* polls */
.poll { display: grid; gap: 6px; margin: 6px 0; padding: 10px; max-width: 460px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line-2); }
.poll-note { font-size: 12px; color: var(--mist); }
.poll-opt { position: relative; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 10px; border-radius: var(--r-s); border: 1px solid var(--line-2); overflow: hidden; isolation: isolate; text-align: left; transition: border-color .15s; }
.poll-opt::before { content: ''; position: absolute; inset: 0; width: var(--pct, 0%); background: color-mix(in srgb, var(--mist) 14%, transparent); z-index: -1; transition: width .4s var(--ease); }
.poll-opt:hover:not(:disabled) { border-color: var(--mist); }
.poll-opt:disabled { opacity: 1; cursor: default; }
.poll-opt.mine { border-color: var(--gold); }
.poll-opt.mine::before { background: color-mix(in srgb, var(--gold) 22%, transparent); }
.poll-opt.win .poll-text { font-weight: 650; }
.poll-check { width: 18px; height: 18px; flex: none; display: grid; place-items: center; border-radius: 5px; border: 1.5px solid var(--line-2); }
.poll-opt.mine .poll-check { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.poll-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.poll-count { font: 12px var(--f-mono); color: var(--mist); flex: none; }
.poll-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12px; color: var(--mist); }
.poll-foot .link { margin-left: auto; }
.poll-answers { display: grid; gap: 6px; margin-bottom: 6px; }
.poll-answer { display: flex; align-items: center; gap: 6px; }
.poll-answer input { flex: 1; }
/* spoiler pictures */
.spoiled { position: relative; overflow: hidden; cursor: pointer; }
.spoiled img, .spoiled video, .spoiled .att-blur { filter: blur(32px) brightness(.7); }
.spoiler-tag { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 4px 12px; border-radius: 999px; background: #000c; color: #fff; font: 600 12px var(--f-body); letter-spacing: .04em; pointer-events: none; }
.ptile-spoiler.on { color: var(--gold); }
.ptile.spoiler-on img { filter: blur(6px); }
/* YouTube, Spotify and X: a card until you press play */
.player { display: grid; gap: 6px; width: min(480px, 100%); padding: 10px; border-radius: var(--r-s); background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--pc, var(--line-2)); }
.pl-youtube { --pc: #ff4e45; } .pl-spotify { --pc: #1ed760; } .pl-x { --pc: var(--mist); }
.player-head { display: grid; gap: 2px; min-width: 0; }
.player-site { font-size: 12px; color: var(--mist); }
.player-title { font-weight: 600; color: var(--link); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-title:hover { text-decoration: underline; }
.player-cover { position: relative; display: grid; place-items: center; min-height: 120px; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: linear-gradient(135deg, var(--raised), var(--bg)); }
.pl-short .player-cover, .pl-post .player-cover { aspect-ratio: auto; min-height: 96px; }
.player-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.player-play { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; background: #000b; color: #fff; font-weight: 600; transition: transform .15s var(--spring); }
.player-cover:hover .player-play { transform: scale(1.06); }
.player-note { margin: 0; font-size: 11px; color: var(--dim); }
.player-frame { width: 100%; border: 0; border-radius: 6px; background: #000; display: block; }
.pl-wide .player-frame { aspect-ratio: 16 / 9; }
.pl-short .player-frame { height: 152px; }
.pl-tall .player-frame { height: 352px; }
.pl-post .player-frame { height: 560px; background: transparent; }
/* reply jumps, and back */
.msg.flash { animation: flash 2.4s ease-out; box-shadow: inset 2px 0 0 var(--gold); }
.jump-back { align-self: flex-end; margin: -46px 16px 6px 0; z-index: 3; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; background: var(--gold); color: var(--gold-ink); font-weight: 600; font-size: 13px; box-shadow: 0 8px 24px -8px #000; animation: rise .2s var(--ease); }
.jump-back:hover { background: var(--gold-2); }
/* pinned bar */
.pin-bar { display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 10px; border-radius: var(--r-s); background: var(--panel); border: 1px solid var(--line-2); font-size: 13px; min-width: 0; animation: rise .2s var(--ease); }
.pin-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 4px 0; text-align: left; }
.pin-main .ic { color: var(--gold); }
.pin-who { font-weight: 600; flex: none; }
.pin-text { color: var(--mist); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pin-main:hover .pin-text { color: var(--text); }
.pin-count { display: inline-flex; align-items: center; gap: 2px; padding: 4px 8px; border-radius: 6px; font: 11px var(--f-mono); color: var(--mist); flex: none; }
.pin-count:hover { background: var(--raised); color: var(--text); }
/* forward */
.fwd-modal { width: min(480px, 100%); }
.fwd-modal .modal-body { display: grid; gap: 10px; }
.fwd-list { display: grid; gap: 2px; max-height: 50vh; overflow-y: auto; }
.fwd-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-s); }
.fwd-row:hover { background: var(--raised); }
.fwd-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 22%; background: var(--raised); color: var(--mist); flex: none; }
.fwd-name { flex: 1; min-width: 0; display: grid; }
.fwd-name b, .fwd-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fwd-name small { color: var(--dim); font-size: 12px; }
/* who reacted */
.reactors-modal { width: min(440px, 100%); }
.reactors { display: grid; gap: 10px; }
.reactor-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.reactor-tab { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line-2); font: 600 12px var(--f-mono); color: var(--mist); }
.reactor-tab > span:first-child { font: 16px var(--f-body); }
.reactor-tab.on { border-color: var(--gold); color: var(--text); background: color-mix(in srgb, var(--gold) 8%, transparent); }
.reactor-tab.super { border-style: dashed; }
.reactor-list { display: grid; gap: 4px; max-height: 50vh; overflow-y: auto; }
.reactor-list p { margin: 0 0 4px; display: flex; align-items: center; gap: 4px; }
.reactor { display: flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 6px; }
/* reactions pop when a count goes up; typing dots bounce */
.reaction.bump { animation: react-bump .45s var(--spring); }
@keyframes react-bump { 0% { transform: scale(.7); } 55% { transform: scale(1.18); } 100% { transform: none; } }
.typing .dots i, .thinking .dots i { animation: typing-dot 1.2s ease-in-out infinite both; }
.typing .dots i:nth-child(2), .thinking .dots i:nth-child(2) { animation-delay: .15s; }
.typing .dots i:nth-child(3), .thinking .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes typing-dot { 0%, 70%, 100% { transform: none; opacity: .35; } 35% { transform: translateY(-3px); opacity: 1; } }
/* GIFs */
.gif-pop { width: min(380px, calc(100vw - 16px)); display: grid; gap: 8px; padding: 10px; }
.gif-grid { columns: 2; column-gap: 6px; max-height: 340px; overflow-y: auto; min-height: 120px; }
.gif { display: block; width: 100%; margin-bottom: 6px; border-radius: 6px; overflow: hidden; background: var(--raised); break-inside: avoid; }
.gif img { width: 100%; height: auto; }
.gif:hover, .gif:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.gif-state { column-span: all; display: grid; gap: 4px; padding: 20px 8px; text-align: center; margin: 0; }
.gif-state p { margin: 0; }
.gif-foot { display: flex; align-items: center; justify-content: space-between; min-height: 24px; }
/* inbox */
.inbox-btn { position: relative; display: grid; place-items: center; }
.inbox-count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--dnd); color: #fff; font: 700 10px/18px var(--f-mono); text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.inbox-modal { width: min(560px, 100%); }
.inbox-modal .modal-body { display: grid; gap: 10px; }
.inbox-tabs { margin-left: 0; }
.inbox-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.inbox-list { display: grid; gap: 8px; max-height: 60vh; overflow-y: auto; align-content: start; }
.inbox-item { display: flex; align-items: flex-start; gap: 6px; padding: 10px; border-radius: var(--r-s); background: var(--bg); border: 1px solid var(--line); }
.inbox-item.new { border-color: color-mix(in srgb, var(--gold) 55%, transparent); box-shadow: inset 2px 0 0 var(--gold); }
.inbox-open { flex: 1; min-width: 0; display: grid; gap: 6px; text-align: left; }
.inbox-open .content { font-size: 14px; max-height: 120px; overflow: hidden; }
.inbox-open .result-meta { flex-wrap: wrap; }
.inbox-kind { font: 600 10px var(--f-mono); color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); border-radius: 4px; padding: 0 4px; }
.inbox-empty { display: grid; justify-items: center; gap: 6px; padding: 30px 10px; text-align: center; color: var(--mist); }
.inbox-empty b { color: var(--text); }
.inbox-empty p { margin: 0; }
.seen-mark { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 2px; font-size: 11px; color: var(--mist); }
body:is([data-theme=dusk], [data-theme=aurora], [data-theme=nebula], [data-theme=tide], [data-theme=sunrise], [data-theme=blossom]) :is(.inbox-item, .poll) { background: var(--solid); }
@media (max-width: 780px) {
  .poll, .player { max-width: 100%; }
  .gif-grid { max-height: 50vh; }
}

/* ---------- day to day (group 02): announcement banners, maintenance screen, sign-up extras, Server > Day to day ---------- */
.app:has(> .announce-bar) { grid-template-rows: auto minmax(0, 1fr); }
.announce-bar { grid-column: 1 / -1; display: grid; gap: 6px; min-width: 0; }
.announce { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 4px 4px 4px 12px; border-radius: var(--r); background: var(--panel); border: 1px solid color-mix(in srgb, var(--link) 40%, transparent); animation: rise .3s var(--ease); }
.announce > .ic { color: var(--link); }
.announce.lv-warning { border-color: #facc1555; }
.announce.lv-warning > .ic { color: var(--idle); }
.announce.lv-success { border-color: #4ade8055; }
.announce.lv-success > .ic { color: var(--online); }
.announce-text { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; padding: 6px 0; overflow: hidden; white-space: nowrap; text-align: left; }
.announce-text b { flex: none; font-weight: 600; }
.announce-body { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--mist); font-size: 14px; }
button.announce-text:hover .announce-body { color: var(--text); }
.announce-full { line-height: 1.6; overflow-wrap: anywhere; }
.announce-modal { width: min(520px, 100%); }
@media (max-width: 780px) {
  .announce-text { flex-direction: column; gap: 0; white-space: normal; }
  .announce-body { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
/* over everything, so it needs a solid color on gradient themes too */
.maint { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 16px; background: var(--solid, var(--bg)); }
.maint-card { width: min(440px, 100%); display: grid; gap: 12px; justify-items: center; text-align: center; animation: rise .5s var(--ease) both; }
.maint-card h1 { font-size: 34px; }
.maint-card p { margin: 0; }
.maint-moon { color: var(--gold); filter: drop-shadow(0 0 18px color-mix(in srgb, var(--gold) 45%, transparent)); animation: breathe 3.2s ease-in-out infinite; }
.maint-msg { padding: 10px 14px; border-radius: var(--r-s); background: var(--raised); border: 1px solid var(--line-2); overflow-wrap: anywhere; }
.server-head { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 16px; }
.server-head img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.signup-rules { display: grid; gap: 6px; padding: 10px 12px; border-radius: var(--r-s); background: #00000055; border: 1px solid var(--line-2); font-size: 14px; }
.signup-rules-text { max-height: 160px; overflow-y: auto; color: var(--mist); overflow-wrap: anywhere; }
.signup-terms { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.signup-terms input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--gold); flex: none; }
.legal-card { width: min(720px, 100%); display: grid; gap: 12px; }
.legal-text { max-height: 65vh; overflow-y: auto; line-height: 1.6; overflow-wrap: anywhere; }
.legal-card .btn { justify-self: start; text-decoration: none; color: var(--text); }
.daily-form textarea { min-height: 70px; }
.daily-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.daily-ann { border-left: 3px solid var(--link); }
.daily-ann.lv-warning { border-left-color: var(--idle); }
.daily-ann.lv-success { border-left-color: var(--online); }
.daily-ann .account-text b .tag { margin-left: 2px; }
.daily-clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.daily-icon { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.daily-expr { width: 100%; }
.daily-expr .row input { flex: 1; min-width: 140px; width: auto; }
.daily-expr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; width: 100%; }
.daily-expr-item { display: grid; justify-items: center; gap: 4px; padding: 8px 4px 4px; border-radius: var(--r-s); background: var(--bg); border: 1px solid var(--line); min-width: 0; }
.daily-expr-item img { width: 40px; height: 40px; object-fit: contain; }
.daily-expr-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.daily-test input { flex: 1; min-width: 180px; width: auto; }
.daily-restore { width: min(520px, 100%); }
.tag.off { background: none; border: 1px solid; color: var(--mist); }

/* ---------- AutoMod rules (group 05, public/js/automod.js): settings tab, rule editor, recent joins, review queue ---------- */
.automod select { max-width: 100%; }
.am-raid { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; padding: 12px; border-radius: var(--r-s); border: 1px solid color-mix(in srgb, var(--dnd) 55%, transparent); background: color-mix(in srgb, var(--dnd) 10%, var(--bg)); color: var(--text); }
.am-raid > .ic { color: var(--dnd); margin-top: 2px; }
.am-raid-text { flex: 1; min-width: 200px; display: grid; gap: 2px; }
.am-raid-text p { margin: 0; color: var(--mist); }
.am-rules { display: grid; gap: 4px; }
.am-rule { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-s); background: var(--bg); border: 1px solid var(--line); }
.am-rule input { width: 18px; height: 18px; flex: none; accent-color: var(--gold); }
.am-rule.off .am-rule-text { opacity: .55; }
.am-rule-text { flex: 1; min-width: 0; display: grid; }
.am-rule-text b { overflow-wrap: anywhere; }
.am-rule-text small { color: var(--mist); font-size: 13px; overflow-wrap: anywhere; }
.am-menu { display: grid; gap: 2px; width: min(340px, calc(100vw - 32px)); max-height: min(420px, 70dvh); overflow-y: auto; padding: 4px; }
.am-menu-item { display: grid; gap: 1px; padding: 8px 10px; border-radius: var(--r-s); }
.am-menu-item:hover, .am-menu-item:focus-visible { background: var(--hover); }
.am-menu-item small { color: var(--mist); font-size: 12px; }
.am-try { display: flex; gap: 8px; }
.am-try input { flex: 1; min-width: 0; }
.am-try-out:empty { display: none; }
.am-try-out p { margin: 0; overflow-wrap: anywhere; }
.am-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.am-chip { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg); font-size: 13px; color: var(--mist); transition: border-color .12s, color .12s; }
.am-chip:hover { color: var(--text); border-color: var(--mist); }
.am-chip.on { color: var(--gold-ink); background: var(--gold); border-color: var(--gold); }
.modal.am-editor, .modal.am-joins { width: min(560px, 100%); }
.am-editor textarea { min-height: 84px; }
.am-editor .form-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.am-editor .form-foot > .primary:only-child { margin-left: auto; }
.am-join { cursor: pointer; }
.am-join input { width: 18px; height: 18px; flex: none; accent-color: var(--gold); }
.am-join .mm-text { min-width: 0; }
.am-join small { overflow-wrap: anywhere; }
.am-queue { display: grid; gap: 8px; }
@media (max-width: 780px) {
  .am-rule { flex-wrap: wrap; }
  .am-rule-text { flex-basis: calc(100% - 40px); }
}

/* ---------- Server > Spaces and safety, featured spaces, the two-factor reminder (admin-safety.js) ---------- */
.as-case { display: grid; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.as-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.as-inline select { width: auto; max-width: 100%; }
.as-notes { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13px; overflow-wrap: anywhere; }
.as-note-form { flex-wrap: nowrap; }
.as-note-form input { flex: 1; min-width: 0; width: auto; }
.as-done { opacity: .85; }
.as-details summary { cursor: pointer; color: var(--mist); font-size: 13px; padding: 4px 0; }
.as-details[open] summary { margin-bottom: 8px; }
.as-more { display: flex; justify-content: center; }
.as-sub { margin: 6px 0 0; font-size: 13px; font-weight: 500; color: var(--mist); }
.as-samples { overflow-wrap: anywhere; font-family: var(--f-mono); font-size: 11px; }
.as-space-icon { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; object-fit: cover; background: var(--raised); font: 600 12px/1 var(--f-display); color: var(--mist); }
.as-space-head { display: flex; align-items: center; gap: 12px; }
.as-space-head .as-space-icon { width: 48px; height: 48px; border-radius: 13px; font-size: 16px; }
.as-space-modal .settings-section { margin-top: 12px; padding-top: 12px; }
.as-space-modal .row select { width: auto; }
.as-meter { display: block; height: 5px; max-width: 260px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.as-meter > i { display: block; height: 100%; background: var(--gold); }
.as-meter.full > i { background: var(--dnd); }
.as-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.as-grid input { width: 100%; }
.as-featured { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.as-feat { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-s); background: var(--bg); border: 1px solid var(--line); }
.as-feat .account-text .small { color: var(--text); }
.as-mfa-bar { position: fixed; z-index: 60; top: 12px; left: 0; right: 0; margin: 0 auto; width: max-content; display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px);
  padding: 6px 6px 6px 14px; border-radius: 999px; background: var(--solid, var(--raised)); border: 1px solid var(--line-2); box-shadow: 0 10px 30px -10px #000; font-size: 13px; animation: rise .3s var(--ease); }
.as-mfa-bar > .ic { color: var(--gold); }
@media (max-width: 640px) {
  .as-mfa-bar { left: 16px; right: 16px; width: auto; flex-wrap: wrap; border-radius: 12px; padding: 10px 12px; }
  .as-mfa-bar > span:not(.ic) { flex: 1 1 calc(100% - 40px); }
  .as-feat, .account-item.as-flag, .account-item.as-attempt { flex-wrap: wrap; }
  .as-flag > .row { width: 100%; }
}

/* ---------- calls, more (build group 09, voice-extra.js) ---------- */
.stage-left { justify-self: start; display: flex; align-items: center; gap: 4px; min-width: 0; }
.q-btn { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; color: var(--online); }
.q-btn:hover { background: var(--raised); }
.q-btn.ok { color: var(--idle); }
.q-btn.bad { color: var(--dnd); }
.q-btn.wait { color: var(--dim); }
.q-details { display: grid; gap: 10px; margin-top: 10px; }
.q-row { display: flex; align-items: center; gap: 10px; }
.q-text { display: grid; gap: 1px; }
.q-level.good { color: var(--online); } .q-level.ok { color: var(--idle); } .q-level.bad { color: var(--dnd); } .q-level.wait { color: var(--dim); }
.ptt-chip { font-size: 12px; padding: 4px 8px; border-radius: 999px; background: var(--raised); color: var(--mist); white-space: nowrap; }
.ptt-chip.on { background: var(--online); color: #06240f; }
.ptt-key { min-width: 64px; font-family: var(--f-mono); }
.stage-audience:empty { display: none; }
.audience { margin: 0 10px 10px; padding: 10px; border-radius: var(--r-s); background: var(--bg); border: 1px solid var(--line); max-height: 180px; overflow: auto; }
.audience-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.audience-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.aud { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; min-width: 0; }
.aud.hand { background: color-mix(in srgb, var(--gold) 12%, transparent); }
.aud-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.aud-hand { color: var(--gold); display: grid; }
.prejoin.compact { flex: none; padding: 18px 16px 12px; gap: 8px; }
.prejoin.compact .display { font-size: 22px; }
.prejoin.compact .prejoin-orbit .av, .prejoin.compact .prejoin-moon { width: 48px; height: 48px; }
/* while someone's connection comes up: soft rings around their picture */
.tile.connecting .tile-face { position: relative; }
.tile.connecting .tile-face::before, .tile.connecting .tile-face::after {
  content: ''; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid var(--gold); opacity: 0; pointer-events: none;
}
.vb-state.wait::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--idle); vertical-align: middle; }
@media (prefers-reduced-motion: no-preference) {
  .tile.connecting .tile-face::before { animation: ring-out 1.8s var(--ease) infinite; }
  .tile.connecting .tile-face::after { animation: ring-out 1.8s var(--ease) .9s infinite; }
  .vb-state.wait::before { animation: blink 1.2s infinite; }
}
@keyframes ring-out { from { transform: scale(.85); opacity: .7; } to { transform: scale(1.5); opacity: 0; } }
@media (max-width: 780px) {
  .stage-bar { grid-template-columns: 1fr; justify-items: center; }
  .stage-left { justify-self: center; }
  .stage-quality { display: none; }
}

/* ---------- finding things (build group 10, find.js) ---------- */
.qs-open { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border-radius: var(--r-s); background: var(--raised); border: 1px solid var(--line); color: var(--mist); font-size: 13px; text-align: left; }
.qs-open:hover { border-color: var(--line-2); color: var(--text); }
.qs-open span:not(.ic) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-open kbd, .qs-tip kbd { font: 11px var(--f-mono); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--dim); }
.qs-modal { width: min(560px, calc(100vw - 32px)); }
.qs-input { width: 100%; font-size: 17px; padding: 12px 14px; }
.qs-list { display: grid; gap: 2px; margin-top: 10px; max-height: min(52vh, 420px); overflow: auto; }
.qs-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-s); text-align: left; min-width: 0; }
.qs-item.on { background: var(--raised); }
.qs-item.unread .qs-label { font-weight: 600; }
.qs-icon { display: grid; place-items: center; width: 22px; color: var(--mist); }
.qs-label { flex: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-sub { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); font-size: 13px; }
.qs-empty { padding: 14px 10px; }
.qs-tip { margin: 10px 0 0; }
.search-box .icon-btn { margin-left: auto; }
.search-filters { display: grid; gap: 10px; width: min(320px, calc(100vw - 32px)); padding: 4px; }
.search-filters .row { gap: 8px; }
.search-filters .row .field { flex: 1; min-width: 0; }
.threads-pop { width: min(380px, calc(100vw - 32px)); display: grid; gap: 8px; }
.threads-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.threads-list { display: grid; gap: 2px; max-height: 360px; overflow: auto; }
.thread-item { display: grid; gap: 2px; padding: 8px; border-radius: var(--r-s); text-align: left; }
.thread-item:hover { background: var(--raised); }
.thread-item.unread .thread-name { font-weight: 600; }
.thread-name { display: flex; align-items: center; gap: 6px; }
.threads-empty { padding: 10px 4px; }
.forum-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 16px 10px; }
.forum-tags { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.tag-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; background: var(--raised); border: 1px solid var(--line-2); color: var(--text); }
button.tag-chip:hover { border-color: var(--edge); }
.tag-chip.on { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.post-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.solved-badge { display: inline-flex; align-items: center; gap: 3px; margin-right: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; background: color-mix(in srgb, var(--online) 18%, transparent); color: var(--online); vertical-align: middle; }
.chan-head .tag-chip, .chan-head .solved-badge { flex: none; }
.tag-admin { display: grid; gap: 6px; margin-bottom: 12px; }
.tag-row { display: flex; align-items: center; gap: 8px; }
.tag-row .icon-btn { margin-left: auto; }
.tag-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.ch-label { display: flex; align-items: center; gap: 4px; }
.ch-fold { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; text-align: left; }
.ch-fold .ic { transition: transform .15s var(--ease); }
.ch-group.folded > .ch-label .ch-fold .ic { transform: rotate(-90deg); }
.ch-row.dragging, .space-row.dragging { opacity: .45; }
.drop-above { box-shadow: inset 0 2px 0 var(--gold); }
.folder { border-radius: var(--r-s); }
.folder.open { background: color-mix(in srgb, var(--folder) 8%, transparent); }
.folder-head { display: flex; align-items: center; gap: 2px; }
.folder-head .icon-btn { opacity: 0; }
.folder-head:hover .icon-btn, .folder-head:focus-within .icon-btn { opacity: 1; }
.folder-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-s); color: var(--folder); text-align: left; }
.folder-btn .space-name { color: var(--text); }
.folder-btn:hover { background: var(--raised); }
.folder-spaces { padding: 0 0 4px 12px; border-left: 2px solid var(--folder); margin-left: 14px; }
.folder-colors { gap: 6px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; }
.swatch.on { border-color: var(--text); }
@media (hover: none) { .folder-head .icon-btn { opacity: 1; } }

/* ---------- you and notifications (build group 11, profile-extra.js) ---------- */
.status-emoji { width: 44px; height: 40px; padding: 0; font-size: 20px; flex: none; }
.status-quick { flex-wrap: wrap; gap: 4px; }
.quick-emoji { width: 34px; height: 34px; border-radius: 8px; font-size: 18px; }
.quick-emoji:hover { background: var(--raised); }
.pf-status small { font-size: 12px; }
.pf-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pf-link { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 3px 9px; border-radius: 999px; font-size: 12px; background: var(--raised); border: 1px solid var(--line-2); color: var(--text); text-decoration: none; }
.pf-link span:not(.ic) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ic.brand { flex: none; display: inline-flex; }
.pf-link:hover { border-color: var(--edge); }
.pf-section { display: grid; gap: 4px; width: 100%; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.pf-label { font-size: 11px; font-weight: 600; color: var(--dim); }
.pf-note, .pf-nick { width: 100%; font-size: 13px; background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 4px 6px; resize: vertical; }
.pf-note:hover, .pf-nick:hover, .pf-note:focus, .pf-nick:focus { border-color: var(--line-2); background: var(--bg); }
.pf-mutual-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.conn-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.conn-row .muted { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn-add { flex-wrap: wrap; }
.conn-add input { flex: 1; min-width: 140px; }
.quiet-times .field { flex: 1; }
.day-pick { gap: 4px; flex-wrap: wrap; }
.day { min-width: 44px; padding: 5px 8px; border-radius: 999px; font-size: 12px; background: var(--raised); border: 1px solid var(--line-2); }
.day.on { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.quiet-state { display: block; color: var(--mist); margin-top: 2px; }
.kw-list { flex-wrap: wrap; gap: 6px; }
.tag.kw { display: inline-flex; align-items: center; gap: 4px; }
.tag.kw button { display: grid; color: var(--dim); }

/* ---------- accessibility and accounts (build group 12, access.js) ---------- */
/* text size: message text and everything that inherits the body size */
body { font-size: calc(15px * var(--text-scale, 1)); }
.content, .composer textarea, .msg-name .name { font-size: calc(15px * var(--text-scale, 1)); }
.msg-meta time { font-size: calc(12px * var(--text-scale, 1)); }
.side-time { font-size: calc(10px * var(--text-scale, 1)); }
/* compact mode: tighter messages and smaller pictures beside them */
.compact .msg { padding-block: 0; }
.compact .msg.head { margin-top: 4px; }
.compact .msg-row { gap: 8px; }
.compact .msg-av, .compact .msg-row > .av { width: 24px !important; height: 24px !important; font-size: 10px !important; }
.compact .msg-meta { gap: 6px; }
.compact .day { margin-top: 8px; }
/* reduce motion: things fade instead of moving */
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after {
  animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
  transition-property: opacity, background-color, border-color, color !important; scroll-behavior: auto !important;
}
/* still pictures: a GIF's first frame until you point at it (or not at all) */
.att-img.still { position: relative; }
.att-img.still img { visibility: hidden; }
.att-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.att-img.still:hover img, .att-img.still:focus-visible img { visibility: visible; }
.att-img.still:hover .att-still, .att-img.still:focus-visible .att-still { display: none; }
.anim-never .att-img.still:hover img { visibility: hidden; }
.anim-never .att-img.still:hover .att-still { display: block; }
.anim-never .av.still:hover img { visibility: hidden; }
.gif-tag { position: absolute; left: 8px; bottom: 8px; padding: 1px 6px; border-radius: 4px; font: 600 11px var(--f-mono); background: #000000b0; color: #fff; }
.att-img.still:hover .gif-tag { display: none; }
.anim-never .att-img.still:hover .gif-tag { display: block; }
/* color-blind friendly roles: a stronger color plus a line pattern per role */
.role-patterns .name[style*="color"], .role-patterns .rs-gradient, .role-patterns .rs-holo { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.role-patterns .name[style*="color"] { filter: saturate(1.4) brightness(1.15); }
.role-patterns .rs-gradient { text-decoration-style: dashed; }
.role-patterns .rs-holo { text-decoration-style: wavy; }
.role-patterns .role-chip i { outline: 2px solid var(--text); outline-offset: 1px; }
/* shortcuts */
.keys-group h3 { margin: 12px 0 6px; font-size: 13px; color: var(--dim); }
.keys-group dl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 6px 14px; margin: 0; }
.keys-group dt { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.keys-group dd { margin: 0; color: var(--mist); font-size: 14px; }
kbd { font: 12px var(--f-mono); padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--raised); color: var(--text); }
/* sign in with your phone */
.qr-signin { display: grid; gap: 8px; justify-items: center; text-align: center; margin-top: 12px; }
.qr-code svg { width: 180px; height: 180px; background: #fff; border-radius: 10px; padding: 6px; }
.qr-text { font: 600 20px var(--f-mono); letter-spacing: .08em; }
.qr-state { color: var(--mist); }
.auth-accounts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; margin-top: 12px; }
.auth-accounts .btn { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- loading and polish (build group 13, boot.js and polish.js) ---------- */
/* the hand-off: the app fades in under the launch screen as it fades out */
.app.arriving { animation: app-in .45s var(--ease) both; }
@keyframes app-in { from { opacity: 0; transform: scale(.985); } }
/* skeletons where messages, channels and members will appear */
.skeleton-msgs { display: grid; gap: 14px; padding: 18px 14px; }
.sk-msg { display: flex; gap: 12px; align-items: flex-start; }
.sk-av { flex: none; width: 40px; height: 40px; border-radius: 22%; background: var(--raised); }
.sk-body { flex: 1; display: grid; gap: 7px; padding-top: 4px; }
.sk-line { display: block; height: 10px; border-radius: 5px; background: var(--raised); }
.sk-line.short { width: 120px; height: 11px; }
.sk-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.sk-dot { flex: none; width: 24px; height: 24px; border-radius: 8px; background: var(--raised); }
.sk-row .sk-line { flex: 0 1 auto; }
.compact .sk-msg { gap: 8px; } .compact .sk-av { width: 24px; height: 24px; }
@media (prefers-reduced-motion: no-preference) {
  .sk-av, .sk-line, .sk-dot { background: linear-gradient(90deg, var(--raised) 30%, var(--hover) 50%, var(--raised) 70%) 0 0 / 300% 100%; animation: sk-shine 1.6s linear infinite; }
}
@keyframes sk-shine { to { background-position: -150% 0; } }
/* badges pop when their number goes up */
.badge.bump { animation: badge-bump .5s var(--spring); }
@keyframes badge-bump { 30% { transform: scale(1.35); } }
/* press feedback: a subtle shrink on buttons and rows */
@media (prefers-reduced-motion: no-preference) {
  .btn, .icon-btn, .ch, .dm, .space-row, .nav-btn, .tile-btn, .menu-item, .post, .qs-item, .folder-btn { transition: transform .12s var(--ease), background .12s, border-color .12s; }
  .btn:active, .icon-btn:active, .ch:active, .dm:active, .space-row:active, .nav-btn:active, .tile-btn:active, .menu-item:active, .post:active, .qs-item:active, .folder-btn:active { transform: scale(.97); }
}
/* chats slide in when you switch to them */
.main.slide-in > :not(.chan-head) { animation: chat-in .28s var(--ease); }
@keyframes chat-in { from { opacity: 0; transform: translateX(10px); } }
@media (max-width: 780px) { .main.slide-in > :not(.chan-head) { animation-name: chat-in-phone; } }
@keyframes chat-in-phone { from { opacity: 0; transform: translateX(24px); } }
/* the reconnecting bar */
.offline-bar { display: flex; align-items: center; gap: 10px; }
/* empty states: a sleeping moon, drifting stars */
.empty-moon { position: relative; width: 70px; height: 70px; margin: 10px auto 24px; }
.em-moon { position: absolute; inset: 8px; border-radius: 50%; box-shadow: inset -12px -5px 0 0 var(--gold); transform: rotate(-20deg); opacity: .85; }
.em-z { position: absolute; left: 56px; top: 6px; font: 600 14px var(--f-display); color: var(--mist); opacity: 0; }
.empty-stars { position: relative; width: 120px; height: 46px; margin: 0 auto 4px; }
.empty-stars i { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); left: calc(var(--i) * 16px + 6px); top: calc(((var(--i) * 13) % 30) * 1px + 6px); opacity: .7; }
@media (prefers-reduced-motion: no-preference) {
  .em-moon { animation: moon-breathe 4s ease-in-out infinite; }
  .em-z { animation: z-float 3s ease-in infinite; }
  .em-z:nth-child(3) { animation-delay: 1s; font-size: 12px; }
  .em-z:nth-child(4) { animation-delay: 2s; font-size: 10px; }
  .empty-stars i { animation: star-drift 6s ease-in-out infinite; animation-delay: calc(var(--i) * -.8s); }
}
@keyframes moon-breathe { 50% { transform: rotate(-14deg) scale(1.04); } }
@keyframes z-float { 0% { opacity: 0; transform: translate(0, 10px); } 30% { opacity: .9; } 100% { opacity: 0; transform: translate(14px, -18px); } }
@keyframes star-drift { 50% { transform: translate(6px, -6px); opacity: .25; } }
.offline-retry { font: inherit; font-weight: 600; text-decoration: underline; color: inherit; }
#boot:not(.behind) ~ .offline-bar { display: none; }
/* the slide-in never makes the page scroll sideways */
.main.slide-in { overflow-x: clip; }
/* a stream's sound: on or off, on its tile (voice-extra.js) */
.stream-sound { display: grid; place-items: center; color: var(--online); }
.stream-sound.off { color: var(--dim); }
.tile-label > .stream-sound { color: var(--online); }
.tile-label > .stream-sound.off { color: var(--mist); }
/* the waveform that grows while you record a voice message (voice-messages.js) */
.rec-wave { flex: 1; min-width: 0; height: 28px; display: flex; align-items: center; gap: 2px; overflow: hidden; }
.rec-wave i { flex: 1; min-width: 2px; max-width: 4px; height: 10%; border-radius: 2px; background: var(--line-2); transition: height .1s linear; }
.rec-wave i.on { background: var(--dnd); }
.reduce-motion .rec-wave i { transition: none; }
@media (max-width: 480px) { .composer.recording .rec-label { display: none; } }
.head-handle { color: var(--dim); font-size: 13px; margin-left: 6px; font-weight: 400; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.bot-links { gap: 8px; margin: 12px 0 4px; }
.desk-key { gap: 12px; } .desk-key kbd { font: 12px var(--f-mono); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--mist); min-width: 150px; }

/* ---------- badges from a server admin (badges.js) ---------- */
.ubadge { display: inline-flex; align-items: center; margin-left: 4px; vertical-align: -2px; flex: none; }
.ub-verified { color: #5aa9ff; }
.ub-verified svg path:first-child { fill: currentColor; }
.ub-verified svg path:last-child { stroke: #fff; stroke-width: 2.4; }
.ub-founder { color: var(--gold); }
.ub-founder svg path:first-child { fill: currentColor; }
.pf-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pf-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--raised); border: 1px solid var(--line-2); }
.pf-badge.ub-staff { color: #7fd3a0; } .pf-badge.ub-early { color: #ffc46b; } .pf-badge.ub-bughunter { color: #c9a8ff; } .pf-badge.ub-supporter { color: #f4a6c0; }
.ap-badges .opt { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- only for server admins: the crown and the royal name ---------- */
.deco-crown::after { width: 58%; aspect-ratio: 1; left: 21%; top: -40%; transform: rotate(-14deg);
  background: linear-gradient(160deg, #fff1b8, var(--gold) 45%, #c98a1c);
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M2.5 18 4 7.5l5 4L12 4l3 7.5 5-4L21.5 18z'/><rect x='3' y='19' width='18' height='2.6' rx='1.2'/></svg>") center / contain no-repeat;
  filter: drop-shadow(0 1px 2px #0008); animation: crown-bob 3s ease-in-out infinite; }
@keyframes crown-bob { 50% { transform: rotate(-8deg) translateY(-2px); } }
.ns-royal .nm { background-image: linear-gradient(90deg, #f6d27a 0%, #fff6d0 25%, #e0a33a 50%, #fff6d0 75%, #f6d27a 100%); background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; animation: shimmer 4s linear infinite; padding-bottom: .06em; margin-bottom: -.06em; }
:is(.anim-hover, .anim-never) .ns-royal .nm { animation-play-state: paused; }
.anim-hover :is(.msg, .mem, .dm, .vc-user, .mem-who, .friend, .profile, #me-panel):hover .ns-royal .nm { animation-play-state: running; }
/* on a profile card the avatar sits at the top edge: keep the crown inside the card */
.profile .deco-crown::after { width: 46%; left: 27%; top: -22%; }

/* ---------- the front page, for people who aren't signed in (landing.js) ----------
   A night sky is the material: stars, one moon, and gold only where there is light. The safety constellation and the
   lines pinning labels to the screenshot are the same drawing. One moment of motion: the constellation draws itself. */
.landing {
  --ln-night: #0b0c12; --ln-dusk: #171b2e; --ln-ink: #ecebe6; --ln-mist: #9b9a94; --ln-line: #ffffff17;
  position: fixed; inset: 0; overflow-y: auto; overflow-x: hidden; background: var(--ln-night); color: var(--ln-ink); font-size: 17px; line-height: 1.6;
}
.landing h1, .landing h2, .landing h3 { font-family: var(--f-display); font-weight: 500; color: var(--ln-ink); margin: 0; }
.landing p { margin: 0; }
.ln-top { position: absolute; z-index: 2; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 14px; padding: 22px clamp(16px, 5vw, 64px); }
.ln-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ln-ink); text-decoration: none; font: 500 26px/1 var(--f-display); letter-spacing: .02em; }
.ln-brand.small { font-size: 20px; }
.ln-moon { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset -6px -2px 0 0 var(--gold); transform: rotate(-20deg); filter: drop-shadow(0 0 8px #f2c66d55); }
.ln-brand.small .ln-moon { width: 18px; height: 18px; box-shadow: inset -5px -2px 0 0 var(--gold); }
.ln-server { color: var(--ln-mist); font-size: 15px; }
.ln-server:not(:empty)::before { content: ''; display: inline-block; width: 1px; height: 16px; margin-right: 14px; vertical-align: -3px; background: var(--ln-line); }
.ln-top .ln-link { margin-left: auto; }
.ln-link { color: var(--ln-ink); font-size: 15px; padding: 6px 2px; border-bottom: 1px solid transparent; }
.ln-link:hover { border-bottom-color: var(--gold); }
.ln-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 999px; font-size: 16px; font-weight: 500;
  color: var(--ln-ink); border: 1px solid #ffffff55; text-decoration: none; transition: border-color .15s, background .15s; }
.ln-btn:hover { border-color: var(--ln-ink); background: #ffffff0d; }
.ln-btn.gold { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); font-weight: 600; }
.ln-btn.gold:hover { background: #f6d48a; }
.ln-btn.small { min-height: 38px; padding: 0 16px; font-size: 14px; margin-top: 12px; }
.landing :focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* the sky: deep at the top, a faint glow along the horizon, where the page's content begins */
.ln-hero { position: relative; min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: center; gap: clamp(24px, 5vw, 80px);
  padding: 120px clamp(16px, 5vw, 64px) 80px;
  background: linear-gradient(transparent 70%, var(--ln-night)), radial-gradient(120% 55% at 50% 92%, var(--ln-dusk) 0%, #11131f 45%, transparent 75%), linear-gradient(#07080c, var(--ln-night)); }
.ln-hero::after { content: ''; position: absolute; top: 96px; right: clamp(16px, 7vw, 120px); width: 74px; height: 74px; border-radius: 50%;
  box-shadow: inset -17px -7px 0 0 var(--gold); transform: rotate(-22deg); filter: drop-shadow(0 0 22px #f2c66d44); pointer-events: none; }
.ln-stars { position: absolute; inset: 0; pointer-events: none;
  -webkit-mask-image: radial-gradient(36% 34% at 25% 52%, transparent 62%, #000 100%), radial-gradient(22% 22% at 76% 70%, transparent 55%, #000 100%);
  -webkit-mask-composite: source-in; mask-composite: intersect; }
.ln-stars svg { width: 100%; height: 100%; fill: #fff; }
.ln-copy { position: relative; z-index: 1; max-width: 620px; }
.ln-copy h1 { font-size: clamp(42px, 6.2vw, 80px); line-height: 1.02; letter-spacing: -.025em; text-wrap: balance; }
.ln-lead { margin-top: 24px !important; color: #c9c8c2; font-size: clamp(17px, 1.5vw, 19px); max-width: 52ch; }
.ln-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.ln-access { margin-top: 14px !important; color: var(--ln-mist); font-size: 14px; }

/* the safety stars, the way two people check their chat is really private */
.ln-proof { position: relative; z-index: 1; margin: 0; justify-self: center; width: min(440px, 100%); display: grid; gap: 14px; }
.ln-pair { display: flex; justify-content: space-between; }
.ln-person { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--ln-mist); }
.ln-person:last-child { flex-direction: row-reverse; }
.ln-av { width: 40px; height: 40px; border-radius: 22%; display: grid; place-items: center; color: #fff; font: 600 16px var(--f-display); }
.ln-constellation { padding: 0; background: none; border: 0; }
.ln-constellation .constellation { width: 100%; }
.ln-constellation .constellation .lines line { stroke: #f2c66d88; stroke-width: 1.2; animation-duration: 2.4s; }
.ln-constellation .constellation .stars circle:not(.glow) { fill: #fff8e6; }
.ln-constellation .constellation .stars circle.glow { fill: var(--gold); opacity: .22; }
.ln-digits { display: flex; justify-content: center; gap: 18px; font: 500 20px var(--f-mono); letter-spacing: .06em; color: var(--ln-ink); }
.ln-proof figcaption { color: var(--ln-mist); font-size: 14px; text-align: center; max-width: 40ch; justify-self: center; }

/* the product, with labels pinned on */
.ln-look, .ln-private, .ln-where { padding: clamp(64px, 9vw, 120px) clamp(16px, 5vw, 64px) 0; max-width: 1240px; margin: 0 auto; }
.ln-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 32px; align-items: end; margin-bottom: 40px; }
.landing h2 { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.08; letter-spacing: -.02em; }
.ln-head p, .ln-truths p, .ln-where p { color: #c9c8c2; }
.ln-shot { position: relative; margin: 0 0 128px; }
.ln-shot img { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--ln-line); box-shadow: 0 40px 120px -40px #000, 0 0 0 6px #ffffff06; }
.ln-pin { position: absolute; bottom: -22px; width: 0; }
.ln-pin::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: linear-gradient(#f2c66dcc, #f2c66d55); }
.ln-pin-star { position: absolute; left: -5px; top: -5px; width: 11px; height: 11px; border-radius: 50%; background: #fff8e6; box-shadow: 0 0 0 4px #f2c66d33, 0 0 16px #f2c66d; }
.ln-pin-note { position: absolute; top: calc(100% + 10px); left: -8px; width: 240px; font-size: 15px; line-height: 1.45; color: #c9c8c2; }
.ln-pin-note b { display: block; color: var(--ln-ink); font-family: var(--f-display); font-weight: 500; font-size: 17px; }
.ln-pin.end .ln-pin-note { left: auto; right: -8px; text-align: right; }
.ln-pins-list { display: none; }

/* who can read what: three plain statements side by side, divided by hairlines rather than boxed */
.ln-truths { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 36px; border-top: 1px solid var(--ln-line); }
.ln-truths > div { padding: 26px 28px 0 0; }
.ln-truths > div + div { padding-left: 28px; border-left: 1px solid var(--ln-line); }
.ln-truths .ic { color: var(--gold); }
.ln-truths h3, .ln-where h3 { font-size: 20px; margin: 12px 0 6px; }

.ln-where-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin-top: 36px; }
.ln-where-item { display: flex; gap: 14px; align-items: flex-start; }
.ln-where-item[hidden] { display: none; }
.ln-where-item > .ic { color: var(--gold); margin-top: 4px; }
.ln-where-item h3 { margin-top: 0; }

.ln-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; max-width: 1240px; margin: clamp(72px, 10vw, 140px) auto 0; padding: 28px clamp(16px, 5vw, 64px) 40px; border-top: 1px solid var(--ln-line); }
.ln-foot-links { display: flex; flex-wrap: wrap; gap: 22px; margin-left: auto; font-size: 15px; }
.ln-foot-links a { color: var(--ln-mist); text-decoration: none; }
.ln-foot-links a:hover { color: var(--ln-ink); }
.ln-foot-links a[hidden] { display: none; }

/* the card's way back to the front page */
.auth-back { position: fixed; top: 18px; left: 18px; z-index: 3; display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px 6px 8px; border-radius: 999px; color: var(--text); background: #00000055; border: 1px solid #ffffff22; font-size: 14px; }
.auth-back:hover { border-color: #ffffff66; }

@media (max-width: 900px) {
  .ln-hero { grid-template-columns: 1fr; padding-top: 104px; align-items: start; }
  .ln-hero::after { display: none; }
  .ln-shot { margin-bottom: 0; }
  /* one column: stars only above the words and around the constellation, never behind text */
  .ln-stars { -webkit-mask-image: linear-gradient(#000 0 8%, transparent 12% 60%, #000 64% 82%, transparent 86%); mask-image: linear-gradient(#000 0 8%, transparent 12% 60%, #000 64% 82%, transparent 86%); -webkit-mask-composite: source-over; mask-composite: add; }
  .ln-head, .ln-truths, .ln-where-list { grid-template-columns: 1fr; }
  .ln-truths > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--ln-line); margin-top: 26px; }
  .ln-pin { display: none; }
  .ln-pins-list { display: grid; gap: 10px; margin: 22px 0 0; padding: 0; list-style: none; color: #c9c8c2; font-size: 15px; }
  .ln-pins-list b { color: var(--ln-ink); font-weight: 600; }
  .ln-server { display: none; }
}
