@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("figtree-latin-4ba7d3d096695818.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("figtree-latin-ext-bf7828e2c258cffc.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("space-grotesk-latin-0640890476fc1198.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("space-grotesk-latin-ext-952dddb45d2f96f7.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Commy Flags";
  font-display: swap;
  src: url("country-flags-9f04f14429bb6a9f.woff2") format("woff2");
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
}

:root {
  color-scheme: dark;
  --font: "Figtree", "Segoe UI", -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
  --font-display: "Space Grotesk", "Figtree", "Segoe UI", Helvetica, Arial, sans-serif;
  --chat-font-size: 16px;

  --bg-darkest: #0b0d17;
  --bg-dark: #121630;
  --bg-mid: #171c33;
  --bg-raised: #1f2438;
  --bg-hover: #232a46;
  --bg-active: #2d3554;
  --input-bg: #0e1124;
  --line: rgba(242, 239, 230, .08);

  --header-primary: #f2efe6;
  --text-normal: #e2e0da;
  --text-muted: #a9aebf;
  --text-faint: #878da5;

  --accent: #ff4d4d;
  --accent-hover: #ff6b6b;
  --accent-ink: #ffffff;
  --accent-deep: #b8222a;
  --focus: #ff6b6b;
  --green: #35c26b;
  --red: #f0433f;
  --yellow: #f3b53b;
  --link: #8fb8ff;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-press: 120ms;
  --t-hover: 160ms;

  --ink-strong: #ffffff;
  --panel: #151929;
  --line-strong: rgba(242, 239, 230, .18);
  --switch-off: #80848e;
  --mention-ink: #ffb3b3;
  --mention-me-ink: #ffd36b;
  --code-string: #e9c89b;
  --code-number: #b6e3a5;
  --saturation: 100%;

  --tx-red: #ff7d7d;
  --tx-orange: #ffa25e;
  --tx-yellow: #f7d154;
  --tx-green: #67d98a;
  --tx-teal: #4fd6cb;
  --tx-blue: #84b4ff;
  --tx-purple: #c4a0ff;
  --tx-pink: #ff8fca;
  --tx-gray: #a9aebf;
  --tx-rainbow-light: 74%;
}

:root.emoji-flag-font {
  --font: "Commy Flags", "Figtree", "Segoe UI", -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
  --font-display: "Commy Flags", "Space Grotesk", "Figtree", "Segoe UI", Helvetica, Arial, sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg-darkest: #f4f1ea;
  --bg-dark: #e8e4da;
  --bg-mid: #efece4;
  --bg-raised: #ffffff;
  --bg-hover: #e4e0d5;
  --bg-active: #d9d4c7;
  --input-bg: #ffffff;
  --line: rgba(23, 20, 16, .1);
  --header-primary: #17140f;
  --text-normal: #2a2721;
  --text-muted: #5f5b53;
  --text-faint: #7f7a71;
  --accent-hover: #e94444;
  --focus: #d23a3a;
  --green: #1e9a52;
  --red: #d8302c;
  --yellow: #a8721a;
  --link: #2456c4;
  --ink-strong: #0f0d0a;
  --panel: #ffffff;
  --line-strong: rgba(23, 20, 16, .22);
  --switch-off: #b9b3a6;
  --mention-ink: #b8222a;
  --mention-me-ink: #7a5200;
  --code-string: #8a4b00;
  --code-number: #2f6b1e;

  --tx-red: #b8262a;
  --tx-orange: #a3480a;
  --tx-yellow: #7f6100;
  --tx-green: #1c7139;
  --tx-teal: #0b6b64;
  --tx-blue: #2150c0;
  --tx-purple: #7536ad;
  --tx-pink: #a82a6f;
  --tx-gray: #5f5b53;
  --tx-rainbow-light: 24%;
  --tx-glow: #ffc94d;
}

html[data-high-contrast] {
  --text-normal: #f2efe6;
  --text-muted: #d6d4cc;
  --text-faint: #b9bccb;
  --line: rgba(242, 239, 230, .24);
  --line-strong: rgba(242, 239, 230, .45);
  --switch-off: #a5a9b5;
}
html[data-high-contrast][data-theme="light"] {
  --text-normal: #17140f;
  --text-muted: #3a362f;
  --text-faint: #4f4a42;
  --line: rgba(23, 20, 16, .28);
  --line-strong: rgba(23, 20, 16, .5);
  --switch-off: #8c867a;
}

html[data-reduced-motion] {
  --t-press: 0.01ms;
  --t-hover: 0.01ms;
}
html[data-reduced-motion] *,
html[data-reduced-motion] *::before,
html[data-reduced-motion] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

html[data-saturation] .role-ink,
html[data-saturation] .mention,
html[data-saturation] .role-tag,
html[data-saturation] .role-dot,
html[data-saturation] .presence-dot,
html[data-saturation] .live-badge,
html[data-saturation] .btn-primary,
html[data-saturation] .btn-danger,
html[data-saturation] .switch:checked,
html[data-saturation] .sidebar-link-badge,
html[data-saturation] .pin-count { filter: saturate(var(--saturation)); }

::selection { background: rgba(255, 77, 77, .35); color: var(--header-primary); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--bg-active) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-active); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: padding-box; }

* { box-sizing: border-box; margin: 0; padding: 0; }
button, input, select, textarea { font-family: inherit; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  color: var(--text-normal);
  background: var(--bg-darkest);
  overflow: hidden;
  user-select: none;
}

.app {
  display: grid;
  --sidebar-w: 248px;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) 232px;
  grid-template-rows: 60px minmax(0, 1fr);
  gap: 10px;
  padding: 0 10px 10px;
  height: 100vh;
  background: var(--bg-darkest);
}
.sidebar, .main, .members { grid-row: 2; }
.sidebar, .members, .thread-panel, .dm-profile { border-radius: var(--radius-lg); overflow: hidden; }
.main { border-radius: var(--radius-lg); position: relative; }
.sidebar { position: relative; }
.sidebar-resize {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 8px;
  cursor: col-resize;
  z-index: 3;
  touch-action: none;
}
.sidebar-resize::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--t-hover) ease;
}
.sidebar-resize:hover::after, .sidebar-resize.dragging::after { opacity: .7; }
body.sidebar-resizing { cursor: col-resize; }
@media (max-width: 700px) { .sidebar-resize { display: none; } }

.rail {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0 4px;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail-spacer { flex: 1; }
.rail-tray { display: contents; }
.composer-send { display: none; }

.rail-btn, .server-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-raised);
  color: var(--header-primary);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -.01em;
  transition: background var(--t-hover) ease, color var(--t-hover) ease;
}

.rail-btn:hover, .server-icon:hover { background: var(--bg-active); color: var(--ink-strong); }
.server-icon.active { background: var(--accent); color: var(--accent-ink); }
.server-icon { font-size: 14px; flex-shrink: 0; }

.rail-add { border-radius: 50%; width: 34px; height: 34px; color: var(--text-muted); }
.rail-add:hover { background: var(--accent); color: var(--accent-ink); }

.rail-divider {
  width: 2px;
  height: 32px;
  border-radius: 2px;
  background: rgba(242, 239, 230, .38);
  flex-shrink: 0;
}

.server-list { display: flex; flex-direction: row; align-items: center; gap: 8px; }

.sidebar {
  background: var(--bg-dark);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-header {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--header-primary);
  box-shadow: 0 1px 0 var(--line);
  cursor: default;
  white-space: nowrap;
  overflow: hidden;
}

.channel-scroll { flex: 1; overflow-y: auto; padding: 12px 8px; }
.sidebar:has(.voice-gate-pill:not(.hidden)) .channel-scroll { padding-bottom: 64px; }
.voice-gate-anchor { position: relative; flex: 0 0 0; height: 0; z-index: 5; }
.voice-gate-pill { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; background: var(--bg-darkest); box-shadow: 0 4px 14px rgba(0, 0, 0, .35); font-size: 12px; line-height: 16px; color: var(--text-normal); }
.update-chip { position: relative; flex: none; display: grid; grid-template-columns: 8px minmax(0, 1fr); align-items: start; gap: 10px 10px; margin: 0 8px 8px; padding: 12px 36px 12px 12px; border-radius: 14px; background: var(--bg-darkest); box-shadow: inset 0 0 0 1px var(--rim-soft, var(--line)), var(--shadow-1, 0 4px 14px rgba(0, 0, 0, .35)); color: var(--text-normal); font: 500 12.5px/17px var(--font); }
.update-chip-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--accent); }
.update-chip-text { min-width: 0; }
.update-chip-open { grid-column: 2; justify-self: start; border-radius: var(--radius-pill); }
.update-chip-close { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; }
.voice-gate-text { display: flex; flex-direction: column; min-width: 0; }
.voice-gate-title { font-weight: 700; }
.voice-gate-reason { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-gate-spin { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--bg-active); border-top-color: var(--yellow); animation: voice-gate-turn 1s linear infinite; }
@keyframes voice-gate-turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .voice-gate-spin { animation: none; } }
.voice-channel.voice-wait, .narrow-voice-tile.voice-wait { cursor: default; }
.voice-channel.voice-wait :is(.channel-icon, .channel-label), .narrow-voice-tile.voice-wait .narrow-voice-head { opacity: .5; }

.channel-group {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--text-faint);
  text-transform: uppercase;
  padding: 12px 8px 4px;
}

.channel {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
}

.channel:hover { background: var(--bg-hover); color: var(--text-normal); }
.channel.active { background: var(--bg-active); color: var(--ink-strong); }
.channel .hash { font-size: 17px; color: var(--text-faint); }
.channel .channel-label { overflow: hidden; text-overflow: ellipsis; }
.channel-emoji { width: 20px; height: 20px; vertical-align: -5px; margin: 0 2px 0 0; }
.channel-emoji-glyph { margin-right: .3em; }
.server-name-emoji { width: 1.1em; height: 1.1em; vertical-align: -.2em; margin: 0 .1em; }
.custom-emoji:is(.server-name-emoji, .channel-emoji):is(:not([src]), .missing) { display: none; }
.chat-header .channel-emoji { width: 22px; height: 22px; vertical-align: -6px; }
.channel-intro h2 .channel-emoji { width: 30px; height: 30px; vertical-align: -6px; margin: 0 3px; }

.channel.has-banner {
  position: relative;
  isolation: isolate;
  padding-top: 8px;
  padding-bottom: 8px;
  color: var(--text-normal);
}
.channel.has-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--channel-banner);
  background-size: cover;
  background-position: center;
  border-radius: inherit;
  opacity: .85;
}
.channel.has-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--bg-mid) 0%, rgba(23, 28, 51, .92) 45%, rgba(23, 28, 51, .35) 100%);
}
.channel.has-banner:hover::after { background: linear-gradient(90deg, var(--bg-hover) 0%, rgba(30, 36, 64, .9) 45%, rgba(30, 36, 64, .3) 100%); }
.channel.has-banner.active::after { background: linear-gradient(90deg, var(--bg-active) 0%, rgba(45, 53, 84, .9) 45%, rgba(45, 53, 84, .3) 100%); }
.channel.has-banner .hash, .channel.has-banner .channel-label { text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }

.channel.has-band {
  background: var(--channel-band);
  color: #fff;
}
.channel.has-band .hash, .channel.has-band .channel-icon { color: rgba(255, 255, 255, .8); }
.channel.has-band:hover { background: var(--channel-band); color: #fff; filter: brightness(1.08); }
.channel.has-band.active { background: var(--channel-band); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.channel.has-band .hash, .channel.has-band .channel-label { text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }

.channel-band-controls { display: flex; align-items: center; gap: 10px; flex: none; }
.channel-band-preview {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-dark);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
}
.channel-band-preview .hash { font-size: 17px; color: var(--text-faint); }
.channel-band-preview.has-band { background: var(--channel-band); color: #fff; }
.channel-band-preview.has-band .hash { color: rgba(255, 255, 255, .8); }
.channel-band-controls input[type="color"] { width: 34px; height: 34px; padding: 2px; border: none; border-radius: 8px; background: var(--bg-darkest); cursor: pointer; }

.channel-icon {
  width: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 18px;
  flex-shrink: 0;
}
.channel-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.channel:hover .channel-icon, .channel.active .channel-icon { color: var(--text-normal); }
.voice-channel.connected .channel-icon { color: var(--accent); }
.voice-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  background: var(--bg-darkest);
  border-radius: 8px;
  padding: 1px 6px;
}

.voice-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 1px 0 1px 28px;
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}
.voice-user:hover { background: var(--bg-hover); color: var(--text-normal); }
.voice-user-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-icon { display: inline-flex; color: var(--text-faint); }
.vs-icon.off { color: var(--red); }
.vs-icon.priority { color: var(--text-faint); flex-shrink: 0; }
.vs-icon.priority svg { width: 14px; height: 14px; }
.voice-user .voice-user-name { transition: opacity .15s ease; }
.voice-user.dragging { opacity: .45; }
.voice-channel.voice-drop { background: var(--bg-active); box-shadow: inset 0 0 0 2px var(--accent); }
.voice-drag-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 400;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  padding: 4px 10px 4px 6px;
  border-radius: 8px;
  background: var(--bg-raised);
  color: var(--text-normal);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
body.voice-dragging, body.voice-dragging * { cursor: grabbing !important; }
.voice-user[data-user] { -webkit-touch-callout: none; }
.voice-user.attenuated .voice-user-name { opacity: .55; }
.voice-status-line {
  margin: -2px 0 2px 32px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vp-topic { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vp-topic.editable { cursor: pointer; }
.vp-conn-meta:hover .vp-topic.editable { color: var(--text-normal); }
.voice-status-heading { display: flex; align-items: center; gap: 8px; }
.voice-status-heading svg { width: 18px; height: 18px; color: var(--text-muted); }

.avatar.avatar-sm { width: 24px; height: 24px; font-size: 10px; }

.user-panel {
  height: 44px;
  background: var(--bg-raised);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px 0 4px;
  flex-shrink: 0;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--tint, var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.user-meta { flex: 1; min-width: 0; }
.user-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-sub { font-size: 11px; color: var(--text-muted); }

.user-actions { display: flex; }

.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  transition: background var(--t-hover) ease, color var(--t-hover) ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover { background: var(--bg-hover); color: var(--text-normal); }
.icon-btn.danger { color: var(--red); }

.main {
  background: var(--bg-mid);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.chat-header {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  box-shadow: 0 1px 0 var(--line);
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--header-primary);
}

.chat-header { min-width: 0; }
.chat-header .hash { color: var(--text-faint); font-size: 22px; flex: none; }
.chat-header #channel-name { flex: 0 1 auto; min-width: 48px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-header .topic { flex: 0 100 auto; min-width: 0; }
.chat-header .search-box { flex: 0 1 208px; min-width: 112px; }
.header-actions { margin-left: auto; display: flex; gap: 4px; flex: 0 1 auto; min-width: 0; align-items: center; }
@media (max-width: 1400px) and (min-width: 701px) {
  .chat-header .topic { display: none; }
}
.header-actions .icon-btn.active { color: var(--red); }

.video-pane {
  background: #000;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
  border-bottom: 1px solid var(--bg-darkest);
  display: flex;
  flex-direction: column;
  max-height: 55%;
}

.video-pane img, .video-pane .stage-frame {
  width: 100%;
  object-fit: contain;
  min-height: 0;
  flex: 1;
  background: #000;
}

.video-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--bg-darkest);
  font-size: 13px;
  color: var(--text-muted);
}

.btn-small { padding: 5px 10px; font-size: 13px; }

.attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-dark);
  border: 1px solid var(--bg-darkest);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-top: 6px;
  max-width: 420px;
}

.attachment .file-icon { color: var(--accent); flex-shrink: 0; }
.attachment .file-meta { flex: 1; min-width: 0; }
.attachment .file-name { font-weight: 600; color: var(--header-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachment .file-size { font-size: 12px; color: var(--text-muted); }

.live-badge {
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 6px;
  padding: 1px 5px;
  margin-left: 6px;
  cursor: pointer;
}
.chat-header .topic {
  font-family: var(--font);
  font-weight: 400;
  color: var(--text-muted);
  font-size: 13px;
  border-left: 1px solid var(--bg-active);
  padding-left: 8px;
  margin-left: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.msg { display: flex; gap: 16px; padding: 4px 8px; border-radius: var(--radius-sm); }
.msg:hover { background: rgba(0,0,0,.12); }
.msg.first { margin-top: 12px; }

.msg .avatar { width: 40px; height: 40px; }
.msg .avatar.spacer { visibility: hidden; height: 0; }

.msg-body { min-width: 0; flex: 1; user-select: text; }
.msg-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.msg-head > * { flex: none; white-space: nowrap; }
.msg-author { font-weight: 600; color: var(--header-primary); }
.msg-head > .msg-author { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.msg-time { font-size: 12px; color: var(--text-muted); }
.msg-content { color: var(--text-normal); line-height: 1.4; word-wrap: break-word; }
.msg-content .edited { font-size: 10px; color: var(--text-faint); }

.empty-state {
  margin: auto;
  text-align: center;
  color: var(--text-muted);
  max-width: 440px;
}
.empty-state h3 { color: var(--header-primary); margin-bottom: 8px; font-size: 24px; font-family: var(--font-display); letter-spacing: -.01em; }

.channel-intro { margin-top: auto; padding: 24px 8px 8px; }
.channel-intro-banner {
  height: 180px;
  border-radius: var(--radius);
  background-size: cover;
  background-position: center;
  margin-bottom: 20px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.channel-intro-mark {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--bg-raised);
  color: var(--header-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.channel-intro-hash { font-family: var(--font-display); font-size: 34px; font-weight: 700; line-height: 1; }
.channel-intro h2 { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -.01em; color: var(--header-primary); margin-bottom: 6px; }
.channel-intro p { color: var(--text-muted); font-size: 15px; line-height: 1.5; max-width: 60ch; }

.day-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 8px 6px;
  color: var(--text-faint);
}
.day-divider::before, .day-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.day-divider-label { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.day-divider + .msg.first { margin-top: 4px; }

.new-divider {
  display: flex;
  align-items: center;
  height: 20px;
  margin: 0 8px -2px;
  flex: none;
  pointer-events: none;
}
.new-divider::before { content: ""; flex: 1; height: 1px; background: var(--accent); }
.new-divider-label {
  flex: none;
  height: 14px;
  line-height: 14px;
  padding: 0 5px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}

.composer {
  margin: 0 12px 12px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  transition: border-color var(--t-hover) ease;
}
.composer:focus-within { border-color: var(--line-strong); }

.composer input, .composer textarea {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-normal);
  font-size: 15px;
  padding: 12px 8px;
  font-family: inherit;
}
.composer textarea {
  resize: none;
  line-height: 22px;
  min-height: 46px;
  max-height: 222px;
  overflow-y: auto;
  align-self: stretch;
  scrollbar-width: thin;
}

.composer input::placeholder, .composer textarea::placeholder { color: var(--text-faint); }

.members {
  background: var(--bg-dark);
  overflow-y: auto;
  padding: 16px 8px;
}

.member-group {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--text-faint);
  text-transform: uppercase;
  padding: 12px 10px 4px;
}

.member-more {
  display: block;
  width: calc(100% - 16px);
  margin: 4px 8px 8px;
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: var(--bg-active);
  color: var(--text-muted);
  font: 600 12px/16px var(--font);
  cursor: pointer;
}

.member-more:hover { color: var(--text-normal); }

.member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.member:hover { background: var(--bg-hover); }
.member.offline { opacity: .4; }

.member .avatar { width: 32px; height: 32px; position: relative; }

.presence-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 3px solid var(--bg-dark);
  position: absolute;
  right: -2px;
  bottom: -2px;
  background: var(--text-faint);
}

.presence-dot.online { background: var(--green); }
.presence-dot.idle { background: var(--yellow); }
.presence-dot.do_not_disturb { background: var(--red); }
.presence-dot.phone { height: auto !important; aspect-ratio: 5 / 7; border-radius: 32% / 22%; background: var(--bg-dark); }
.presence-dot.phone::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: inherit; }
.presence-dot.phone::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--text-muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 14'%3E%3Crect x='1.6' y='1.1' width='6.8' height='11.8' rx='1.7' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3Cpath d='M4 10.4h2' stroke='%23000' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 14'%3E%3Crect x='1.6' y='1.1' width='6.8' height='11.8' rx='1.7' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3Cpath d='M4 10.4h2' stroke='%23000' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.member-name { font-size: 14px; font-weight: 500; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 160;
}

.modal {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 440px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,.5);
}

.modal-close { display: none; }
.modal h2 { font-size: 20px; color: var(--header-primary); font-family: var(--font-display); letter-spacing: -.01em; }
.modal p { font-size: 14px; color: var(--text-muted); }

.modal input[type="text"], .modal input[type="password"], .modal textarea {
  background: var(--input-bg);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text-normal);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  resize: none;
  user-select: text;
}

.modal-divider {
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 700;
}

.btn-primary, .btn-secondary {
  border: none;
  border-radius: var(--radius-pill);
  padding: 11px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-active); color: var(--header-primary); }
.btn-secondary:hover { background: var(--header-primary); color: var(--bg-darkest); }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  cursor: pointer;
}

.setting-title { font-weight: 600; }
.setting-sub { font-size: 13px; color: var(--text-muted); }
.file-store-status { margin: 6px 0; }
.file-store-status:empty { display: none; }
.setting-hint { margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--text-faint); }

.switch {
  appearance: none;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--switch-off);
  position: relative;
  cursor: pointer;
  transition: background .15s;
  flex-shrink: 0;
}

.switch:checked { background: var(--accent); }

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: left var(--t-hover) var(--ease-out);
}

.switch:checked::after { left: 23px; }
.switch:disabled { opacity: .5; cursor: default; }

.emoji-picker {
  position: absolute;
  bottom: 80px;
  right: 12px;
  width: 408px;
  height: 468px;
  overflow: hidden;
  background: var(--bg-dark);
  border: 1px solid var(--bg-darkest);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 8px;
  z-index: 50;
}

.emoji-picker input {
  background: var(--bg-darkest);
  border: none;
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text-normal);
  font-size: 14px;
  outline: none;
  font-family: inherit;
}

.emoji-grid {
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
}

.emoji-grid button {
  background: none;
  border: none;
  font-size: 22px;
  padding: 4px;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1.2;
}

.emoji-grid button:hover { background: var(--bg-active); }

.main { position: relative; }

.chat-image {
  display: block;
  max-width: 400px;
  max-height: 300px;
  border-radius: var(--radius);
  margin-top: 6px;
  cursor: zoom-in;
  background: var(--bg-darkest);
}

.chat-image.waiting { min-width: 240px; min-height: 160px; }

.image-missing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-sizing: border-box;
  width: 240px;
  height: 160px;
  margin-top: 6px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--bg-darkest);
  color: var(--text-muted);
  text-align: center;
}
.image-missing-title { font-weight: 600; color: var(--header-primary); }
.image-missing-hint { font-size: 12px; line-height: 1.3; min-height: 2.6em; }
.image-missing-retry { margin-top: 2px; min-width: 92px; }
.image-missing-retry:disabled { opacity: .6; cursor: default; }
.image-missing.pin-thumb { width: 180px; height: 110px; padding: 6px; gap: 2px; }
.image-missing.pin-thumb svg, .image-missing.pin-thumb .image-missing-hint { display: none; }

.image-embed { margin-top: 6px; }
.image-embed .chat-image { margin-top: 2px; }

.image-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 150px;
  gap: 4px;
  width: 440px;
  max-width: 100%;
  margin-top: 6px;
  border-radius: var(--radius);
  overflow: hidden;
}
.image-grid.grid-2 { grid-auto-rows: 220px; }
.image-grid.grid-3 > :first-child { grid-row: span 2; }
.image-grid .image-embed { margin: 0; min-width: 0; min-height: 0; background: var(--bg-darkest); }
.image-grid .embed-source { display: none; }
.image-grid .chat-image {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  min-width: 0;
  min-height: 0;
  margin: 0;
  border-radius: 0;
  object-fit: cover;
}
.image-grid .image-gate {
  height: 100%;
  max-width: none;
  margin: 0;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  border: none;
  border-radius: 0;
}
.image-grid .image-gate-text { flex: 0 0 auto; width: 100%; }

.link-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px 14px;
  width: max-content;
  max-width: min(440px, 100%);
  margin-top: 6px;
  padding: 12px 14px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.link-card.side { grid-template-columns: minmax(0, 1fr) 80px; }
.link-card-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.link-card-site {
  font-size: 12px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.link-card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--header-primary);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.link-card-title:hover { text-decoration: underline; }
.link-card-description {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.link-card-image {
  max-width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-darkest);
}
.link-card.side .link-card-image { grid-column: 2; grid-row: 1; align-self: start; }
.link-card-image img { display: block; width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.link-card-image.missing { display: flex; align-items: center; justify-content: center; color: var(--text-muted); }

.poll {
  width: 100%;
  max-width: 460px;
  margin-top: 6px;
  padding: 14px 16px 12px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.poll-question {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--header-primary);
  overflow-wrap: anywhere;
}
.poll-hint { font-size: 12px; color: var(--text-faint); margin-top: -6px; }
.poll-options { display: flex; flex-direction: column; gap: 6px; }
.poll-option {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-dark);
  color: var(--text-normal);
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}
.poll-option:disabled { cursor: default; }
.poll-option:hover:not(:disabled) { border-color: var(--bg-active); }
.poll-option.mine { border-color: var(--accent); }
.poll-option.mine:hover:not(:disabled) { border-color: var(--accent-hover); }
.poll-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  background: var(--bg-active);
  transition: width 240ms var(--ease-out);
}
.poll-option.mine .poll-fill { background: rgba(255, 77, 77, .26); }
.poll-mark {
  position: relative;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1.5px solid var(--text-faint);
  color: transparent;
}
.poll-option.multi .poll-mark { border-radius: 5px; }
.poll-option.mine .poll-mark { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.poll-text { position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poll-count {
  position: relative;
  min-width: 72px;
  text-align: right;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}
.poll-count strong { color: var(--header-primary); font-weight: 600; }
.poll-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 26px;
  font-size: 13px;
  color: var(--text-muted);
}
.poll.closed .poll-status { color: var(--header-primary); font-weight: 600; }
.poll-close {
  background: none;
  border: 1px solid var(--line);
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  padding: 4px 11px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.poll-close:hover { border-color: var(--accent); color: var(--header-primary); }

.poll-rows { display: flex; flex-direction: column; gap: 6px; }
.poll-row { display: flex; gap: 6px; align-items: center; }
.poll-row input[type="text"] { flex: 1; min-width: 0; }
.poll-row-remove {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: none;
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.poll-row-remove:hover:not(:disabled) { background: var(--red); color: #fff; }
.poll-row-remove:disabled { opacity: .3; cursor: default; }
.poll-add {
  align-self: flex-start;
  background: none;
  border: 1px dashed var(--text-faint);
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.poll-add:hover:not(:disabled) { color: var(--header-primary); border-color: var(--header-primary); }
.poll-add:disabled { opacity: .4; cursor: default; }
.modal .poll-switch { padding: 4px 0; cursor: default; }

.composer { position: relative; }
.typing-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 22px;
  padding: 0 14px;
  font-size: 13px;
  color: var(--text-muted);
  visibility: hidden;
}
.typing-strip.on { visibility: visible; }
.typing-strip strong { color: var(--text-normal); font-weight: 600; }
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: .35;
  animation: typing-dot 1.4s ease-in-out infinite;
}
.typing-dots i:nth-child(2) { animation-delay: .2s; }
.typing-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes typing-dot {
  0%, 60%, 100% { opacity: .35; }
  30% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .typing-dots i { animation: none; opacity: .7; }
}
.link-draft {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 360px;
  max-width: 100%;
  height: 52px;
  padding: 0 6px 0 6px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.reply-bar:not(.hidden) ~ .composer .link-draft { bottom: calc(100% + 44px); }
.link-draft-thumb {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-active);
  color: var(--text-muted);
}
.link-draft-thumb img { width: 100%; height: 100%; object-fit: cover; }
.link-draft-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.link-draft-title, .link-draft-site { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-draft-title { font-size: 13px; font-weight: 600; color: var(--header-primary); }
.link-draft-site { font-size: 12px; color: var(--text-faint); }
.link-draft .icon-btn { width: 28px; height: 28px; flex-shrink: 0; }
.link-draft.off { border-style: dashed; }
.link-draft.off .link-draft-thumb { color: var(--text-faint); }
.link-draft.off .link-draft-title { color: var(--text-muted); }
.link-draft .icon-btn > svg { width: 16px; height: 16px; }
.embed-source {
  display: inline-block;
  max-width: 400px;
  font-size: 12px;
  color: var(--text-faint);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.embed-source:hover { color: var(--text-normal); text-decoration: underline; }

.image-gate {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 400px;
  margin-top: 2px;
  padding: 10px 12px;
  background: var(--bg-dark);
  border: 1px solid var(--bg-darkest);
  border-radius: var(--radius);
}
.image-gate-text { flex: 1; min-width: 0; }
.image-gate-title { font-weight: 600; color: var(--header-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.image-gate-hint { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.image-gate-load { flex-shrink: 0; min-width: 92px; }
.image-gate-load:disabled { opacity: .6; cursor: default; background: var(--bg-active); color: var(--header-primary); }
.attachment-gate { margin-top: 6px; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: zoom-out;
}
.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius);
}
.lightbox-source {
  color: var(--text-faint);
  font-size: 13px;
  text-decoration: none;
  max-width: 90vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lightbox-source.linked { cursor: pointer; }
.lightbox-actions { display: flex; gap: 8px; min-height: 30px; }
.lightbox-action { display: inline-flex; align-items: center; gap: 6px; }
.lightbox-source.linked:hover { color: #fff; text-decoration: underline; }

.dm-thread { flex-direction: row; align-items: center; gap: 10px; padding: 8px; }
.dm-thread .avatar { width: 32px; height: 32px; flex-shrink: 0; }
.dm-meta { min-width: 0; flex: 1; }
.dm-name { font-weight: 600; font-size: 14px; color: var(--text-normal); }
.dm-preview { font-size: 12px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.header-btns { display: flex; }
.inline-row { display: flex; gap: 8px; align-items: center; }
.inline-row input[type="text"] { flex: 1; min-width: 0; }

.manage-list { display: flex; flex-direction: column; gap: 6px; }
.manage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-dark);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  transition: border-color .12s;
}
.manage-row:hover { border-color: var(--bg-active); }
.manage-row-label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.manage-row .kind,
.role-card .kind {
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .02em;
  background: var(--bg-darkest);
  border-radius: 6px;
  padding: 2px 6px;
}
.manage-empty { color: var(--text-faint); font-size: 14px; padding: 16px 0; text-align: center; }
.channel-order-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.channel-order-bar > .setting-sub { margin: 0; min-width: 0; }
.channel-order-bar > .btn-small { flex: none; }
.settings-page .channel-order-bar + .manage-list { margin-top: 10px; }
.manage-row.manage-section .channel-icon { color: var(--text-faint); }
.manage-row.manage-child { margin-left: 16px; }
.order-keys { display: flex; gap: 6px; flex: none; }
.btn-small.order-key { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border-radius: 50%; }
.btn-small.order-key:disabled { opacity: .35; cursor: default; }

.btn-danger {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 11px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn-danger:hover { filter: brightness(.85); }

.field-label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-muted); }

.modal select {
  background: var(--bg-darkest);
  border: none;
  border-radius: 6px;
  padding: 10px;
  color: var(--text-normal);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.user-meta { cursor: pointer; border-radius: 6px; padding: 2px 4px; }
.user-meta:hover { background: var(--bg-hover); }

.slider-row { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.slider-row .setting-title span[id] { color: var(--text-muted); font-weight: 400; font-size: 13px; }
input[type="range"] {
  appearance: none;
  height: 8px;
  border-radius: 6px;
  background: var(--bg-darkest);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.share-source-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 320px;
  overflow-y: auto;
}
.share-source {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-dark);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  color: var(--text-normal);
  font-size: 14px;
  font-family: inherit;
  width: 100%;
}
.share-source:hover { border-color: var(--accent); background: var(--bg-hover); }
.share-source .src-kind {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-faint);
  flex-shrink: 0;
  width: 60px;
}
.share-source .src-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.perm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  font-size: 13px;
  color: var(--text-muted);
}
.perm-grid label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.perm-grid input { flex: none; margin: 2px 0 0; }
.perm-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.perm-name { line-height: 18px; color: var(--text-normal); }
.perm-hint { font-size: 12px; line-height: 16px; color: var(--text-faint); }
.chat-access .chat-access-row { padding: 10px 0 0; border-top: 1px solid var(--line); }
.chat-access .chat-access-row > div { flex: 1; min-width: 0; }
.chat-access .chat-access-row .setting-title { margin: 0; font-size: 14px; }
.chat-access .chat-access-row .setting-sub { margin: 2px 0 0; }
.chat-access .switch { flex: none; }

.role-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  background: var(--text-faint);
  flex-shrink: 0;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  border: 1px solid var(--bg-active);
  border-radius: 10px;
  padding: 1px 8px;
  margin-left: 4px;
  cursor: pointer;
  color: var(--text-muted);
}
.role-chip.held { border-color: var(--accent); color: var(--text-normal); }
.role-chip:hover { background: var(--bg-hover); }

.manage-member-row { flex-direction: column; align-items: stretch; gap: 8px; }
.row-more { width: 32px; height: 32px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--text-muted); }
.row-more:hover { background: var(--bg-hover); color: var(--header-primary); }
.manage-member-row .manage-row-label .timeout-badge { margin-left: 2px; }
.mod-who { display: flex; align-items: center; gap: 10px; background: var(--bg-dark); border-radius: var(--radius); padding: 10px 12px; font-size: 14px; font-weight: 600; color: var(--header-primary); margin: 4px 0 12px; }
.modal-moderate p { margin: 0 0 14px; color: var(--text-muted); line-height: 1.45; }
.modal-moderate .modal-actions .btn-danger { min-width: 96px; }
.manage-member-row .row-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.role-chips { display: flex; flex-wrap: wrap; gap: 4px; padding-left: 32px; }
.role-chips .role-chip { margin-left: 0; padding: 3px 10px; font-size: 12px; font-weight: 500; }

.msg-content a { color: var(--link); text-decoration: none; }
.msg-content a:hover { text-decoration: underline; }

.drop-hint {
  outline: 2px dashed var(--accent);
  outline-offset: -8px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-darkest);
  color: var(--text-normal);
  padding: 10px 18px;
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
  z-index: 200;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(520px, calc(100vw - 48px));
}

.toast-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast.toast-click { cursor: pointer; border: 1px solid transparent; }
.toast.toast-click:hover { background: var(--bg-dark); border-color: var(--bg-mid); }
.toast-avatar { width: 24px; height: 24px; font-size: 10px; position: relative; }
.toast-avatar .presence-dot { width: 8px; height: 8px; border-width: 2px; border-color: var(--bg-darkest); right: -3px; bottom: -3px; }

.hidden { display: none !important; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: var(--bg-darkest); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

.msg-content { font-size: var(--chat-font-size); line-height: 1.375; }
.msg-author { font-size: calc(var(--chat-font-size) + 1px); font-weight: 600; }
.chat-header { font-size: 16px; }
.sidebar-header { font-size: 15px; }
.channel-group, .member-group { letter-spacing: .04em; font-size: 12px; font-weight: 600; }
.modal h2 { font-weight: 700; }
.empty-state h3 { font-weight: 800; }

body.compact .msg { padding-top: 1px; padding-bottom: 1px; }
body.compact .msg.first { margin-top: 6px; }
body.compact .msg .avatar { width: 32px; height: 32px; font-size: 12px; }

.modal { border-radius: var(--radius-lg); }
.btn-primary, .btn-secondary, .btn-danger { transition: background var(--t-hover) ease, color var(--t-hover) ease, filter var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.btn-primary:active, .btn-secondary:active, .btn-danger:active { transform: scale(.97); }
.btn-small { padding: 7px 14px; font-size: 13px; }
.modal input[type="text"], .modal textarea, .modal select,
.settings-layer input[type="text"], .settings-layer input[type="password"], .settings-layer select, .settings-layer textarea {
  border: 1px solid transparent;
  transition: border-color var(--t-hover) ease;
}
.modal input[type="text"]:focus, .modal textarea:focus, .modal select:focus,
.settings-layer input[type="text"]:focus, .settings-layer select:focus, .settings-layer textarea:focus {
  border-color: var(--focus);
  outline: none;
}

.settings-layer {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  padding: 10px;
  gap: 10px;
  background: var(--bg-darkest);
  animation: settings-in .16s ease-out;
}
.settings-nav { border-radius: var(--radius-lg); }
.settings-content { background: var(--bg-mid); border-radius: var(--radius-lg); }
@media (prefers-reduced-motion: reduce) { .settings-layer { animation: none; } }
@keyframes settings-in {
  from { opacity: 0; transform: scale(1.03); }
  to { opacity: 1; transform: none; }
}

.settings-nav {
  flex: 1 0 218px;
  background: var(--bg-dark);
  display: flex;
  justify-content: flex-end;
  overflow-y: auto;
}
.settings-nav-inner {
  width: 218px;
  align-self: flex-start;
  padding: 60px 6px 60px 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.settings-nav-group {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-faint);
  padding: 6px 10px;
  margin-top: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.settings-nav-group:first-child { margin-top: 0; }
.settings-nav-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--header-primary);
  padding: 0 10px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.settings-nav-title + .settings-nav-group { margin-top: 8px; }
.settings-tab {
  background: none;
  border: none;
  text-align: left;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--t-hover) ease, color var(--t-hover) ease;
}
.settings-tab:hover { background: var(--bg-hover); color: var(--text-normal); }
.settings-tab.active { background: var(--bg-active); color: var(--header-primary); }
.settings-tab.danger { color: var(--red); }
.settings-tab.danger:hover { background: rgba(242, 63, 67, .1); }
.settings-nav-sep { height: 1px; background: var(--bg-active); margin: 10px 10px; }
.settings-nav-inner > * { flex-shrink: 0; }
.settings-search-wrap { position: relative; margin-bottom: 14px; }
.settings-search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}
.settings-search {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 36px;
  background: var(--input-bg);
  color: var(--text-normal);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 14px;
  transition: border-color var(--t-hover) ease;
}
.settings-search::placeholder { color: var(--text-faint); }
.settings-search:focus { border-color: var(--line-strong); }
.settings-search:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--focus); }
.settings-search::-webkit-search-cancel-button { cursor: pointer; }
.settings-nav-inner.searching > :is(.settings-tab, .settings-nav-group, .settings-nav-sep) { display: none; }
.settings-search-results { display: flex; flex-direction: column; gap: 2px; }
.settings-search-result {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  width: 100%;
  padding: 7px 12px;
  background: none;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--t-hover) ease;
}
.settings-search-result:hover, .settings-search-result:focus-visible { background: var(--bg-hover); outline: none; }
.settings-search-result.active { background: var(--bg-active); }
.ssr-title { font-size: 15px; font-weight: 500; color: var(--text-normal); }
.ssr-place { font-size: 12px; color: var(--text-faint); }
.settings-search-empty { padding: 7px 12px; font-size: 14px; color: var(--text-faint); }
.settings-intro { margin: -12px 0 20px; font-size: 14px; line-height: 1.45; color: var(--text-muted); }
.settings-hit { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }

.settings-content {
  flex: 1 1 800px;
  display: flex;
  overflow-y: auto;
  user-select: text;
}
.settings-content-inner {
  width: 100%;
  max-width: 740px;
  padding: 60px 40px 80px;
}
.settings-page h1 {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: -.01em;
  color: var(--header-primary);
  margin-bottom: 20px;
}
.settings-subhead {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin: 28px 0 8px;
}
.settings-card {
  background: var(--bg-dark);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 12px;
}
.settings-card.setting-row { flex-direction: row; padding: 16px; }
.settings-page .setting-title { font-size: 15px; color: var(--header-primary); }
.settings-page .setting-sub { margin-top: 2px; line-height: 1.4; }
.settings-page .field-label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.settings-page input[type="text"], .settings-page input[type="password"], .settings-page select, .settings-page textarea {
  background: var(--input-bg);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
  resize: none;
  color: var(--text-normal);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  user-select: text;
}
.settings-page input[type="text"]:disabled { opacity: .6; cursor: not-allowed; }
.settings-page input[type="color"] {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 6px;
  background: none;
  cursor: pointer;
  padding: 0;
}
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.form-actions .btn-primary { padding: 9px 18px; font-size: 14px; }
.settings-page .slider-row { gap: 10px; }
.settings-page .slider-row .setting-title { display: flex; justify-content: space-between; }
.settings-page input[type="range"] { width: 100%; }
.settings-page .perm-grid { gap: 8px 16px; font-size: 14px; }
.settings-page .perm-grid input { accent-color: var(--accent); width: 16px; height: 16px; }
.settings-page .manage-list { margin-top: 16px; }

.settings-close-wrap {
  flex: 0 0 auto;
  padding: 60px 24px 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: sticky;
  top: 0;
  align-self: flex-start;
}
.settings-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--text-faint);
  background: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.settings-close:hover { background: var(--bg-hover); color: var(--ink-strong); border-color: var(--ink-strong); }
.settings-close-key { font-size: 13px; font-weight: 600; color: var(--text-faint); }

.profile-card { background: var(--bg-darkest); border-radius: 12px; overflow: hidden; }
.profile-banner .role-banner-tools { top: 10px; bottom: auto; }
.profile-banner { position: relative; height: 100px; background: linear-gradient(135deg, var(--accent), var(--accent-deep)); background-size: cover; background-position: center; }
.profile-body { display: flex; align-items: flex-end; gap: 16px; padding: 0 16px; margin-top: -40px; }
.avatar.avatar-xl {
  width: 88px;
  height: 88px;
  font-size: 32px;
  font-weight: 700;
  border: 6px solid var(--bg-darkest);
}
.profile-names { padding-bottom: 8px; min-width: 0; }
.profile-display { font-size: 20px; font-weight: 700; color: var(--header-primary); font-family: var(--font-display); letter-spacing: -.01em; }
.profile-username { font-size: 14px; color: var(--text-muted); }
.profile-fields {
  margin: 16px;
  background: var(--bg-dark);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.appearance-preview {
  background: var(--bg-mid);
  border: 1px solid var(--bg-active);
  border-radius: var(--radius);
  padding: 8px 8px 16px;
  margin-bottom: 12px;
  pointer-events: none;
}
.appearance-preview .avatar { width: 40px; height: 40px; }

.overview-card { flex-direction: row; align-items: center; gap: 20px; }
.server-icon.server-icon-xl {
  width: 80px;
  height: 80px;
  font-size: 26px;
  font-weight: 700;
  border-radius: 24px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: default;
  flex-shrink: 0;
}
.server-icon.server-icon-xl:hover { background: var(--accent); color: var(--accent-ink); }
.overview-fields { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.settings-page input[type="range"] {
  background: linear-gradient(to right, var(--accent) var(--fill, 50%), var(--bg-darkest) var(--fill, 50%));
}
.settings-page input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.manage-row .btn-danger,
.role-form .btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(242, 63, 67, .5);
}
.manage-row .btn-danger:hover,
.role-form .btn-danger:hover { background: var(--red); color: #fff; filter: none; }

.app.dm-mode { grid-template-columns: var(--sidebar-w) minmax(0, 1fr) auto; }
.app.members-collapsed:not(.dm-mode):not(.thread-open) { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.app.members-collapsed #member-list { display: none; }
#members-btn.active { color: var(--header-primary); }
.app.dm-mode .dm-profile { grid-row: 2; }

.dm-search {
  width: 100%;
  height: 28px;
  background: var(--bg-darkest);
  border: none;
  border-radius: 6px;
  padding: 0 8px;
  color: var(--text-normal);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  user-select: text;
}
.dm-search::placeholder { color: var(--text-faint); }
.sidebar-header:has(.dm-search:not(.hidden)) { padding: 0 10px; }

.dm-group { display: flex; align-items: center; justify-content: space-between; padding-right: 4px; }
.dm-group-add {
  background: none;
  border: none;
  color: var(--text-faint);
  display: inline-flex;
  cursor: pointer;
  border-radius: 6px;
  padding: 2px;
}
.dm-group-add:hover { color: var(--text-normal); }
.dm-list-empty { font-size: 13px; color: var(--text-faint); padding: 8px 10px; line-height: 1.4; }

.dm-thread { padding: 6px 8px; margin-bottom: 2px; }
.dm-thread .avatar, .person-row .avatar { position: relative; }
.dm-thread .presence-dot, .person-row .presence-dot { border-color: var(--bg-dark); }
.dm-thread:hover .presence-dot { border-color: var(--bg-hover); }
.dm-thread.active .presence-dot { border-color: var(--bg-active); }
.dm-top { display: flex; align-items: baseline; gap: 6px; }
.dm-top .dm-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-time { font-size: 11px; color: var(--text-faint); flex-shrink: 0; }
.dm-thread .dm-name { font-weight: 500; color: var(--text-muted); }
.dm-thread:hover .dm-name, .dm-thread.active .dm-name { color: var(--ink-strong); }

.presence-dot.inline {
  position: relative;
  right: auto;
  bottom: auto;
  display: inline-block;
  width: 10px;
  height: 10px;
  border: none;
  margin-left: -2px;
}
#dm-profile-btn.active { color: var(--text-normal); }

.dm-intro { margin-top: auto; padding: 16px 8px 8px; }
.dm-intro .avatar-xl { width: 80px; height: 80px; font-size: 30px; margin-bottom: 12px; }
.dm-intro h2 { font-size: 30px; font-weight: 800; color: var(--header-primary); margin-bottom: 6px; }
.dm-intro p { color: var(--text-muted); font-size: 15px; }
.dm-intro strong { color: var(--text-normal); font-weight: 600; }
.dm-intro-mutual {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-dark);
  border-radius: 12px;
  padding: 3px 10px;
}
.dm-intro + .msg.first { margin-top: 20px; }

.dm-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dm-empty-art {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: var(--bg-dark);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.dm-empty p { line-height: 1.5; }

.welcome-home { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 460px; }
.welcome-mark { width: 72px; height: 72px; border-radius: 22px; margin-bottom: 4px; }
.welcome-home h3 { font-size: 28px; margin-bottom: 0; }
.welcome-home p { line-height: 1.55; font-size: 15px; }
.welcome-actions { display: flex; gap: 10px; margin-top: 12px; }
.welcome-actions button { padding: 11px 22px; }

.sw-head { display: flex; align-items: center; gap: 14px; }
.sw-icon { width: 56px; height: 56px; font-size: 18px; cursor: default; background: var(--bg-active); }
.sw-icon:hover { background: var(--bg-active); color: var(--header-primary); }
.sw-titles { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sw-titles h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-steps { display: flex; gap: 6px; margin-top: 4px; }
.sw-step {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
}
.sw-step.active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.sw-step.done { color: var(--text-muted); border-color: transparent; background: var(--bg-active); }
.sw-roles { display: flex; flex-direction: column; gap: 4px; }
.sw-roles-hint { font-size: 14px; color: var(--text-muted); line-height: 1.45; }
#sw-rules { margin: 4px 0; }
#sw-role-list { margin: 8px 0 0; }
.dm-empty .btn-primary { padding: 10px 20px; margin-top: 8px; }

.dm-profile {
  width: 300px;
  background: var(--bg-dark);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.dm-profile-banner { height: 120px; flex-shrink: 0; }
.dm-profile-head { padding: 0 16px; margin-top: -48px; }
.avatar.avatar-lg {
  width: 88px;
  height: 88px;
  font-size: 32px;
  position: relative;
  border: 6px solid var(--bg-dark);
}
.avatar-lg .presence-dot { width: 24px; height: 24px; border-width: 5px; right: 0; bottom: 0; border-color: var(--bg-dark); }
.dm-profile-card {
  margin: 12px 16px 16px;
  background: var(--bg-darkest);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dm-profile-name { font-size: 20px; font-weight: 700; color: var(--header-primary); font-family: var(--font-display); letter-spacing: -.01em; }
.dm-profile-status { font-size: 14px; color: var(--text-muted); }
.dm-profile-divider { height: 1px; background: var(--bg-active); margin: 10px 0; }
.dm-profile-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.dm-profile-servers { display: flex; flex-direction: column; gap: 2px; }
.dm-profile-server {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  border-radius: 6px;
  padding: 6px;
  color: var(--text-normal);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.dm-profile-server:hover { background: var(--bg-hover); }
.server-chip {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-active);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.people-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; margin: 0 -8px; }
.person-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  border-radius: 6px;
  padding: 8px;
  color: var(--text-normal);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.person-row:hover { background: var(--bg-hover); }
.person-row .presence-dot { border-color: var(--bg-mid); }
.person-row:hover .presence-dot { border-color: var(--bg-hover); }

.voice-panel {
  background: var(--bg-darkest);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0 8px 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vp-conn { display: flex; align-items: center; gap: 2px; }
.vp-voice { display: flex; gap: 8px; }
.vp-voice .split-btn, .vp-voice > .icon-btn {
  flex: 1;
  min-width: 0;
  height: 34px;
  border-radius: 8px;
  background: var(--bg-hover);
}
.vp-voice .split-btn { display: flex; align-items: stretch; overflow: hidden; }
.vp-voice .split-btn .icon-btn { flex: 1; height: 34px; border-radius: 0; }
.vp-voice .split-btn .caret-btn { width: 20px; height: 34px; border-radius: 0; border-left: 1px solid var(--bg-darkest); }
.vp-voice .icon-btn:hover, .vp-voice .caret-btn:hover { background: var(--bg-active); }
.vp-voice .icon-btn.danger { color: var(--red); }
.vp-voice #vp-camera.active { background: var(--accent); color: var(--accent-ink); }
.vp-voice #vp-camera.active:hover { background: var(--accent-hover); }
.vp-voice .icon-btn > svg { width: 20px; height: 20px; }
.vp-conn-meta { flex: 1; min-width: 0; cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.vp-conn-meta:hover .vp-where { color: var(--text-normal); text-decoration: underline; }
.vp-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--header-primary);
  font-size: 14px;
  font-weight: 700;
}
.vp-signal { display: inline-flex; color: var(--green); }
.vp-where { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vp-hangup:hover { color: var(--red); }

.vp-live {
  background: var(--bg-dark);
  border: 1px solid rgba(53, 194, 107, .35);
  border-radius: var(--radius);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.vp-live-head { display: flex; align-items: center; gap: 6px; }
.vp-live-head .live-badge { margin-left: 0; cursor: default; }
.vp-live-title { font-size: 13px; font-weight: 600; color: var(--header-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vp-live-source { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vp-live-actions { display: flex; gap: 6px; margin-top: 4px; }
.vp-ink { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-normal); cursor: pointer; }

.vp-pill {
  border: none;
  border-radius: var(--radius-pill);
  background: var(--bg-active);
  color: var(--header-primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
}
.vp-pill:hover { background: var(--header-primary); color: var(--bg-darkest); }
.vp-pill.danger { background: rgba(242, 63, 67, .15); color: var(--red); }
.vp-pill.danger:hover { background: var(--red); color: #fff; }

.vp-watch, .vp-stream {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-dark);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
}
.vp-watch-label { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.vp-watch-label:hover { text-decoration: underline; }
.vp-watch-label, .vp-stream-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.vp-stream { flex-direction: column; align-items: stretch; gap: 6px; padding: 8px 10px; border: 1px solid rgba(53, 194, 107, .35); background: var(--bg-dark); }
.vp-stream-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.vp-stream-watch { background: var(--accent); color: var(--accent-ink); padding: 6px 10px; }
.vp-stream-watch:hover { background: var(--accent-hover); color: var(--accent-ink); }
.vp-stream .live-badge { margin-left: 0; cursor: default; }
.vp-streams { display: flex; flex-direction: column; gap: 4px; }
.vp-streams:empty { display: none; }
.vp-live-actions .vp-pill { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.stage {
  flex: 0 0 auto;
  height: 56%;
  min-height: 220px;
  padding: 12px 12px 4px;
  display: flex;
}
.main.stage-focus .stage { flex: 1; height: auto; padding-bottom: 12px; }
.main.stage-focus .messages,
.main.stage-focus .composer,
.main.stage-focus .emoji-picker { display: none; }

.stage-view {
  position: relative;
  flex: 1;
  min-width: 0;
  border-radius: var(--radius);
  background: var(--bg-darkest);
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  container-type: inline-size;
}
.stage-view:fullscreen { border-radius: 0; border: none; background: #000; }
.stage-view img, .stage-view .stage-frame { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.stage-view img:not([src]), .stage-view .stage-frame.blank { display: none; }
.stage-ink { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; touch-action: none; }
.stage-ink.drawing { pointer-events: auto; cursor: crosshair; }
.stage-ink.drawing[data-tool="point"] { cursor: pointer; }
.stage-ink-tools { display: flex; gap: 8px; padding-right: 8px; margin-right: 0; border-right: 1px solid rgba(242, 239, 230, .14); }
.stage-ink-tools .stage-btn.active { background: var(--accent); border-color: transparent; }
.stage-drawers { margin-left: auto; margin-right: 8px; gap: 10px; flex: 0 1 auto; overflow: hidden; }
.stage-drawers-label { color: rgba(255,255,255,.75); font-weight: 500; }
.stage-drawer { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.stage-drawer-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.stage-drawer-name { overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.stage-drawer-stop { display: flex; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 0; border: none; border-radius: 50%; background: rgba(242, 239, 230, .14); color: #fff; cursor: pointer; }
.stage-drawer-stop:hover { background: var(--accent); }

.stage-wait {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}
.spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.15);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.stage-top, .stage-controls {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  pointer-events: none;
}
.stage-top { top: 0; justify-content: space-between; }
.stage-controls {
  bottom: 0;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity var(--t-hover) ease;
}
.stage-view:hover .stage-controls,
.stage-view:focus-within .stage-controls,
.stage-view:has(.stage-wait:not(.hidden)) .stage-controls { opacity: 1; pointer-events: auto; }
.stage-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 30px;
  padding: 0 12px 0 8px;
  border-radius: var(--radius-pill);
  background: rgba(11, 13, 23, .72);
  border: 1px solid rgba(242, 239, 230, .14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: auto;
}
.stage-who { flex: 0 1 auto; }
.stage-top .live-badge { margin: 0; cursor: default; background: var(--accent); color: #fff; }
.stage.self .stage-top .live-badge { background: var(--bg-active); }
.stage-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; color: #fff; }
.stage-viewers { color: rgba(255,255,255,.75); font-weight: 500; }
.stage-viewers::before { content: "\00b7"; margin-right: 8px; }
.stage-stats { flex: 0 0 auto; padding: 0 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.stage-stats:empty { display: none; }
@container (max-width: 420px) { .stage-stats { display: none; } }

.stage-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(242, 239, 230, .14);
  background: rgba(11, 13, 23, .72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--t-hover) ease, transform var(--t-press) ease;
}
.stage-btn:hover { background: rgba(45, 53, 84, .9); transform: scale(1.06); }
.stage-btn.danger { background: var(--accent); border-color: transparent; }
.stage-btn.danger:hover { background: var(--accent-hover); }
@media (prefers-reduced-motion: reduce) { .stage-btn:hover { transform: none; } }
.stage-volume { height: 36px; padding: 0 14px 0 10px; gap: 10px; cursor: pointer; margin-right: auto; }
.stage-volume-icon { display: flex; color: #fff; }
.stage-volume-icon svg { width: 18px; height: 18px; }
.stage-volume input[type="range"] {
  width: 110px;
  height: 6px;
  background: linear-gradient(to right, var(--accent) var(--fill, 50%), rgba(242, 239, 230, .25) var(--fill, 50%));
}
.stage.self .stage-volume { visibility: hidden; }

.modal.modal-wide { width: 640px; max-width: calc(100vw - 32px); }
.share-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--bg-active); }
.share-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}
.share-tab:hover { color: var(--text-normal); }
.share-tab.active { color: var(--ink-strong); border-bottom-color: var(--accent); }

.share-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  max-height: 340px;
  overflow-y: auto;
  padding: 4px 2px;
}
.share-card {
  background: var(--bg-dark);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--text-normal);
  transition: border-color .12s, background .12s;
}
.share-card:hover { background: var(--bg-hover); }
.share-card.picked { border-color: var(--accent); }
.share-thumb {
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: var(--bg-darkest);
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.share-thumb img { width: 100%; height: 100%; object-fit: cover; }
.share-card-label { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 0 2px; }
.share-card-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share-card .kind {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-faint);
  background: var(--bg-darkest);
  border-radius: 6px;
  padding: 2px 5px;
}
.share-loading { grid-column: 1 / -1; color: var(--text-faint); font-size: 14px; text-align: center; padding: 40px 0; }

.share-quality { display: flex; flex-direction: column; gap: 8px; }
.share-quality-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
}
.segmented { display: flex; background: var(--bg-darkest); border-radius: 8px; padding: 3px; gap: 3px; }
.segmented button {
  flex: 1;
  border: none;
  background: none;
  border-radius: 6px;
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
}
.segmented button strong { font-size: 13px; font-weight: 600; }
.segmented button span { font-size: 11px; }
.segmented button:hover { color: var(--text-normal); }
.segmented button.active { background: var(--bg-active); color: var(--ink-strong); }

.share-audio-row { padding: 4px 0; }
.share-audio-row .setting-title { font-size: 14px; }

.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

.modal-leaving { border-top: 3px solid var(--line); }
.modal-leaving.warn, .modal-leaving.block { border-top-color: var(--red); }
.leaving-host {
  background: var(--bg-darkest);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 15px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.leaving-host strong { color: var(--header-primary); font-weight: 700; }
.leaving-spelled { font-size: 12px; color: var(--text-faint); overflow-wrap: anywhere; margin-top: -6px; }
.leaving-notes { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--text-normal); }
.modal-leaving.warn .leaving-notes li::marker, .modal-leaving.block .leaving-notes li::marker { color: var(--red); }
.leaving-trust { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-normal); cursor: pointer; }
.modal-actions button { padding: 10px 20px; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.vp-preview {
  position: relative;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 6px;
  background: #000;
  overflow: hidden;
  cursor: zoom-in;
  padding: 0;
  margin: 4px 0 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vp-preview img { width: 100%; height: 100%; object-fit: contain; }
.vp-preview img:not([src]) { display: none; }
.vp-preview-empty { font-size: 11px; color: var(--text-faint); font-family: inherit; }
.vp-viewers {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: rgba(0,0,0,.7);
  color: #fff;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
}

.voice-user .avatar, .member .avatar, #me-avatar { position: relative; }
.voice-user .avatar::before, .voice-user .avatar::after,
.member .avatar::before, .member .avatar::after,
#me-avatar::before, #me-avatar::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s ease-out;
}
.voice-user .avatar::after, .member .avatar::after, #me-avatar::after {
  border: 2px solid var(--green);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35);
}
.voice-user .avatar::before, .member .avatar::before, #me-avatar::before {
  background: transparent;
}
.voice-user.speaking .avatar::after,
.member.speaking .avatar::after,
.user-panel.speaking #me-avatar::after { opacity: 1; }
.voice-user.speaking .avatar::before,
.member.speaking .avatar::before,
.user-panel.speaking #me-avatar::before {
  opacity: 1;
  animation: speaking-ripple 1.6s cubic-bezier(.2, .6, .35, 1) infinite;
}
@keyframes speaking-ripple {
  0% { box-shadow: 0 0 0 0 rgba(53, 194, 107, .45); }
  100% { box-shadow: 0 0 0 7px rgba(53, 194, 107, 0); }
}
.voice-user { padding-top: 4px; padding-bottom: 4px; }
.voice-user.speaking .voice-user-name { color: var(--header-primary); }
.member.speaking .member-name { color: var(--header-primary); }
@media (prefers-reduced-motion: reduce) {
  .voice-user.speaking .avatar::before,
  .member.speaking .avatar::before,
  .user-panel.speaking #me-avatar::before { animation: none; }
}
.member .presence-dot { z-index: 2; }

.kind-picker { display: flex; flex-direction: column; gap: 8px; }
.kind-option {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-dark);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--text-normal);
  transition: background .12s, border-color .12s;
}
.kind-option:hover { background: var(--bg-hover); }
.kind-option.active { background: var(--bg-active); border-color: var(--accent); }
.kind-icon {
  width: 24px;
  display: inline-flex;
  justify-content: center;
  color: var(--text-muted);
  font-size: 24px;
  font-weight: 500;
  flex-shrink: 0;
}
.kind-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.kind-text strong { font-size: 15px; font-weight: 600; color: var(--header-primary); }
.kind-text span { font-size: 13px; color: var(--text-muted); }
.kind-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  flex-shrink: 0;
}
.kind-option.active .kind-radio { border-color: var(--ink-strong); box-shadow: inset 0 0 0 4px var(--bg-active); background: var(--ink-strong); }

.emoji-slot-field {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 0 0 0 4px;
  background: var(--input-bg);
  border: 1px solid transparent;
  border-radius: 10px;
  transition: border-color .12s;
}
.emoji-slot-field:focus-within { border-color: var(--focus); }
.emoji-slot-field > input[type="text"], .modal .emoji-slot-field > input[type="text"], .settings-layer .emoji-slot-field > input[type="text"] {
  flex: 1;
  min-width: 0;
  width: auto;
  background: none;
  border: none;
  box-shadow: none;
  outline: none;
}
.emoji-slot {
  flex: none;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.emoji-slot:hover { color: var(--header-primary); background: var(--bg-hover); }
.emoji-slot .custom-emoji, .emoji-slot .role-tag.emoji .custom-emoji { width: 22px; height: 22px; margin: 0; vertical-align: 0; }
.emoji-slot .role-tag { margin-left: 0; }
.emoji-slot .role-tag.emoji { font-size: 20px; }
.prefixed-input .emoji-slot { margin-left: 2px; }
.rf-name-sub { margin-top: 4px; }
.field-emoji { position: relative; display: block; }
.field-emoji > input, .field-emoji > textarea { width: 100%; box-sizing: border-box; padding-right: 44px; }
.field-emoji .input-emoji-btn { position: absolute; right: 4px; top: 50%; margin: -17px 0 0; }
.field-emoji > textarea ~ .input-emoji-btn { top: auto; bottom: 6px; margin: 0; }
#avatar-menu, #banner-menu { z-index: 180; }
.banner-menu { width: 348px; max-width: calc(100vw - 16px); }
.banner-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 4px 4px 8px; }
.pop-menu .banner-tile { display: block; height: auto; min-height: 0; padding: 0; border: 0; border-radius: 10px; background: none; overflow: hidden; cursor: pointer; }
.pop-menu .banner-tile > img { display: block; width: 100%; aspect-ratio: 5 / 2; object-fit: cover; }
.pop-menu .banner-tile:hover, .pop-menu .banner-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.prefixed-input {
  display: flex;
  align-items: center;
  background: var(--bg-darkest);
  border: 1px solid transparent;
  border-radius: 6px;
  padding-left: 10px;
  transition: border-color .12s;
}
.prefixed-input:focus-within { border-color: var(--focus); }
.input-prefix { color: var(--text-muted); font-size: 18px; font-weight: 500; display: inline-flex; }
.input-emoji-btn {
  flex: none;
  width: 34px;
  height: 34px;
  margin-right: 2px;
  border: none;
  background: none;
  border-radius: 8px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.input-emoji-btn:hover { color: var(--header-primary); background: var(--bg-hover); }
.modal .prefixed-input input[type="text"], .settings-layer .prefixed-input input[type="text"] { flex: 1; min-width: 0; background: none; border: none; text-transform: none; letter-spacing: normal; font-weight: 400; }

.channel-group.dm-group { padding-right: 6px; }

.settings-page select.compact-select { min-width: 140px; flex-shrink: 0; cursor: pointer; }

#me-avatar .presence-dot { z-index: 2; border-color: var(--bg-dark); }

.rail-home { width: auto; height: 34px; gap: 6px; padding: 0 11px 0 9px; border-radius: 17px; background: var(--bg-raised); color: var(--header-primary); font-family: var(--font); font-size: 13px; font-weight: 600; letter-spacing: .02em; flex: none; }
.rail-home:hover { background: var(--bg-hover); }
.rail-home.active { background: var(--bg-active); }
.rail-home.active { box-shadow: none; }
.rail-home > svg { flex: none; }

.avatar { overflow: visible; }
.avatar > img.avatar-face {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.avatar.image-avatar { background: var(--bg-darkest); }
.avatar.emoji-avatar { background: var(--bg-active); }
.avatar.emoji-avatar > .avatar-face { font-size: 0.62em; line-height: 1; }
.avatar.emoji-avatar { font-size: 32px; }
.avatar.avatar-sm.emoji-avatar { font-size: 22px; }
.avatar.avatar-lg.emoji-avatar, .avatar.avatar-xl.emoji-avatar { font-size: 72px; }
.msg .avatar.emoji-avatar { font-size: 40px; }
.user-sub.activity { color: var(--green); font-weight: 500; }
.member { min-height: 44px; }
.member > div:not(.avatar) { flex: 1; min-width: 0; }
.member-name { display: flex; align-items: center; }
.member-name-text { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-name > :not(.member-name-text) { flex: 0 0 auto; }
.member-name .live-badge { margin-left: 6px; }
.user-sub.empty { min-height: 14px; }
.member .user-sub { display: flex; align-items: center; gap: 4px; min-height: 14px; }
.member .user-sub .sub-voice { display: inline-flex; flex: 0 0 auto; color: var(--text-muted); }
.member .user-sub .sub-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.elapsed { font-variant-numeric: tabular-nums; }
.voice-user-time { font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; margin-right: 2px; }

.profile-pop {
  position: fixed;
  z-index: 120;
  width: 300px;
  background: var(--bg-darkest);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .55);
  overflow: hidden;
  animation: pop-in .12s ease-out;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pp-banner { height: 64px; }
.pp-head { position: relative; padding: 0 16px; margin-top: -40px; display: flex; align-items: flex-end; }
#pp-avatar { position: relative; border: 6px solid var(--bg-darkest); width: 84px; height: 84px; font-size: 30px; }
#pp-avatar .presence-dot { width: 22px; height: 22px; border-width: 5px; border-color: var(--bg-darkest); right: -2px; bottom: -2px; z-index: 2; }
.pp-avatar-edit {
  position: absolute;
  left: 82px;
  bottom: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--bg-active);
  color: var(--ink-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.pp-avatar-edit:hover { background: var(--accent); }
.pp-body { padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.pp-name { font-size: 20px; font-weight: 700; color: var(--header-primary); padding: 0 4px; font-family: var(--font-display); letter-spacing: -.01em; }
.pp-username { font-size: 14px; color: var(--text-muted); padding: 0 4px; margin-bottom: 10px; }
.pp-status-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-dark);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 4px 6px;
}
.pp-status-row:focus-within { border-color: var(--focus); }
.pp-emoji-btn, .pp-clear {
  border: none;
  background: none;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pp-emoji-btn { width: 30px; height: 30px; font-size: 20px; }
.pp-emoji-btn:hover, .pp-clear:hover { background: var(--bg-hover); color: var(--text-normal); }
.pp-clear { width: 24px; height: 24px; }
#pp-status {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--text-normal);
  font-family: inherit;
  font-size: 14px;
  padding: 6px 2px;
  user-select: text;
}
#pp-status::placeholder { color: var(--text-faint); }
.pp-divider { height: 1px; background: var(--bg-active); margin: 10px 4px; }
.pp-presence { display: flex; flex-direction: column; gap: 1px; }
.pp-presence button, .pp-link, .pop-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  background: none;
  color: var(--text-normal);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.pp-presence button:hover, .pp-link:hover, .pop-menu button:hover { background: var(--accent); color: #fff; }
.pp-presence button.active { background: var(--bg-active); }
.pp-presence button.active:hover { background: var(--accent); }
.pp-presence button > span:last-child { display: flex; flex-direction: column; }
.pp-presence small { font-size: 12px; font-weight: 400; color: var(--text-muted); }
.pp-presence button:hover small { color: rgba(255, 255, 255, .85); }
.pp-presence .presence-dot.inline { width: 12px; height: 12px; margin: 0; flex-shrink: 0; }
.presence-dot.invisible { background: var(--text-faint); box-shadow: inset 0 0 0 3px var(--bg-darkest); }

.pop-menu {
  position: fixed;
  z-index: 130;
  min-width: 180px;
  background: var(--bg-darkest);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pop-menu button.danger { color: var(--red); }
.pop-menu button.danger:hover { background: var(--red); color: #fff; }

.emoji-pop {
  position: fixed;
  z-index: 180;
  width: 408px;
  height: 448px;
  max-height: calc(100vh - 16px);
  background: var(--bg-dark);
  border: 1px solid var(--bg-darkest);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.emoji-browser { display: flex; flex-direction: column; min-height: 0; }
.emoji-pop > .emoji-browser { flex: 1; }
.picker-tabs.pop-tabs { grid-template-columns: repeat(2, 1fr); margin: 10px 10px 0; }
.pop-gifs { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px 10px 8px; }
.pop-gifs input {
  flex-shrink: 0;
  height: 34px;
  padding: 0 10px;
  background: var(--bg-darkest);
  border: none;
  border-radius: 6px;
  outline: none;
  color: var(--text-normal);
  font: 14px var(--font);
}
.pop-gifs input:focus { box-shadow: inset 0 0 0 1px var(--line-strong); }
.pop-gifs .gif-item.busy { opacity: .5; pointer-events: none; }
.eb-head { position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 10px 8px; flex-shrink: 0; }
.eb-search {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  background: var(--bg-darkest);
  border-radius: 6px;
  color: var(--text-faint);
  cursor: text;
}
.eb-search:focus-within { box-shadow: inset 0 0 0 1px var(--line-strong); }
.emoji-browser .eb-search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  padding: 0;
  color: var(--text-normal);
  font-size: 14px;
  font-family: inherit;
}
.eb-tone, .eb-tone-option {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border: none;
  border-radius: 6px;
  background: none;
  font-size: 22px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}
.eb-tone:hover, .eb-tone-option:hover, .eb-tone-option.on { background: var(--bg-active); }
.eb-tones {
  position: absolute;
  top: 46px;
  right: 10px;
  z-index: 3;
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--bg-darkest);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .4);
}
.eb-clear { flex-shrink: 0; }
.eb-main { flex: 1; min-height: 0; display: flex; border-top: 1px solid var(--bg-darkest); }
.eb-rail {
  position: relative;
  flex: 0 0 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  overflow-y: auto;
  scrollbar-width: none;
  background: var(--bg-darkest);
}
.eb-rail::-webkit-scrollbar { display: none; }
.eb-rail-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--text-faint);
  cursor: pointer;
}
.eb-rail-btn:hover { background: var(--bg-hover); color: var(--text-normal); }
.eb-rail-btn.active { background: var(--bg-active); color: var(--header-primary); }
.eb-rail-server {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 7px;
  background: var(--bg-active);
  color: var(--text-normal);
  font-size: 9px;
  font-weight: 700;
}
.eb-rail-server img { width: 100%; height: 100%; object-fit: cover; display: block; }
.eb-rail-sep { width: 20px; height: 1px; margin: 4px 0; flex-shrink: 0; background: var(--line-strong); }
.eb-body { position: relative; flex: 1; min-width: 0; overflow-y: auto; padding: 0 6px 6px; }
.eb-section .emoji-section { position: sticky; top: 0; z-index: 1; padding: 8px 4px 4px; background: var(--bg-dark); }
.eb-cells { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; }
.eb-cells > button {
  aspect-ratio: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.eb-cells > button:hover, .eb-cells > button:focus-visible { background: var(--bg-active); outline: none; }
.eb-cells > button.custom .custom-emoji { width: 30px; height: 30px; margin: 0; vertical-align: 0; }
.eb-foot {
  flex-shrink: 0;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 12px;
  border-top: 1px solid var(--bg-darkest);
  background: var(--bg-darkest);
}
.eb-foot-glyph { width: 28px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 24px; line-height: 1; }
.eb-foot-glyph .eb-foot-img { width: 28px; height: 28px; margin: 0; vertical-align: 0; }
.eb-foot-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--header-primary); }
.eb-foot-where { flex-shrink: 0; margin-left: auto; font-size: 12px; color: var(--text-faint); white-space: nowrap; }

.profile-body { position: relative; }
.profile-avatar-btn { margin-left: auto; margin-bottom: 10px; }
#me-avatar { cursor: pointer; }
#pp-avatar.emoji-avatar { font-size: 72px; }
.pp-avatar-edit {
  left: 22px;
  bottom: 6px;
  width: 72px;
  height: 72px;
  background: rgba(0, 0, 0, .55);
  opacity: 0;
  transition: opacity .12s;
  z-index: 1;
}
.pp-avatar-edit:hover { opacity: 1; background: rgba(0, 0, 0, .55); }
.user-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.channel { position: relative; }
.channel-gear {
  margin-left: auto;
  border: none;
  background: none;
  color: var(--text-muted);
  display: inline-flex;
  padding: 2px;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  flex-shrink: 0;
}
.channel:hover .channel-gear, .channel.active .channel-gear { opacity: 1; }
.channel-gear:hover { color: var(--text-normal); }
.channel .voice-count + .channel-gear { margin-left: 4px; }
.voice-channel .voice-count { margin-left: auto; }

.save-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-darkest);
  border-radius: var(--radius);
  padding: 10px 12px 10px 16px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .35);
  animation: pop-in .12s ease-out;
}
.save-bar span { flex: 1; }
.btn-link {
  background: none;
  border: none;
  color: var(--text-normal);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}
.btn-link:hover { text-decoration: underline; }

.settings-subhead.danger-head { color: var(--red); margin-top: 36px; }
.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(242, 63, 67, .55);
  background: rgba(242, 63, 67, .06);
  border-radius: var(--radius);
  padding: 16px;
}
.danger-zone .btn-danger, .danger-zone .btn-secondary { flex-shrink: 0; }
.danger-zone + .danger-zone { margin-top: 12px; }

.danger-callout {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(240, 178, 50, .1);
  border-left: 4px solid var(--yellow);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text-normal);
}
.danger-callout strong { color: var(--header-primary); }
.confirm-name {
  text-transform: none;
  letter-spacing: normal;
  font-family: Consolas, "Cascadia Mono", monospace;
  color: var(--header-primary);
  background: var(--bg-darkest);
  padding: 1px 5px;
  border-radius: 6px;
}
.btn-danger:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.confirm-prompt { display: block; font-size: 13px; line-height: 1.6; }

.msg { position: relative; }
.msg-actions {
  position: absolute;
  top: -16px;
  right: 16px;
  display: none;
  gap: 2px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
  z-index: 2;
}
.msg:hover .msg-actions, .msg.touched .msg-actions { display: flex; }
.msg.editing .msg-actions, .delete-preview .msg-actions { display: none; }
.msg-actions button {
  width: 30px;
  height: 28px;
  border: none;
  background: none;
  color: var(--text-muted);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.msg-actions button:hover { background: var(--bg-hover); color: var(--text-normal); }
.msg-actions button.danger:hover { color: var(--red); }
.msg.editing { background: rgba(0, 0, 0, .07); }

.msg-editor { margin-top: 4px; }
.msg-editor textarea {
  width: 100%;
  resize: vertical;
  min-height: 42px;
  background: var(--input-bg);
  border: none;
  border-radius: var(--radius);
  color: var(--text-normal);
  font-family: inherit;
  font-size: var(--chat-font-size);
  line-height: 1.375;
  padding: 10px 12px;
  outline: none;
  user-select: text;
}
.msg-editor-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.msg-editor-hint a { color: var(--link); cursor: pointer; }
.msg-editor-hint a:hover { text-decoration: underline; }

.msg-hidden {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 2px 56px;
  font-size: 13px;
  color: var(--text-faint);
}
.msg-hidden .btn-link { font-size: 13px; color: var(--link); }

.delete-preview {
  background: var(--bg-dark);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: 0 0 0 1px var(--bg-darkest);
}
.delete-preview:hover { background: var(--bg-dark); }
.forward-row .server-chip { width: 32px; height: 32px; }
.forward-row .dm-preview { color: var(--text-muted); }
.jump-card { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: var(--bg-raised); border: 1px solid var(--line); max-width: 420px; }
.jump-card svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.jump-card-text { flex: 1; min-width: 0; color: var(--text-muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.delete-preview .avatar { width: 40px; height: 40px; }
.device-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.device-grid select { width: 100%; min-width: 0; text-overflow: ellipsis; }

.cam-grid {
  position: relative;
  padding: 12px 16px;
  background: var(--bg-darkest);
  max-height: 56%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.cam-grid:focus { outline: none; }
.cam-grid:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.cam-pages { min-height: 0; overflow-y: auto; }
.cam-page {
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), minmax(0, var(--tile-w, 1fr)));
  justify-content: safe center;
  gap: 8px;
}
.cam-grid[data-layout="strip"] { padding: 4px 12px 8px; }
.cam-grid[data-layout="strip"] .cam-pages { overflow-x: auto; overflow-y: hidden; }
.cam-grid[data-layout="strip"] .cam-page { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 168px; justify-content: safe center; }
.cam-grid[data-layout="strip"] .cam-tile.big { grid-column: auto; grid-row: auto; }
.cam-grid[data-layout="strip"] .cam-name { font-size: 12px; left: 6px; bottom: 6px; }
.cam-grid[data-layout="strip"] .cam-avatar { width: 32px; height: 32px; }
.cam-grid[data-layout="strip"] .cam-watch,
.cam-grid[data-layout="strip"] .cam-cover-text { display: none; }
.cam-grid[data-layout="strip"] .cam-tile.on-stage .cam-cover-text { display: block; font-size: 12px; color: var(--header-primary); }
.cam-grid[data-layout="strip"] .cam-tile.on-stage .cam-avatar { display: none; }
.cam-grid[data-layout="strip"] .cam-grid-focus { display: none; }
.main.stage-focus .cam-grid[data-layout="grid"] { flex: 1; max-height: none; }
.main.stage-focus .cam-grid[data-layout="strip"] { flex: 0 0 auto; }
.cam-grid[data-layout="grid"] { padding-right: 60px; }
.cam-grid-focus { position: absolute; top: 12px; right: 12px; z-index: 2; }
.cam-tile {
  position: relative;
  container: cam-tile / inline-size;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 0 2px transparent;
  transition: box-shadow .12s;
  cursor: pointer;
}
.cam-tile.big { grid-column: span 2; grid-row: span 2; }
.cam-tile.speaking { box-shadow: 0 0 0 2px var(--green), 0 0 12px rgba(53, 194, 107, .35); }
.cam-tile.on-stage { box-shadow: 0 0 0 2px var(--accent); }
.cam-tile canvas, .cam-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-tile.screen img, .cam-tile.screen .tile-frame { object-fit: contain; }
.cam-tile img:not([src]), .cam-tile .tile-frame.blank { display: none; }
.cam-cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--bg-dark);
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 8px 8px 32px;
}
.cam-tile.on-stage .cam-cover { background: rgba(11, 13, 23, .88); }
.cam-avatar { width: 56px; height: 56px; font-size: 20px; }
.cam-watch { min-width: 88px; }
@container cam-tile (max-width: 260px) {
  .cam-cover { gap: 6px; padding-bottom: 28px; }
  .cam-cover-text { display: none; }
  .cam-tile.on-stage .cam-cover-text { display: block; }
  .cam-avatar { width: 40px; height: 40px; font-size: 16px; }
  .cam-watch { min-width: 72px; padding: 4px 12px; }
}
.cam-name {
  position: absolute;
  left: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
}
.cam-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cam-name .live-badge { flex: 0 0 auto; }
.cam-stop {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .65);
  color: #fff;
  cursor: pointer;
}
.cam-tile.watched:hover .cam-stop,
.cam-stop:focus-visible { display: flex; }
.cam-stop:hover { background: var(--accent); }
.cam-dots { display: flex; justify-content: center; gap: 8px; padding-top: 10px; }
.cam-dot { width: 8px; height: 8px; padding: 0; border: none; border-radius: 50%; background: rgba(242, 239, 230, .28); cursor: pointer; }
.cam-dot.on { background: var(--header-primary); }
@media (max-width: 700px) {
  .cam-grid, .cam-grid[data-layout="grid"] { padding: 8px 0; max-height: 62%; }
  .cam-grid-focus { display: none; }
  .cam-pages { display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .cam-pages::-webkit-scrollbar { display: none; }
  .cam-page { flex: 0 0 100%; padding: 0 12px; box-sizing: border-box; scroll-snap-align: start; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
  .cam-grid[data-count="1"] .cam-page { grid-template-columns: minmax(0, 1fr); }
  .cam-grid[data-layout="strip"] .cam-page { grid-auto-columns: 132px; justify-content: start; }
  .cam-tile { aspect-ratio: 4 / 3; }
  .cam-tile.big { grid-column: span 2; grid-row: auto; aspect-ratio: 16 / 9; }
  .cam-tile.watched .cam-stop { display: flex; }
  .cam-cover { gap: 8px; }
  .cam-cover-text { display: none; }
  .cam-tile.on-stage .cam-cover-text { display: block; }
  .cam-avatar { width: 40px; height: 40px; font-size: 16px; }
  .cam-watch { min-width: 72px; padding: 4px 12px; }
  .cam-name { font-size: 12px; left: 6px; bottom: 6px; }
}

.field-label.grow { flex: 1; min-width: 0; }
.field-label.grow select { width: 100%; }
.camera-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 20px;
  align-items: start;
}
.cam-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-darkest);
  box-shadow: 0 0 0 1px var(--line);
}
.cam-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cam-stage-idle {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}
.cam-stage.running .cam-stage-idle { visibility: hidden; }
[data-cam-mirror="on"] .cam-stage.rear .cam-self { transform: none; }
.camera-controls { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.camera-controls select { width: 100%; min-width: 0; text-overflow: ellipsis; }
.camera-controls .segmented button { padding: 7px 6px; }
.camera-controls #cam-bg-label { margin-top: 4px; }
.cam-mirror-row { padding: 2px 0; }
.cam-mirror-row .setting-title { font-size: 14px; }
.cam-fx-note { min-height: 56px; }
.cam-fx-note.warn { color: var(--yellow); }
.cam-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.camera-controls #cam-avatar-label { margin-top: 4px; }
.cam-avatars button { height: 46px; min-width: 0; padding: 3px; justify-content: center; position: relative; }
.cam-avatars img { width: 100%; max-width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }
.cam-avatars img:not([src]) { visibility: hidden; }
.cam-avatar-add { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.cam-avatars img[src] + .cam-avatar-add { visibility: hidden; }
[data-cam-mirror="on"] .cam-self { transform: scaleX(-1); }
.cam-feed { position: fixed; left: 0; top: 0; width: 2px; height: 2px; opacity: .01; pointer-events: none; }

.server-icon, .rail-home { position: relative; overflow: visible; }
.server-icon.active::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -11px;
  width: 24px;
  height: 3px;
  margin-left: -12px;
  border-radius: 3px 3px 0 0;
  background: var(--header-primary);
}
.rail-home.active::before { display: none; }
.channel.unread { color: var(--header-primary); font-weight: 600; }
.channel.unread::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  width: 4px;
  height: 8px;
  margin-top: -4px;
  border-radius: 0 4px 4px 0;
  background: #fff;
}
.dm-thread.unread .dm-name { color: var(--ink-strong); font-weight: 700; }

button svg, .channel-icon svg, .vs-icon svg { display: block; flex-shrink: 0; }
.icon-btn { padding: 0; line-height: 0; flex-shrink: 0; }
.icon-btn > svg { width: 20px; height: 20px; }
.header-btns .icon-btn { width: 28px; height: 28px; }
.header-btns .icon-btn > svg { width: 18px; height: 18px; }
.header-actions .icon-btn { width: 32px; height: 32px; }
.header-actions .icon-btn > svg { width: 22px; height: 22px; }
.composer .icon-btn > svg { width: 22px; height: 22px; }
.composer .text-style-btn > svg { width: 20px; height: 20px; }
.user-panel { gap: 6px; }
.user-actions { display: flex; align-items: center; gap: 0; }
.user-actions .icon-btn { width: 32px; height: 32px; }
.user-actions .icon-btn > svg { width: 20px; height: 20px; }
.user-meta { display: flex; flex-direction: column; justify-content: center; min-height: 36px; }
.vp-conn .icon-btn { width: 32px; height: 32px; }
.vp-conn .icon-btn > svg { width: 20px; height: 20px; }
.vp-status { line-height: 18px; white-space: nowrap; overflow: hidden; }
.vp-signal svg { width: 14px; height: 14px; }
.msg-actions button svg { width: 18px; height: 18px; }
.settings-close svg { width: 18px; height: 18px; }
.channel { align-items: center; }
.channel-icon { height: 20px; }
.channel-icon svg { width: 18px; height: 18px; }
.vs-icon svg { width: 14px; height: 14px; }
.dm-group-add svg, .channel-gear svg { width: 16px; height: 16px; }
.stage-btn svg { width: 20px; height: 20px; }
.chat-header { align-items: center; }
.chat-header .hash { line-height: 1; display: inline-flex; align-items: center; }

.server-list { align-items: center; }
.rail-item { position: relative; display: flex; }
.server-icon.has-image { background: var(--bg-dark); overflow: hidden; padding: 0; }
.server-icon.has-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.server-icon.has-image:hover, .server-icon.has-image.active { background: var(--bg-dark); }
.server-icon.muted:not(.active) { opacity: .55; }
.server-icon.waiting { opacity: .6; border: 2px dashed var(--bg-active); box-sizing: border-box; }
.server-icon.waiting:hover { opacity: 1; }
.rail-wait-mark {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-active);
  color: var(--header-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px var(--bg-darkest);
  pointer-events: none;
}
.rail-wait-mark.away { background: var(--red); color: #fff; }
#server-settings-btn { position: relative; }
.join-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg-dark);
  pointer-events: none;
}
.join-wait-status { margin: 0; font-size: 14px; color: var(--text-muted); line-height: 1.45; }
.join-wait-rules, .join-wait-note-wrap { display: flex; flex-direction: column; gap: 6px; }
.join-wait-rules-text {
  max-height: 160px;
  overflow-y: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--bg-darkest);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text-normal);
}
.server-icon[data-drop="before"] { box-shadow: -6px 0 0 -3px var(--accent); }
.server-icon[data-drop="after"] { box-shadow: 6px 0 0 -3px var(--accent); }
.server-icon[data-drop="into"], .folder-head[data-drop="into"] { outline: 3px solid var(--accent); outline-offset: 2px; }
.folder-head[data-drop="before"] { box-shadow: -6px 0 0 -3px var(--accent); }
.folder-head[data-drop="after"] { box-shadow: 6px 0 0 -3px var(--accent); }

.rail-folder {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  border-radius: 14px;
  flex-shrink: 0;
}
.rail-folder.open { background: rgba(255, 77, 77, .12); padding-right: 8px; }
.folder-head {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: none;
  background: rgba(255, 77, 77, .18);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: background .15s;
}
.folder-head:hover { background: rgba(255, 77, 77, .3); }
.folder-head.active::before, .rail-folder .server-icon.active::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -11px;
  width: 24px;
  height: 3px;
  margin-left: -12px;
  border-radius: 3px 3px 0 0;
  background: var(--header-primary);
}
.folder-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 5px; }
.folder-mini {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--bg-active);
  color: var(--ink-strong);
  font-size: 7px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.folder-mini img { width: 100%; height: 100%; object-fit: cover; }

.count-badge {
  position: absolute;
  right: -6px;
  top: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  letter-spacing: .01em;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg-darkest);
  box-sizing: border-box;
  pointer-events: none;
  z-index: 2;
  font-variant-numeric: tabular-nums;
}
.server-icon.active + .count-badge { background: var(--header-primary); color: var(--bg-darkest); }
#home-badge { right: -6px; left: auto; top: -6px; }
.rail { position: relative; }

.ctx-menu { min-width: 220px; z-index: 170; }
.ctx-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 6px 8px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
.ctx-label { font-size: 11px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; padding: 4px 8px 2px; }
.ctx-sep { height: 1px; background: var(--bg-active); margin: 4px 6px; }
.ctx-radio, .ctx-check { justify-content: space-between; }
.ctx-radio::after, .ctx-check::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  flex-shrink: 0;
}
.ctx-check::after { border-radius: 6px; }
.ctx-radio.checked::after, .ctx-check.checked::after {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--bg-darkest);
}
.pop-menu button:hover.ctx-radio::after, .pop-menu button:hover.ctx-check::after { border-color: #fff; }
.channel-notify-menu { width: 260px; overflow-y: auto; overscroll-behavior: contain; }
.channel-notify-menu .ctx-title { max-width: none; }
.cnm-pick { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; text-align: left; }
.cnm-sub { font-size: 12px; color: var(--text-muted); }

.sidebar-header { position: relative; }
.sidebar-banner { display: none; }
.sidebar-header.has-banner { height: 120px; align-items: flex-start; padding-top: 12px; box-shadow: none; }
.sidebar-header.has-banner .sidebar-banner {
  display: block;
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.sidebar-header.has-banner .sidebar-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0, 0, 0, .45), rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .55));
}
.sidebar-header.has-banner > *:not(.sidebar-banner) { position: relative; z-index: 1; }
.sidebar-header.has-banner #server-name { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.sidebar-header.has-banner .icon-btn { color: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .7)); }
.sidebar-header.has-banner > #server-name {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 17px;
  line-height: 1.2;
}
.sidebar-header.has-banner .header-btns { margin-left: auto; }
.sidebar-header.has-banner.plain .sidebar-banner {
  display: block;
  background: var(--slot);
}
.sidebar-header.has-banner.plain .sidebar-banner::after { background: linear-gradient(rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .35)); }

.overview-avatar { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; }
.overview-avatar .server-icon-xl { cursor: pointer; border: none; font-family: inherit; }
.overview-avatar .server-icon-xl:disabled { cursor: default; }
.overview-avatar .server-icon-xl:not(:disabled):hover { filter: brightness(.8); }
.overview-avatar-hint { font-size: 12px; color: var(--text-muted); }
.banner-card { flex-direction: row; align-items: center; gap: 16px; }
.banner-preview {
  width: 240px;
  height: 80px;
  border-radius: 8px;
  background-color: var(--bg-darkest);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.banner-preview span { display: none; font-size: 12px; color: var(--text-faint); }
.banner-preview.empty span { display: block; }
.banner-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }

.msg.is-reply { flex-wrap: wrap; }
.reply-ref {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 2px 20px;
  padding-left: 34px;
  position: relative;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  min-width: 0;
}
.reply-ref::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 28px;
  height: 12px;
  border-left: 2px solid var(--bg-active);
  border-top: 2px solid var(--bg-active);
  border-top-left-radius: 6px;
}
.reply-ref:hover .reply-ref-text { color: var(--text-normal); }
.avatar.avatar-xs { width: 16px; height: 16px; font-size: 8px; }
.avatar.avatar-xs.emoji-avatar { font-size: 14px; }
.reply-ref-name { font-weight: 600; color: var(--text-normal); white-space: nowrap; }
.reply-ref-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.reply-ref-text.missing { font-style: italic; }
.msg.flash { animation: msg-flash 1.6s ease-out; }
@keyframes msg-flash {
  0%, 30% { background: rgba(255, 200, 61, .18); }
  100% { background: transparent; }
}

.reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 16px;
  padding: 6px 8px 6px 14px;
  background: var(--bg-dark);
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 13px;
  color: var(--text-muted);
}
.reply-bar strong { color: var(--text-normal); }
.reply-bar .icon-btn { width: 24px; height: 24px; }
.reply-bar .icon-btn > svg { width: 16px; height: 16px; }
.reply-bar:not(.hidden) + .gif-picker + .composer,
.reply-bar:not(.hidden) ~ .composer { border-top-left-radius: 0; border-top-right-radius: 0; }
.anyway-bar { gap: 10px; }
.anyway-bar > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anyway-send { flex: none; padding: 3px 10px; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 600 12px/1.4 var(--font); cursor: pointer; }
.anyway-send:hover { background: var(--accent-hover); }

.msg.pending .msg-body > :not(.msg-head) { opacity: .6; }
.msg-pending {
  display: inline-flex;
  align-self: center;
  vertical-align: -2px;
  margin-left: 4px;
  color: var(--text-muted);
  cursor: default;
}
.msg-head .msg-pending { margin-left: 0; }
.awaited-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 12px 8px;
  padding: 7px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-muted);
}
.awaited-icon { display: inline-flex; flex-shrink: 0; color: var(--accent); }

.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.reaction {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--bg-dark);
  color: var(--text-normal);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}
.reaction:hover { border-color: var(--bg-active); }
.reaction.mine { background: rgba(255, 77, 77, .15); border-color: var(--accent); }
.reaction-emoji { font-size: 16px; line-height: 1; }
.reaction-count { font-weight: 600; font-variant-numeric: tabular-nums; }
.reaction.add { color: var(--text-muted); opacity: 0; }
.msg:hover .reaction.add { opacity: 1; }

.thread-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  border: none;
  background: none;
  color: var(--link);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 0;
}
.thread-link:hover { text-decoration: underline; }
.app.thread-open { grid-template-columns: var(--sidebar-w) minmax(0, 1fr) 400px; }
.app.thread-open .thread-panel { grid-row: 2; }
.app.thread-open #member-list { display: none; }
.thread-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-mid);
}
.thread-head {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 16px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .3);
  flex-shrink: 0;
}
.thread-head-icon { color: var(--text-muted); display: inline-flex; }
.thread-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.thread-title, .thread-title-input {
  display: block;
  box-sizing: border-box;
  width: calc(100% + 6px);
  height: 24px;
  margin: 0 0 0 -6px;
  padding: 0 6px;
  border: none;
  border-radius: 6px;
  background: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  line-height: 24px;
  color: var(--header-primary);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thread-title { cursor: text; transition: background var(--t-hover) ease; }
.thread-title:disabled { cursor: default; }
.thread-title:not(:disabled):hover { background: var(--bg-hover); }
.thread-title-input { outline: none; background: var(--input-bg); box-shadow: inset 0 0 0 1px var(--line); }
.thread-title-input:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--focus); }
.thread-title-input::placeholder { color: var(--text-faint); font-weight: 500; }
.thread-status { height: 16px; font-size: 12px; line-height: 16px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-head .icon-btn.active { color: var(--accent); }
.thread-composer.locked { opacity: .7; }
.thread-composer textarea:disabled { cursor: not-allowed; }
.thread-composer textarea:disabled::placeholder { color: var(--text-faint); font-style: italic; }
.threads-pop { width: 380px; }
.threads-pop-sub { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--t-hover) ease;
}
.thread-row:hover, .thread-row:focus-visible { background: var(--bg-hover); outline: none; }
.thread-row.archived { opacity: .65; }
.thread-row-icon {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-raised);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.thread-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.thread-row-name { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--header-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-row-meta { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.threads-archived-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: none;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: none;
  color: var(--text-faint);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  transition: color var(--t-hover) ease;
}
.threads-archived-toggle:hover { color: var(--text-muted); }
.threads-archived-toggle svg { flex: none; }
.thread-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.thread-messages .reply-ref { display: none; }
.thread-root { background: rgba(0, 0, 0, .08); border-radius: 6px; }
.thread-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 8px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
}
.thread-divider::after { content: ""; flex: 1; height: 1px; background: var(--bg-active); }
.thread-composer { margin: 0 12px 16px; }

.text-style-pop {
  position: fixed;
  z-index: 130;
  background: var(--bg-darkest);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
  width: 300px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ts-row { display: flex; flex-wrap: wrap; gap: 4px; }
.ts-label { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-top: 4px; }
.ts-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-mid);
  color: var(--text-normal);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background var(--t-hover) ease, border-color var(--t-hover) ease;
}
.ts-btn:hover { background: var(--bg-hover); }
.ts-btn[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.ts-format { font-weight: 700; }
.ts-format[data-marker="*"] { font-style: italic; }
.ts-format[data-marker="__"] { text-decoration: underline; }
.ts-format[data-marker="~~"] { text-decoration: line-through; }
.ts-format[data-marker="\`"] { font-family: ui-monospace, Consolas, Menlo, monospace; font-size: 12px; }
.ts-swatch { min-width: 26px; width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid transparent; }
.ts-swatch[aria-pressed="true"] { border-color: var(--header-primary); box-shadow: none; }
.tx-swatch-red { background: var(--tx-red); }
.tx-swatch-orange { background: var(--tx-orange); }
.tx-swatch-yellow { background: var(--tx-yellow); }
.tx-swatch-green { background: var(--tx-green); }
.tx-swatch-teal { background: var(--tx-teal); }
.tx-swatch-blue { background: var(--tx-blue); }
.tx-swatch-purple { background: var(--tx-purple); }
.tx-swatch-pink { background: var(--tx-pink); }
.tx-swatch-gray { background: var(--tx-gray); }
.ts-swatch:hover { filter: brightness(1.1); }
.ts-hint { font-size: 12px; color: var(--text-faint); margin-top: 4px; }

.gif-btn { width: auto; min-width: 32px; padding: 0 0 1px; font-size: 13px; font-weight: 800; line-height: 1; letter-spacing: -.01em; }
.composer-slow { display: inline-flex; align-items: center; gap: 4px; min-width: 52px; justify-content: center; padding: 0 6px; font-size: 12px; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.composer-slow svg { width: 16px; height: 16px; }
.composer-slow.waiting { color: var(--accent); }
.gif-btn { position: relative; width: 32px; min-width: 32px; padding: 0; font-size: 9.5px; font-weight: 800; letter-spacing: 0; }
.gif-btn::after { content: ""; position: absolute; left: 50%; top: 50%; width: 26px; height: 17px; transform: translate(-50%, -50%); border: 1.8px solid currentColor; border-radius: 5px; pointer-events: none; }
.gif-btn:hover { color: var(--text-normal); }
.gif-picker {
  position: absolute;
  bottom: 80px;
  right: 12px;
  width: 420px;
  max-width: calc(100% - 32px);
  height: 380px;
  background: var(--bg-dark);
  border: 1px solid var(--bg-darkest);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  z-index: 50;
}
.gif-picker input {
  background: var(--bg-darkest);
  border: none;
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text-normal);
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.gif-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  align-content: start;
}
.gif-item {
  border: none;
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-darkest);
  cursor: pointer;
  aspect-ratio: 4 / 3;
}
.gif-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gif-item:hover { outline: 2px solid var(--accent); }
.gif-note { grid-column: 1 / -1; font-size: 13px; color: var(--text-muted); padding: 24px 8px; text-align: center; }
.gif-attrib { font-size: 11px; color: var(--text-faint); text-align: right; }
#gif-key-help a { color: var(--link); cursor: pointer; }
#gif-key-help a:hover { text-decoration: underline; }

.rail-folder.open { background: var(--line); }
.folder-head { background: var(--bg-raised); color: var(--text-muted); }
.folder-head:hover { background: var(--bg-active); }
.folder-mini { width: 12px; height: 12px; font-size: 6px; }

.user-panel { gap: 4px; }
.user-chip {
  flex: 0 0 164px;
  width: 164px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 8px 0 2px;
  border: none;
  border-radius: var(--radius-pill);
  background: none;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.user-chip:hover { background: var(--bg-hover); }
.user-chip .user-meta, .user-chip .user-meta:hover { background: none; padding: 0; cursor: inherit; min-height: 0; }
.user-chip .user-name, .user-chip .user-sub { display: block; }
.user-chip .user-sub { min-height: 14px; line-height: 14px; }
.user-chip .user-sub.back { color: var(--accent-hover); font-weight: 500; }
.user-chip #me-avatar { cursor: inherit; }
.user-actions { flex: 0 0 auto; }
.user-actions .icon-btn { border-radius: 50%; }
.user-actions .icon-btn { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; }

.gif-picker {
  width: 460px;
  height: 460px;
  max-height: calc(100% - 110px);
  padding: 12px 12px 8px;
  gap: 10px;
}
.gif-picker input { flex-shrink: 0; height: 36px; font-size: 15px; }
.gif-grid {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  grid-template-columns: none;
  overflow-y: auto;
  padding-right: 2px;
}
.gif-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.gif-item {
  display: block;
  width: 100%;
  height: auto;
  min-height: 60px;
  border-radius: 8px;
  background: var(--bg-darkest);
  position: relative;
}
.gif-item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gif-item:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.gif-note { flex: 1; }
.gif-attrib { flex-shrink: 0; }

.sound-card .setting-row { padding: 0; }
.sound-rows { display: flex; flex-direction: column; gap: 8px; }
.sound-row { display: flex; align-items: center; gap: 10px; }
.sound-label { flex: 1; min-width: 0; font-size: 14px; color: var(--text-normal); }
.sound-row select { min-width: 150px; }
.sound-preview { color: var(--text-muted); }
.sound-preview:hover { color: var(--accent); }

.mention {
  background: rgba(255, 77, 77, .14);
  color: var(--mention-ink);
  font-weight: 600;
  border-radius: 6px;
  padding: 0 3px;
}
.mention.role { background: var(--role-tint, rgba(255, 77, 77, .14)); color: var(--role-color, var(--mention-ink)); }
.mention.me { background: rgba(255, 200, 61, .22); color: var(--mention-me-ink); }
.msg:has(.mention.me) { background: rgba(255, 200, 61, .07); box-shadow: inset 2px 0 0 #ffc83d; }
.mention-row .mention.role { font-size: 13px; line-height: 20px; }

.mention-pop {
  position: fixed;
  z-index: 120;
  background: var(--bg-dark);
  border: 1px solid var(--bg-darkest);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 320px;
  overflow-y: auto;
}
.mention-head {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-faint);
  padding: 4px 8px 6px;
}
.mention-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  background: none;
  color: var(--text-normal);
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.mention-row.active, .mention-row:hover { background: var(--bg-active); }
.mention-at {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-darkest);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-muted);
}
.mention-name { font-weight: 600; }
.mention-hint { margin-left: auto; font-size: 12px; color: var(--text-faint); }
.mention-row { min-height: 36px; flex-shrink: 0; }
.mention-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mention-hint { white-space: nowrap; flex-shrink: 0; }
.suggest-glyph {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
}
.suggest-glyph .custom-emoji { width: 24px; height: 24px; margin: 0; vertical-align: 0; }
.suggest-args {
  color: var(--header-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.slash-row .mention-name { flex-shrink: 0; }
.suggest-usage { display: block; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-opt { color: var(--text-faint); font-family: var(--font-display); font-size: 13px; }
.suggest-opt + .suggest-opt { margin-left: 6px; }
.suggest-opt.on { color: var(--header-primary); }
.slash-row .mention-hint { max-width: 42%; overflow: hidden; text-overflow: ellipsis; }

.cmd-use {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 14px;
}
.cmd-use-badge {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-darkest);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: var(--text-muted);
}
.cmd-use-label { flex-shrink: 0; }
.cmd-use-name { flex-shrink: 0; font-family: var(--font-display); font-weight: 600; color: var(--header-primary); }
.cmd-use-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 11px;
  background: var(--bg-darkest);
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cmd-use-chip-name { color: var(--text-faint); }
.cmd-use-chip-name::after { content: ":"; }
.cmd-use-chip-value { color: var(--text-normal); overflow: hidden; text-overflow: ellipsis; }
.cmd-use-bot { margin-left: auto; padding-left: 8px; flex-shrink: 0; font-size: 12px; color: var(--text-faint); }

.composer-menu { min-width: 200px; }
.composer-menu svg { flex-shrink: 0; color: var(--text-muted); }
.composer-menu button:hover svg { color: #fff; }

.chat-video {
  position: relative;
  width: 400px;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 6px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-darkest);
  overflow: hidden;
}
.chat-video-player {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.chat-video-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--t-press) var(--ease-out);
}
.chat-video-play:hover { background: var(--accent-hover); }
.chat-video-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.chat-video-poster ~ .chat-video-label { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); }
.video-link-thumb { overflow: hidden; cursor: pointer; }
.video-link-picture { display: block; width: 100%; height: 100%; object-fit: cover; }
.chat-video-play:disabled { background: var(--bg-active); cursor: progress; }
.chat-video-play svg { margin-left: 3px; }
.chat-video-find {
  position: absolute;
  top: 10px;
  right: 10px;
}
.chat-video-label {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-emoji { width: 22px; height: 22px; object-fit: contain; vertical-align: -6px; margin: 0 1px; }
.custom-emoji:not([src]) { display: inline-block; background: var(--bg-active); border-radius: 6px; }
.custom-emoji.missing { opacity: .4; }
.custom-emoji.profile-emoji { width: 1.3em; height: 1.3em; vertical-align: -0.3em; margin: 0 1px; }
.msg-content.jumbo .custom-emoji { width: 48px; height: 48px; vertical-align: -12px; margin: 2px 1px; }
.reaction .custom-emoji { width: 16px; height: 16px; vertical-align: middle; margin: 0; }
.emoji-grid button.custom { display: flex; align-items: center; justify-content: center; }
.emoji-grid button.custom .custom-emoji { width: 28px; height: 28px; margin: 0; vertical-align: 0; }
.emoji-section {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 4px 2px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-faint);
}
.emoji-section-tag {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--bg-active);
  color: var(--text-muted);
  letter-spacing: 0;
}

.expr-intro { margin: -4px 0 16px; line-height: 1.45; }
.expr-intro code { background: var(--bg-darkest); padding: 1px 4px; border-radius: 3px; font-size: 12px; }
.settings-card.readonly { opacity: .6; }
.expr-toolbar { display: flex; align-items: center; gap: 12px; margin: 20px 0 10px; }
.expr-count { font-size: 12px; color: var(--text-muted); }
.expr-list { display: flex; flex-direction: column; border-top: 1px solid var(--bg-active); }
.expr-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--bg-active);
}
.expr-row.pending { background: var(--bg-dark); border-radius: 6px; padding: 8px 10px; border-bottom: none; margin: 6px 0; }
.expr-preview { width: 32px; height: 32px; margin: 0; vertical-align: 0; flex: none; }
.expr-name { flex: 1; font-size: 14px; color: var(--text-normal); font-weight: 500; }
.expr-name-input {
  flex: 1;
  background: var(--bg-darkest);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 7px 9px;
  color: var(--text-normal);
  font: inherit;
  font-size: 14px;
  outline: none;
}
.expr-name-input:focus { border-color: var(--accent); }
.expr-actions { display: flex; align-items: center; gap: 10px; }
.expr-delete { color: var(--text-muted); opacity: 0; transition: opacity .12s; }
.expr-row:hover .expr-delete, .expr-delete:focus-visible { opacity: 1; }
.expr-delete:hover { color: var(--red); }

.soundboard-pop {
  position: fixed;
  z-index: 140;
  width: 300px;
  max-height: 340px;
  background: var(--bg-dark);
  border: 1px solid var(--bg-darkest);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 700; color: var(--text-normal); }
.sb-add { flex: none; }
.sb-server { font-size: 12px; font-weight: 500; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-muted { font-size: 12px; color: var(--yellow, #f0b232); }
.sb-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; overflow-y: auto; }
.sb-sound {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border: none;
  border-radius: 6px;
  background: var(--bg-darkest);
  color: var(--text-normal);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background .12s;
}
.sb-sound span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-sound svg { color: var(--accent); flex: none; }
.sb-sound:hover:not(:disabled) { background: var(--bg-active); }
.sb-sound:active:not(:disabled) { transform: translateY(1px); }
.sb-sound:disabled { opacity: .5; cursor: not-allowed; }
.sb-empty { grid-column: 1 / -1; font-size: 13px; color: var(--text-muted); padding: 10px 2px; line-height: 1.4; }
.sb-flash {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  max-width: 90px;
  animation: sb-flash 2.5s ease forwards;
}
.sb-flash span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes sb-flash { 0% { opacity: 0; transform: scale(.8); } 10%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.sb-section {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-faint);
  padding: 4px 2px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-hidden.blocked { color: var(--text-muted); }
.pop-menu button.danger { color: var(--red); }
.blocked-list { display: flex; flex-direction: column; margin-top: 10px; }
.blocked-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--bg-active); }
.blocked-row:first-child { border-top: none; }
.blocked-name { flex: 1; font-size: 14px; font-weight: 500; color: var(--text-normal); }
.keep-servers { margin-top: 8px; }
.keep-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--bg-active); }
.keep-row:first-child { border-top: none; }
.keep-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; color: var(--text-normal); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-requests-head { margin-top: 12px; }
.dm-thread.dm-request .dm-name { color: var(--text-muted); }
.dm-request-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 16px 20px;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--bg-dark);
  border: 1px solid var(--bg-active);
}
.dm-request-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dm-request-text strong { font-size: 15px; color: var(--text-normal); }
.dm-request-text span { font-size: 13px; color: var(--text-muted); line-height: 1.35; }
.dm-request-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.btn-link.danger { color: var(--red); }
.dm-profile-action {
  width: 100%;
  border: none;
  border-radius: 6px;
  background: none;
  padding: 8px 6px;
  text-align: left;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
}
.dm-profile-action.danger:hover { background: var(--red); color: #fff; }

.report-reasons { display: flex; flex-direction: column; gap: 2px; margin: 12px 0; }
.report-reasons label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 6px;
  background: var(--bg-dark);
  font-size: 14px;
  color: var(--text-normal);
  cursor: pointer;
}
.report-reasons label:hover { background: var(--bg-active); }
.report-reasons input { accent-color: var(--accent); margin: 0; }
#report-note, #join-wait-note {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  background: var(--bg-darkest);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--text-normal);
  font: inherit;
  font-size: 14px;
  outline: none;
}
#report-note:focus, #join-wait-note:focus { border-color: var(--accent); }
.report-also-block { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--text-muted); cursor: pointer; }
.report-also-block input { accent-color: var(--accent); margin: 0; }
.report-picks { margin-top: 10px; }
.report-pick-list { display: flex; flex-direction: column; gap: 2px; max-height: 200px; overflow-y: auto; }
.report-pick { display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px; border-radius: 4px; cursor: pointer; }
.report-pick:hover { background: var(--bg-active); }
.report-pick input { accent-color: var(--accent); margin: 3px 0 0; flex: none; }
.report-pick .report-pick-text { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 13px; color: var(--text-normal); }
.report-list { display: flex; flex-direction: column; gap: 10px; }

.audit-filters { display: flex; gap: 8px; margin-bottom: 12px; }
.audit-list { display: flex; flex-direction: column; gap: 4px; }
.audit-row {
  background: var(--bg-dark);
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: border-color .12s;
}
.audit-row:hover,
.audit-row.open { border-color: var(--bg-active); }
.audit-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 0 12px;
  border: 0;
  border-radius: inherit;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.audit-head:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.audit-head .avatar { flex-shrink: 0; }
.audit-main { display: flex; flex: 1; align-items: center; gap: 12px; min-width: 0; }
.audit-text {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.audit-row.open .audit-text { padding: 8px 0; white-space: normal; overflow-wrap: anywhere; }
.audit-text strong { color: var(--text-normal); font-weight: 600; }
.audit-time { flex-shrink: 0; font-size: 12px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.audit-chevron { display: inline-flex; flex-shrink: 0; color: var(--text-faint); transition: transform .15s; }
.audit-row.open .audit-chevron { transform: rotate(180deg); }
.audit-more { display: grid; gap: 12px; padding: 0 12px 12px 56px; }
.audit-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: 13px; }
.audit-facts dt { color: var(--text-faint); }
.audit-facts dd { margin: 0; color: var(--text-normal); overflow-wrap: anywhere; }
.audit-keys { display: flex; flex-wrap: wrap; gap: 8px; }
.report-card { background: var(--bg-dark); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.report-head { display: flex; align-items: center; gap: 10px; }
.report-who { flex: 1; min-width: 0; }
.report-name { font-size: 15px; font-weight: 600; color: var(--text-normal); }
.report-meta { font-size: 12px; color: var(--text-muted); }
.report-reason { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 10px; background: rgba(255, 77, 77, .15); color: var(--accent); white-space: nowrap; }
.report-excerpt { border-left: 3px solid var(--bg-active); padding: 4px 10px; color: var(--text-normal); }
.report-note { font-size: 14px; color: var(--text-muted); white-space: pre-wrap; }
.report-actions { display: flex; align-items: center; gap: 8px; }
.report-actions .btn-link { margin-left: auto; }

.pp-expiry {
  display: block;
  margin: 6px 0 0;
  padding: 2px 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}
.pp-expiry:hover { color: var(--text-normal); text-decoration: underline; }
.pp-presence small.pp-until { color: var(--accent-hover); }
.pp-presence button:hover small.pp-until { color: #fff; }
.pp-durations-note { padding: 6px 12px 2px; font-size: 12px; color: var(--text-muted); }
.pp-durations {
  position: fixed;
  z-index: 160;
  width: 250px;
  background: var(--bg-darkest);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.pp-durations-title { font-size: 12px; font-weight: 700; color: var(--text-muted); padding: 6px 8px 4px; }
.pp-durations button[data-mins] {
  border: none;
  background: none;
  text-align: left;
  font: inherit;
  font-size: 14px;
  color: var(--text-normal);
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.pp-durations button[data-mins]:hover { background: var(--accent); color: #fff; }
.pp-custom-time { display: flex; gap: 6px; padding: 4px 8px; }
.pp-custom-time input {
  flex: 1;
  min-width: 0;
  background: var(--bg-dark);
  border: 1px solid var(--bg-active);
  border-radius: 6px;
  color: var(--text-normal);
  font: inherit;
  font-size: 12px;
  padding: 4px 6px;
  color-scheme: dark;
}

.game-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  background: var(--bg-active);
  color: var(--text-normal);
  font-size: 13px;
  font-weight: 500;
}
.game-chip.small { font-size: 11px; padding: 2px 7px; color: var(--text-muted); }
.game-chip-x { display: inline-flex; border: none; background: none; padding: 0; color: var(--text-muted); cursor: pointer; }
.game-chip-x:hover { color: var(--text-normal); }
.tag-editor { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; padding: 6px; border-radius: 6px; background: var(--bg-darkest); }
.tag-chips { display: contents; }
#game-tag-input { flex: 1; min-width: 160px; border: none; background: none; color: var(--text-normal); font: inherit; font-size: 14px; outline: none; padding: 4px; }
.sidebar-game-tags { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 8px 4px; }

.sidebar-link .channel-icon { color: var(--text-muted); }
.sidebar-link-badge { margin-left: auto; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 8px; background: var(--accent); color: #fff; }
.sidebar-sep { height: 1px; background: var(--bg-active); margin: 8px 8px 0; }

.section-head { cursor: pointer; user-select: none; }
.section-head:hover .section-title { color: var(--text-normal); }
.section-caret { display: inline-flex; margin-right: 2px; transition: transform .15s; }
.section-head.collapsed .section-caret { transform: rotate(-90deg); }
.section-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section-head .channel-gear { opacity: 0; margin-left: 4px; }
.section-head:hover .channel-gear { opacity: 1; }
.drop-over { box-shadow: inset 0 2px 0 var(--accent); }
.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }

.voice-count.limited { font-variant-numeric: tabular-nums; background: var(--bg-darkest); color: var(--text-muted); padding: 1px 6px; border-radius: 8px; font-size: 11px; }
.voice-count.full { color: var(--red); }

.md { color: var(--text-normal); font-size: 14px; line-height: 1.5; }
.md .md-para { margin: 4px 0; }
.msg-content .md-para { margin: 0; }
.md a { color: var(--link); text-decoration: none; }
.md a:hover { text-decoration: underline; }

.md-heading { margin: 10px 0 4px; color: var(--header-primary); font-family: var(--font-display); line-height: 1.25; }
.md-para + .md-heading, .md-list + .md-heading, .md-quote + .md-heading, .md-code + .md-heading { margin-top: 10px; }
h1.md-heading { font-size: 1.45em; }
h2.md-heading { font-size: 1.25em; }
h3.md-heading { font-size: 1.1em; }
.md-heading:first-child { margin-top: 2px; }
.gap-after { margin-bottom: 1.2em; }
.md-list { margin: 2px 0; padding-left: 22px; }
.md-list li { margin: 1px 0; }
.md-quote {
  margin: 4px 0;
  padding: 0 0 0 12px;
  border-left: 3px solid var(--line-strong);
  border-radius: 2px;
  color: var(--text-normal);
}
.md-inline-code, .md-code code {
  font-family: "Cascadia Code", "Fira Code", "JetBrains Mono", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: .875em;
}
.md-inline-code {
  background: var(--bg-darkest);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 4px;
  white-space: pre-wrap;
}
.md-code {
  position: relative;
  margin: 6px 0;
  padding: 10px 12px;
  max-width: 90%;
  background: var(--bg-darkest);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  line-height: 1.45;
}
.md-code code { display: block; white-space: pre; tab-size: 4; color: var(--text-normal); }
.md-code-lang {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-faint);
  user-select: none;
}
.md-code:has(.md-code-lang) { padding-top: 22px; }
.tok-keyword { color: var(--link); }
.tok-string { color: var(--code-string); }
.tok-number { color: var(--code-number); }
.tok-comment { color: var(--text-faint); font-style: italic; }
.msg-content u { text-decoration: underline; text-underline-offset: 2px; }
.msg-content s { color: var(--text-muted); }
.md-time {
  background: var(--line);
  border-radius: 4px;
  padding: 0 4px;
  color: var(--header-primary);
  cursor: default;
}
.tx-red { color: var(--tx-red); }
.tx-orange { color: var(--tx-orange); }
.tx-yellow { color: var(--tx-yellow); }
.tx-green { color: var(--tx-green); }
.tx-teal { color: var(--tx-teal); }
.tx-blue { color: var(--tx-blue); }
.tx-purple { color: var(--tx-purple); }
.tx-pink { color: var(--tx-pink); }
.tx-gray { color: var(--tx-gray); }
.tx-font-serif { font-family: Georgia, "Iowan Old Style", "Times New Roman", serif; }
.tx-font-mono { font-family: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace; font-size: .92em; }
.tx-font-hand { font-family: "Segoe Print", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", cursive; }
.tx-font-display { font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; }
.tx-glow { text-shadow: 0 0 6px var(--tx-glow, currentColor), 0 0 14px color-mix(in srgb, var(--tx-glow, currentColor) 55%, transparent); }
.tx-word { white-space: nowrap; }
.tx-letter { display: inline-block; white-space: pre; }
.tx-rainbow .tx-letter { color: hsl(calc(var(--i) * 26deg) 85% var(--tx-rainbow-light)); }
.tx-wave .tx-letter { animation: tx-wave 1.4s ease-in-out infinite; animation-delay: calc(var(--i) * -110ms); }
.tx-shimmer .tx-letter { animation: tx-shimmer 2.6s linear infinite; animation-delay: calc(var(--i) * 60ms); }
.tx-shake { display: inline-block; animation: tx-shake .5s linear infinite; }
@keyframes tx-wave {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-.22em); }
}
@keyframes tx-shimmer {
  0%, 74%, 100% { filter: none; }
  80% { filter: brightness(1.7) drop-shadow(0 0 3px currentColor); }
}
@keyframes tx-shake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-1px, .5px) rotate(-.6deg); }
  50% { transform: translate(1px, -.5px); }
  75% { transform: translate(-.5px, -.5px) rotate(.6deg); }
}
@media (prefers-reduced-motion: reduce) {
  .tx-wave .tx-letter, .tx-shimmer .tx-letter, .tx-shake { animation: none; }
}
html[data-reduced-motion] .tx-wave .tx-letter,
html[data-reduced-motion] .tx-shimmer .tx-letter,
html[data-reduced-motion] .tx-shake { animation: none !important; }
.plain-text-styles .tx,
.plain-text-styles .tx .tx-letter {
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-shadow: none;
  animation: none;
  transform: none;
  display: inline;
}
.plain-text-styles .tx.tx-shake { display: inline; }

.spoiler {
  position: relative;
  border-radius: 4px;
  padding: 0 3px;
  background: var(--bg-darkest);
  color: transparent;
  cursor: pointer;
  user-select: none;
}
.spoiler:not(.revealed) * { color: transparent !important; }
.spoiler:not(.revealed) img, .spoiler:not(.revealed) .custom-emoji { visibility: hidden; }
.spoiler:not(.revealed):hover { background: var(--bg-active); }
.spoiler.revealed {
  background: var(--line);
  color: inherit;
  cursor: text;
  user-select: text;
}

.rules-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#rules-input, #automod-terms {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  min-height: 240px;
  background: var(--bg-darkest);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 10px;
  color: var(--text-normal);
  font: inherit;
  font-size: 14px;
  outline: none;
}
#rules-input:focus, #automod-terms:focus { border-color: var(--accent); }
#automod-terms { min-height: 150px; }
.automod-terms-card .expr-count { align-self: flex-end; }
.automod-roles:empty::before { content: "No roles yet"; color: var(--text-faint); }
.rules-preview { background: var(--bg-dark); border-radius: 6px; padding: 10px 14px; overflow-y: auto; max-height: 360px; }
.expr-count.over { color: var(--red); }
.rules-body { max-height: 55vh; overflow-y: auto; background: var(--bg-dark); border-radius: 10px; padding: 12px 16px; margin: 10px 0; }
.modal.modal-wide { width: min(560px, calc(100vw - 32px)); }
.rules-gate { border-color: rgba(255, 77, 77, .4); }

.events-layer {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(0, 0, 0, .6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.events-panel {
  width: min(760px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-mid);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
  overflow: hidden;
}
.events-head { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--bg-darkest); }
.events-head h2 { margin: 0; font-size: 18px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.events-tabs { display: flex; gap: 4px; }
.events-tab { border: none; background: none; color: var(--text-muted); font: inherit; font-size: 14px; font-weight: 600; padding: 5px 10px; border-radius: 6px; cursor: pointer; }
.events-tab:hover, .events-tab.active { color: var(--text-normal); background: var(--bg-active); }
.events-body { overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.events-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 40px 0; color: var(--text-muted); }
.events-empty h3 { margin: 8px 0 0; color: var(--text-normal); }
.events-empty p { margin: 0; }
.event-card { display: flex; gap: 14px; background: var(--bg-dark); border-radius: 8px; padding: 14px; }
.event-date { flex: none; width: 52px; height: 56px; border-radius: 8px; background: var(--bg-darkest); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.event-date-month { font-size: 11px; font-weight: 700; color: var(--accent); }
.event-date-day { font-size: 22px; font-weight: 700; color: var(--text-normal); line-height: 1; }
.event-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.event-when { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.event-when.live { color: var(--green); }
.event-title { font-size: 16px; font-weight: 700; color: var(--text-normal); }
.event-where { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-muted); }
.event-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.event-counts { font-size: 12px; color: var(--text-muted); }
.event-actions { display: flex; align-items: center; gap: 6px; }
.event-actions .icon-btn.danger:hover { color: var(--red); }
.events-day-title { margin: 8px 0 0; font-size: 15px; color: var(--text-normal); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-month { font-size: 15px; font-weight: 700; color: var(--text-normal); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { font-size: 11px; font-weight: 700; color: var(--text-faint); text-align: center; padding: 4px 0; }
.cal-day {
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--bg-dark);
  color: var(--text-normal);
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}
.cal-day:hover { border-color: var(--bg-active); }
.cal-day.other { opacity: .45; }
.cal-day.today .cal-num { background: var(--accent); color: #fff; }
.cal-day.selected { border-color: var(--accent); }
.cal-num { align-self: flex-start; font-size: 12px; font-weight: 600; padding: 1px 6px; border-radius: 10px; }
.cal-event { font-size: 11px; padding: 1px 4px; border-radius: 3px; background: rgba(255, 77, 77, .18); color: var(--text-normal); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-more { font-size: 10px; color: var(--text-muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#modal-event input[type="datetime-local"], #modal-event select { width: 100%; box-sizing: border-box; color-scheme: dark; }
#event-description { width: 100%; box-sizing: border-box; resize: vertical; background: var(--bg-darkest); border: 1px solid transparent; border-radius: 6px; padding: 9px 10px; color: var(--text-normal); font: inherit; font-size: 14px; outline: none; }

.server-tag {
  --st-bg: #2457c5;
  --st-ink: #ffffff;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  padding: 0 5px;
  height: 16px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--st-bg);
  color: var(--st-ink);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1;
  vertical-align: 2px;
  white-space: nowrap;
  cursor: default;
}
.server-tag-emoji { font-size: 11px; letter-spacing: 0; }
.st-red { --st-bg: #c4303a; --st-ink: #ffffff; }
.st-orange { --st-bg: #b0500e; --st-ink: #ffffff; }
.st-yellow { --st-bg: #f2c94c; --st-ink: #2a2100; }
.st-green { --st-bg: #1d7743; --st-ink: #ffffff; }
.st-teal { --st-bg: #0f736b; --st-ink: #ffffff; }
.st-blue { --st-bg: #2457c5; --st-ink: #ffffff; }
.st-purple { --st-bg: #7740c2; --st-ink: #ffffff; }
.st-pink { --st-bg: #b3307a; --st-ink: #ffffff; }
.st-gray { --st-bg: #5a5f73; --st-ink: #ffffff; }
.server-tag.st-fx-glow {
  --st-glow: 0 0 6px color-mix(in srgb, var(--st-bg) 80%, transparent), 0 0 12px color-mix(in srgb, var(--st-bg) 45%, transparent);
  box-shadow: var(--st-glow);
  overflow: visible;
}
.member-name:has(> .server-tag.st-fx-glow) { overflow: visible; }
.server-tag.st-fx-shine::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: st-shine 3.2s ease-in-out infinite;
  pointer-events: none;
}
.server-tag.st-fx-pulse { animation: st-pulse 2.4s ease-in-out infinite; }
@keyframes st-shine {
  0%, 55% { transform: translateX(-120%); }
  85%, 100% { transform: translateX(120%); }
}
@keyframes st-pulse {
  0%, 100% { filter: none; }
  50% { filter: brightness(1.25) saturate(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  .server-tag.st-fx-shine::after, .server-tag.st-fx-pulse { animation: none; }
}
html[data-reduced-motion] .server-tag.st-fx-shine::after,
html[data-reduced-motion] .server-tag.st-fx-pulse { animation: none !important; }
html[data-reduced-motion] .server-tag.st-fx-shine::after { display: none; }

.server-tag-editor { display: grid; grid-template-columns: auto 1fr; gap: 12px 16px; align-items: center; margin-top: 12px; }
.server-tag-editor > .field-label { margin: 0; }
.server-tag-preview-row { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; min-height: 28px; font-size: 15px; font-weight: 600; color: var(--header-primary); }
.server-tag-preview-row .server-tag { transform: scale(1.25); transform-origin: left center; margin-left: 4px; }
.server-tag-colors { display: flex; flex-wrap: wrap; gap: 6px; }
.server-tag-swatch {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--st-bg);
  cursor: pointer;
}
.server-tag-swatch[aria-checked="true"] { border-color: var(--header-primary); box-shadow: inset 0 0 0 2px var(--bg-raised); }
.server-tag-letters { text-transform: uppercase; letter-spacing: .08em; font-weight: 700; max-width: 120px; }

.role-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 0 5px;
  height: 16px;
  border: 1px solid var(--bg-active);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-muted);
  vertical-align: 2px;
  white-space: nowrap;
}
.bot-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 0 5px;
  height: 16px;
  border-radius: 6px;
  background: var(--header-primary);
  color: var(--bg-darkest);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1;
  vertical-align: 2px;
  white-space: nowrap;
}
.kind.pickable { color: var(--green); }
.role-self { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); cursor: pointer; }
.role-self input { accent-color: var(--accent); margin: 0; }
.role-pick-list { display: flex; flex-direction: column; gap: 4px; margin: 12px 0; max-height: 50vh; overflow-y: auto; }
.role-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--bg-dark);
  color: var(--text-normal);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.role-pick:hover { background: var(--bg-active); }
.role-pick.held { border-color: var(--accent); }
.role-pick-name { flex: 1; font-weight: 600; }
.role-pick-check { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; border-radius: 50%; border: 2px solid var(--text-faint); color: transparent; }
.role-pick.held .role-pick-check { background: var(--accent); border-color: var(--accent); color: #fff; }

.overlay-options.disabled { opacity: .5; pointer-events: none; }
.overlay-options .setting-row + .setting-row, .overlay-options .slider-row { margin-top: 12px; }
.hotkey-input {
  width: 150px;
  text-align: center;
  background: var(--bg-darkest);
  border: 1px solid var(--bg-active);
  border-radius: 6px;
  padding: 7px 8px;
  color: var(--text-normal);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}
.hotkey-input:focus { border-color: var(--accent); color: var(--text-muted); }
.overlay-note { margin-top: 12px; line-height: 1.45; }
.pet-widget { display: flex; gap: 10px; align-items: center; margin: 6px 0 2px; min-width: 0; box-sizing: border-box; overflow: hidden; padding: 8px 10px 8px 6px; border-radius: 10px; background: var(--bg-dark); border: 1px solid var(--line); }
.pet-figure { flex: none; width: 56px; height: 56px; }
.pet-figure .astro, .pet-preview .astro { width: 100%; height: 100%; display: block; overflow: visible; }
.astro-float { animation: astro-float 4s ease-in-out infinite; transform-origin: 32px 40px; }
.astro-light { animation: astro-blink 2.4s steps(2, jump-none) infinite; }
.astro.mood-happy .astro-float { animation-duration: 2.2s; }
.astro.mood-bored .astro-float, .astro.mood-hungry .astro-float { animation-duration: 6s; }
.pet-figure.cheer .astro { animation: astro-cheer .7s ease-out; }
@keyframes astro-float { 0%, 100% { transform: translateY(1px) rotate(-3deg); } 50% { transform: translateY(-3px) rotate(3deg); } }
@keyframes astro-blink { 0% { opacity: 1; } 100% { opacity: .35; } }
@keyframes astro-cheer { 0% { transform: translateY(0) scale(1); } 40% { transform: translateY(-8px) scale(1.06); } 100% { transform: translateY(0) scale(1); } }
.pet-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pet-head { display: flex; align-items: baseline; gap: 6px; }
.pet-dismiss { margin-left: auto; flex: none; width: 20px; height: 20px; padding: 0; border: none; border-radius: 50%; background: none; color: var(--text-faint); font-size: 16px; line-height: 20px; cursor: pointer; align-self: center; }
.pet-dismiss:hover { background: var(--bg-hover); color: var(--text-normal); }
.pet-restore { display: block; width: 100%; margin: 6px 0 2px; padding: 6px 10px; border: 1px dashed var(--line); border-radius: 10px; background: none; color: var(--text-muted); font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
.pet-restore:hover { background: var(--bg-hover); color: var(--text-normal); }
.pet-name { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--ink-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pet-level { font-size: 11px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.pet-mood { font-size: 12px; line-height: 1.3; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.pet-bar { height: 4px; border-radius: 2px; background: var(--bg-active); overflow: hidden; }
.pet-bar span { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.pet-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; min-width: 0; }
.pet-care { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: none; border-radius: 6px; padding: 3px 0; background: var(--bg-active); color: var(--text-normal); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.pet-care:hover { background: var(--accent); color: var(--accent-ink); }
.pet-care:disabled { opacity: .6; cursor: default; }
.pet-editor { display: flex; gap: 16px; align-items: center; margin-top: 10px; }
.pet-preview { flex: none; width: 88px; height: 88px; border-radius: 12px; background: var(--bg-darkest); padding: 6px; box-sizing: border-box; }
.pet-fields { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pet-suits { display: flex; gap: 8px; margin-top: 6px; }
.pet-suit { width: 24px; height: 24px; border-radius: 50%; border: none; cursor: pointer; box-shadow: 0 0 0 2px transparent; padding: 0; }
.pet-suit.selected { box-shadow: 0 0 0 2px var(--bg-dark), 0 0 0 4px var(--ink-strong); }
.pet-suit:disabled { cursor: default; opacity: .6; }
.corner-picker {
  position: relative;
  flex: 0 0 auto;
  width: 112px;
  height: 70px;
  border: 2px solid var(--bg-active);
  border-radius: 8px;
  background: var(--bg-darkest);
}
.corner-opt {
  position: absolute;
  width: 26px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 5px;
  background: var(--bg-active);
  cursor: pointer;
  transition: background var(--t-hover) ease;
}
.corner-opt:hover { background: var(--text-faint); }
.corner-opt.selected, .corner-opt.selected:hover { background: var(--accent); }
.corner-opt[data-corner="top-left"] { top: 5px; left: 5px; }
.corner-opt[data-corner="top-right"] { top: 5px; right: 5px; }
.corner-opt[data-corner="bottom-left"] { bottom: 5px; left: 5px; }
.corner-opt[data-corner="bottom-right"] { bottom: 5px; right: 5px; }
.hotkey-warning { color: var(--yellow); margin-top: 10px; }
.overlay-layout { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.overlay-map {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: var(--screen-ratio, 16 / 9);
  margin-top: 6px;
  border: 2px solid var(--bg-active);
  border-radius: 10px;
  background: var(--bg-darkest);
  box-sizing: border-box;
  touch-action: none;
}
.overlay-map-box {
  position: absolute;
  left: calc(var(--x) * (100% - var(--w)));
  top: calc(var(--y) * (100% - var(--h)));
  width: var(--w);
  height: var(--h);
  min-width: 40px;
  min-height: 28px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-active);
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  cursor: grab;
  user-select: none;
  outline: none;
}
.overlay-map-box[data-part="voice"] { background: var(--accent); color: var(--accent-ink); }
.overlay-map-box:focus-visible { box-shadow: 0 0 0 2px var(--ink-strong); }
.overlay-map-box.dragging { cursor: grabbing; opacity: .85; }
.overlay-map.together .overlay-map-box[data-part="chat"] { display: none; }
.overlay-layout-save { display: flex; gap: 8px; margin-top: 6px; max-width: 420px; }
.overlay-layout-save input { flex: 1; min-width: 0; }
.overlay-layout-list { display: flex; flex-wrap: wrap; gap: 6px; }
.overlay-layout-chip { display: inline-flex; align-items: center; border-radius: 999px; background: var(--bg-active); overflow: hidden; }
.overlay-layout-chip button { border: none; background: none; color: var(--text-normal); font: inherit; font-size: 13px; padding: 5px 4px 5px 12px; cursor: pointer; }
.overlay-layout-chip button.remove { padding: 5px 10px 5px 6px; color: var(--text-muted); }
.overlay-layout-chip button.remove:hover { color: var(--red); }
.overlay-layout-chip.selected { background: var(--accent); }
.overlay-layout-chip.selected button { color: var(--accent-ink); }
.input-mode button { padding: 9px 8px; }
.voice-filters { margin: 10px 0 8px; }
.voice-filters button { padding: 8px 4px; }
.voice-filter-note { min-height: 2.6em; }
.input-mode button.active span { color: var(--text-normal); }
.settings-card .talk-only, .settings-card .voice-only { display: none; }
.settings-card[data-mode="push_to_talk"] .talk-only { display: flex; }
.settings-card[data-mode="voice_activity"] .voice-only { display: block; }
#sensitivity-block { display: none; flex-direction: column; gap: 8px; }
.settings-card[data-mode="voice_activity"] #sensitivity-block { display: flex; }
.mic-meter {
  position: relative;
  height: 10px;
  border-radius: 6px;
  background: var(--bg-darkest);
  overflow: hidden;
}
.mic-meter-fill {
  height: 100%;
  width: 0;
  border-radius: 6px;
  background: var(--text-faint);
  transition: width 90ms linear;
}
.mic-meter[data-state="open"] .mic-meter-fill { background: var(--green); }
.mic-meter[data-state="quiet"] .mic-meter-fill { background: var(--yellow); }
.mic-meter-mark {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--header-primary);
  left: 55%;
}
.mic-meter.auto .mic-meter-mark { display: none; }
#sensitivity-block.auto input[type="range"] { opacity: .4; pointer-events: none; }
#mute-btn.talking { color: var(--green); }

.integration-head { display: flex; gap: 14px; align-items: flex-start; }
.integration-head.title-only { align-items: center; }
.integration-logo { flex: none; width: 52px; height: 52px; border-radius: 10px; background: #9147ff; color: #fff; font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; letter-spacing: .03em; }
.integration-state { margin-left: 6px; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 8px; }
.integration-state.on { background: rgba(53, 194, 107, .18); color: var(--green); }
.integration-status { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 14px; border-radius: 10px; background: var(--bg-darkest); color: var(--text-normal); font-size: 14px; line-height: 1.35; }
.integration-status-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.integration-status[data-tone="off"] .integration-status-text,
.integration-status[data-tone="busy"] .integration-status-text { color: var(--text-muted); }
.integration-dot, .tab-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--text-faint); }
.integration-status[data-tone="ok"] .integration-dot, .tab-dot[data-tone="ok"] { background: var(--green); }
.integration-status[data-tone="warn"] .integration-dot, .tab-dot[data-tone="warn"] { background: var(--accent-2); }
.integration-status[data-tone="busy"] .integration-dot { animation: integration-busy 1s ease-in-out infinite alternate; }
.integration-recheck { flex: none; }
.tab-state { display: flex; flex: none; align-items: center; margin-left: auto; }
.tab-state:not([data-tone="ok"], [data-tone="warn"]), .tab-word { display: none; }
.tab-dot { width: 8px; height: 8px; }
@keyframes integration-busy {
  from { opacity: .3; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .integration-status[data-tone="busy"] .integration-dot { animation: none; }
}
.integration-steps { margin: 12px 0; padding-left: 20px; color: var(--text-muted); font-size: 13px; line-height: 1.55; }
.integration-steps a { color: var(--link); text-decoration: none; }
.integration-steps a:hover { text-decoration: underline; }
.integration-steps code { background: var(--bg-darkest); padding: 1px 4px; border-radius: 3px; }
.integration-card .field-label { margin-top: 10px; }
.integration-card input[type="text"], .integration-card input[type="password"], .integration-card select { width: 100%; box-sizing: border-box; }
.integration-actions { align-items: center; gap: 12px; }
.integration-result { flex: 1; font-size: 13px; color: var(--text-muted); }
.integration-result.ok { color: var(--green); }
.integration-result.bad { color: var(--red); }
.integration-head .switch { flex: none; margin-left: auto; align-self: center; }
.integration-copy { flex: 1; min-width: 0; }
.integration-logo-deck { background: var(--bg-darkest); color: var(--header-primary); }
.integration-lead { margin: 14px 0 0; color: var(--text-muted); font-size: 13.5px; line-height: 1.5; }
.integration-points { margin: 10px 0 0; padding-left: 18px; color: var(--text-muted); font-size: 13.5px; line-height: 1.5; }
.integration-points li + li { margin-top: 4px; }
.integration-points strong { color: var(--header-primary); font-weight: 600; }
.integration-steps-title { margin-top: 18px; }
.integration-steps-title + .integration-steps { margin-top: 6px; }
.stream-deck-note:empty { display: none; }
.stream-deck-note { margin-bottom: 10px; color: var(--yellow); }
.stream-deck-decks { display: flex; flex-direction: column; gap: 8px; }
.stream-deck-decks:empty { display: none; }
.stream-deck-deck { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; background: var(--bg-darkest); }
.stream-deck-deck-name { flex: 1; min-width: 0; color: var(--header-primary); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stream-deck-deck-since { flex: none; color: var(--text-muted); font-size: 12px; }

.tag-editor { position: relative; }
.game-search {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  background: var(--bg-darkest);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  padding: 4px;
  display: flex;
  flex-direction: column;
}
.game-hit { display: flex; align-items: center; gap: 10px; padding: 6px; border: none; border-radius: 6px; background: none; color: var(--text-normal); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.game-hit:hover { background: var(--bg-active); }
.game-hit-cover { width: 30px; height: 40px; border-radius: 3px; object-fit: cover; background: var(--bg-active); flex: none; }
.game-hit-name { flex: 1; font-weight: 600; }
.game-hit-year { font-size: 12px; color: var(--text-muted); }
.game-chip-cover { width: 16px; height: 16px; border-radius: 3px; object-fit: cover; margin-left: -4px; }
.game-chip.small .game-chip-cover { width: 14px; height: 14px; }
.activity-cover { width: 14px; height: 14px; border-radius: 3px; object-fit: cover; vertical-align: -3px; margin-right: 4px; }

.role-tag.emoji { border: none; padding: 0; font-size: 14px; height: auto; vertical-align: -1px; }
.role-tag.emoji .custom-emoji { width: 16px; height: 16px; margin: 0; vertical-align: -3px; }
.roles-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.roles-head .setting-sub { flex: 1; min-width: 0; }
.roles-head .btn-primary { flex: none; }
.role-cards { display: flex; flex-direction: column; gap: 10px; }
.role-card { background: var(--bg-dark); border-radius: var(--radius); overflow: hidden; }
.role-card-banner {
  position: relative;
  height: 64px;
  background-size: cover;
  background-position: center;
}
.role-banner-tools { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; }
.role-banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 14px;
  background: rgba(11, 13, 23, .72);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.role-banner-btn:hover { background: rgba(11, 13, 23, .9); }
.role-banner-btn.icon { width: 28px; padding: 0; justify-content: center; }
.role-card-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; font-size: 14px; font-weight: 500; }
.role-card-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-card .role-form { border-top: 1px solid var(--bg-active); }
#new-role-card { margin-bottom: 14px; }
.role-form { background: var(--bg-darkest); border-radius: var(--radius); overflow: hidden; }
.rf-preview { position: relative; height: 96px; background-size: cover; background-position: center; }
.rf-preview::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .5)); pointer-events: none; }
.rf-preview .role-banner-tools { top: 10px; bottom: auto; z-index: 1; }
.rf-preview-name {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 10px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
  overflow: hidden;
  white-space: nowrap;
}
.rf-preview-name > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.rf-body { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.rf-body .setting-title { margin-top: 4px; }
.rf-swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rf-swatch { width: 28px; height: 28px; padding: 0; border: 2px solid transparent; border-radius: 50%; cursor: pointer; box-shadow: inset 0 0 0 2px var(--bg-darkest); }
.rf-swatch:hover { border-color: var(--text-faint); }
.rf-swatch.on { border-color: var(--header-primary); }
.rf-swatches input[type="color"] { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.rf-group { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); margin-top: 2px; }
.role-form .perm-grid { gap: 8px 16px; font-size: 14px; }
.role-form .perm-grid input, .rf-admin input { accent-color: var(--accent); width: 16px; height: 16px; }
.rf-admin { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-top: 4px; padding: 10px 12px; border: 1px solid var(--bg-active); border-radius: 8px; color: var(--text-normal); font-size: 14px; cursor: pointer; }
.rf-admin .setting-sub { flex-basis: 100%; margin: 0; padding-left: 24px; }
.rf-mention { display: flex; align-items: center; gap: 12px; margin-top: 4px; padding: 10px 12px; border: 1px solid var(--bg-active); border-radius: 8px; cursor: pointer; }
.rf-mention-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rf-mention-text .setting-title { margin: 0; font-size: 14px; }
.rf-mention-text .setting-sub { margin: 0; }
.role-form .form-actions { justify-content: space-between; margin-top: 4px; }
.role-banner-row { display: flex; gap: 12px; align-items: center; }
.role-banner-preview {
  flex: none;
  width: 150px;
  height: 60px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: rgba(255, 255, 255, .75);
}
.role-banner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.role-banner-actions .setting-sub { flex-basis: 100%; }
.role-pick { position: relative; overflow: hidden; }
.role-pick.has-banner { padding-top: 46px; }
.role-pick-banner { position: absolute; left: 0; right: 0; top: 0; height: 38px; background-size: cover; background-position: center; }

.member-card {
  position: fixed;
  z-index: 125;
  width: 300px;
  background: var(--bg-darkest);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .55);
  overflow: hidden;
}
.mc-banner { position: relative; height: 105px; background-size: cover; background-position: center; }
.mc-head { position: relative; height: 44px; }
.mc-head .avatar { position: absolute; left: 16px; top: -40px; width: 80px; height: 80px; font-size: 26px; box-shadow: 0 0 0 6px var(--bg-darkest); }
.mc-head .presence-dot { width: 16px; height: 16px; box-shadow: 0 0 0 4px var(--bg-darkest); right: 2px; bottom: 2px; }
.mc-body { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.mc-name-row { display: flex; align-items: center; }
.mc-name { font-size: 20px; font-weight: 700; color: var(--text-normal); }
.mc-pronouns { margin-left: 8px; font-size: 13px; font-weight: 500; color: var(--text-muted); }
.mc-username { font-size: 13px; font-weight: 500; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-status { font-size: 13px; color: var(--text-muted); min-height: 16px; }
.mc-label { margin-top: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); }
.mc-roles { display: flex; flex-wrap: wrap; gap: 4px; }
.mc-role { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; background: var(--bg-dark); font-size: 12px; font-weight: 500; color: var(--text-normal); }
.mc-message { margin-top: 10px; width: 100%; }

.ctx-slider { padding: 6px 8px 8px; }
.ctx-slider-label { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.ctx-slider input[type="range"] { width: 100%; }
.vs-icon.forced { color: var(--red); }
.voice-user.muted-for-me .voice-user-name { text-decoration: line-through; opacity: .7; }
#report-server-row { margin: 8px 0; }
.ctx-slider input[type="range"] { background: linear-gradient(to right, var(--accent) var(--fill, 50%), var(--bg-active) var(--fill, 50%)); height: 6px; }

.mc-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.mc-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: none;
  border-radius: 6px;
  background: var(--bg-dark);
  color: var(--text-normal);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.mc-action:hover { background: var(--bg-active); }
.mc-action.on { color: var(--green); }
.mc-action.danger { color: var(--red); }
.member-card .mc-more {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(11, 13, 23, .55);
  color: #fff;
}
.member-card .mc-more:hover { background: rgba(11, 13, 23, .8); }
.mc-about { margin-top: 6px; font-size: 13px; line-height: 1.4; color: var(--text-normal); white-space: pre-wrap; word-wrap: break-word; }
.mc-composer {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  padding: 0 6px 0 10px;
  min-height: 40px;
  border-radius: 8px;
  background: var(--bg-dark);
}
.mc-composer input { flex: 1; min-width: 0; border: none; background: none; color: var(--text-normal); font: inherit; font-size: 14px; outline: none; }
#mc-gif { width: auto; padding: 0 6px; font-size: 11px; font-weight: 800; }
.ctx-empty { padding: 8px; font-size: 12px; color: var(--text-muted); }

.invite-card { display: flex; align-items: center; gap: 12px; margin-top: 6px; padding: 12px 14px; max-width: 440px; border-radius: var(--radius); background: var(--bg-raised); border: 1px solid var(--line); }
.msg-content > .invite-card:first-child { margin-top: 2px; }
.invite-card-mark { width: 38px; height: 38px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--bg-active); color: var(--accent); }
.invite-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.invite-card-title { font-size: 14px; font-weight: 600; color: var(--header-primary); }
.invite-card-sub { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.friend-request .icon-btn { width: 28px; height: 28px; flex: none; }
.friend-note { height: 16px; line-height: 16px; }
.add-friend-who { display: flex; align-items: center; gap: 10px; }
.add-friend-who .avatar { flex: none; }
.add-friend-who input { flex: 1; min-width: 0; }
.modal input#add-friend-username[readonly] { color: var(--text-muted); cursor: default; }
.add-friend-count {
  height: 16px;
  line-height: 16px;
  margin-top: -6px;
  font-size: 12px;
  text-align: right;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.friend-yes:hover { color: var(--green); }
.friend-no:hover { color: var(--red); }

.modal.modal-profile { width: min(600px, calc(100vw - 32px)); padding: 0; overflow: hidden; }
.fp-banner { position: relative; height: 140px; background-size: cover; background-position: center; }
.fp-head { display: flex; align-items: flex-end; justify-content: space-between; padding: 0 20px; height: 56px; position: relative; }
.fp-head .avatar { position: absolute; left: 20px; top: -56px; width: 112px; height: 112px; font-size: 36px; box-shadow: 0 0 0 7px var(--bg-dark); }
.fp-head .presence-dot { width: 20px; height: 20px; box-shadow: 0 0 0 5px var(--bg-dark); right: 4px; bottom: 4px; }
.fp-buttons { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.fp-more { width: 32px; height: 32px; border-radius: 50%; background: var(--bg-raised); color: var(--text-normal); }
.fp-more:hover { background: var(--bg-active); color: var(--header-primary); }
.fp-menu { z-index: 180; }
.fp-menu button { display: flex; align-items: center; gap: 10px; }
.fp-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; }
.fp-name-row { display: flex; align-items: center; }
.fp-name { font-size: 24px; font-weight: 700; color: var(--header-primary); font-family: var(--font-display); letter-spacing: -.01em; }
.fp-username { font-size: 14px; color: var(--text-muted); }
.fp-status { font-size: 14px; color: var(--text-normal); margin-top: 4px; }
.fp-section { margin-top: 14px; }
.fp-about { font-size: 14px; line-height: 1.45; color: var(--text-normal); white-space: pre-wrap; }
.fp-list { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.fp-friend { font-size: 14px; color: var(--text-normal); }
.gif-picker.gif-picker-float { position: fixed; right: auto; bottom: auto; z-index: 135; max-height: calc(100vh - 16px); }
.member-card .mc-composer { margin: 12px 0 0; padding: 0 6px 0 12px; background: var(--bg-dark); }
.vp-game-share { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 30px; margin-bottom: 8px; border: none; border-radius: 6px; background: var(--green); color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; overflow: hidden; white-space: nowrap; }
.vp-game-share span { overflow: hidden; text-overflow: ellipsis; }
.vp-game-share:hover { filter: brightness(1.1); }
.share-card-label .kind.playing { color: var(--green); }

.user-actions { flex: 0 0 auto; width: auto; gap: 2px; }
.split-btn { display: flex; align-items: center; border-radius: 6px; }
.split-btn:hover { background: var(--bg-hover); }
.split-btn .icon-btn:hover { background: none; color: var(--text-normal); }
.caret-btn {
  width: 14px;
  height: 32px;
  padding: 0;
  margin-left: -4px;
  border: none;
  background: none;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 0 6px 6px 0;
}
.caret-btn:hover { color: var(--text-normal); }
.caret-btn svg { width: 12px; height: 12px; }

.user-actions .icon-btn { position: relative; }
.toggle-anim > svg { animation: toggle-bounce .38s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes toggle-bounce {
  0% { transform: scale(1); }
  35% { transform: scale(.78); }
  70% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
.slash-in::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: var(--red);
  transform: translate(-50%, -50%) rotate(45deg) scaleX(0);
  animation: slash-draw .3s ease-out forwards;
  pointer-events: none;
}
@keyframes slash-draw {
  to { transform: translate(-50%, -50%) rotate(45deg) scaleX(1); opacity: 0; }
}

.audio-pop {
  position: fixed;
  z-index: 130;
  width: 240px;
  background: var(--bg-darkest);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ap-title { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.audio-pop select { width: 100%; }
.audio-pop input[type="range"] { width: 100%; background: linear-gradient(to right, var(--accent) var(--fill, 50%), var(--bg-active) var(--fill, 50%)); height: 6px; }
.audio-pop .pp-link { margin-top: 4px; }
.audio-pop select { background: var(--bg-dark); color: var(--text-normal); border: 1px solid var(--bg-active); border-radius: 6px; padding: 7px 8px; font: inherit; font-size: 13px; outline: none; color-scheme: dark; }

.vp-status { cursor: pointer; }
.vp-status:hover { text-decoration: underline; }
.vp-signal[data-quality="good"] { color: var(--green); }
.vp-signal[data-quality="ok"] { color: var(--yellow); }
.vp-signal[data-quality="bad"] { color: var(--red); }
.conn-pop {
  position: fixed;
  z-index: 130;
  width: 300px;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--bg-darkest);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.conn-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.conn-title { font-size: 14px; font-weight: 700; color: var(--text-normal); }
.conn-rates { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.conn-links { display: flex; flex-direction: column; gap: 8px; }
.conn-tabs { display: flex; flex-direction: column; gap: 2px; flex: 0 0 auto; max-height: 172px; overflow-y: auto; }
.conn-tab { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 8px; border: 0; border-radius: 8px; background: none; color: var(--text-muted); cursor: pointer; text-align: left; font: inherit; font-size: 12px; }
.conn-tab .avatar { width: 20px; height: 20px; flex: 0 0 auto; }
.conn-tab.active { background: var(--bg-active); color: var(--text-normal); }
.conn-tab:hover:not(.active) { background: var(--bg-dark); }
.conn-tab-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.conn-path { flex: 0 0 auto; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 8px; background: var(--bg-dark); color: var(--text-muted); }
.conn-path.direct { color: var(--green); }
.conn-path.relay, .conn-path.mixed { color: var(--yellow); }
.conn-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.conn-tab[data-quality="ok"] .conn-dot { background: var(--yellow); }
.conn-tab[data-quality="bad"] .conn-dot { background: var(--red); }
.conn-link { min-height: 128px; }
.conn-link { background: var(--bg-dark); border-radius: 10px; padding: 8px 10px; }
.conn-link-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.conn-name { flex: 1; font-size: 13px; font-weight: 600; color: var(--text-normal); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn-badge { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 8px; }
.conn-badge.good { background: rgba(53, 194, 107, .18); color: var(--green); }
.conn-badge.ok { background: rgba(240, 178, 50, .18); color: var(--yellow); }
.conn-badge.bad { background: rgba(255, 77, 77, .18); color: var(--red); }
.conn-grid { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 12px; }
.conn-label { color: var(--text-muted); }
.conn-value { color: var(--text-normal); text-align: right; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn-empty { font-size: 13px; color: var(--text-muted); }
.conn-foot { font-size: 11px; color: var(--text-faint); }
.conn-title { white-space: nowrap; }

.invite-link-warning { margin: 4px 0 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(255, 77, 77, .35); background: rgba(255, 77, 77, .08); color: var(--text-normal); font-size: 13px; line-height: 1.45; }
.invite-field { font-size: 13px; line-height: 1.4; word-break: break-all; resize: none; color: var(--text-normal); }
.invite-actions { display: flex; gap: 8px; }
#modal-invite #invite-friend-search { width: 100%; box-sizing: border-box; margin-bottom: 6px; }
.invite-people { height: 188px; margin-bottom: 12px; }
.invite-person { cursor: default; }
.invite-person .dm-meta { flex: 1; min-width: 0; }
.invite-person button { flex: none; width: 72px; }
.invite-expiry { margin: 4px 0 12px; }
.invite-expiry .segmented button { padding: 8px 6px; }
.invite-expiry-note { margin: -4px 0 12px; min-height: 18px; }
.invite-actions button { flex: 1; min-width: 0; }
#modal-invite-link .sw-head { margin-bottom: 14px; }

.modal.modal-signin { width: min(440px, calc(100vw - 32px)); text-align: center; }
.signin-logo { width: 56px; height: 56px; margin: 0 auto 4px; display: block; }
.modal-signin p { line-height: 1.45; }
.signin-go { width: 100%; height: 44px; font-size: 15px; }
.signin-note { margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.signin-label { font-size: 13px; color: var(--text-muted); }
.signin-code { margin: 10px 0; font-size: 30px; font-weight: 800; letter-spacing: .12em; color: var(--text-normal); font-variant-numeric: tabular-nums; }
.signin-status { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.signin-spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--bg-active); border-top-color: var(--accent); animation: signin-spin .8s linear infinite; }
@keyframes signin-spin { to { transform: rotate(360deg); } }
.signin-links { display: flex; justify-content: center; gap: 16px; margin-top: 10px; }
.claim-profile { margin: 14px 0; padding: 12px 14px; border-radius: 10px; background: var(--bg-raised); border: 1px solid var(--line); font-weight: 600; color: var(--text-normal); overflow-wrap: anywhere; }
.claim-actions { display: flex; gap: 10px; }
.claim-actions button { flex: 1; min-width: 0; height: 40px; }
.signin-back { display: block; margin: 10px auto 0; }
.signin-start.signin-loading { visibility: hidden; }
.signin-form, .signin-step { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.signin-form.hidden, .signin-step.hidden { display: none; }
.signin-field { width: 100%; min-height: 44px; background: var(--input-bg); border: 1px solid transparent; border-radius: 10px; padding: 10px 12px; color: var(--text-normal); font-size: 16px; font-family: inherit; outline: none; user-select: text; transition: border-color var(--t-hover) ease; }
.signin-field:focus { border-color: var(--focus); }
.signin-code-input { text-align: center; font-size: 22px; letter-spacing: .2em; font-variant-numeric: tabular-nums; }
.signin-apple { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 44px; border: none; border-radius: var(--radius-pill); background: #fff; color: #000; font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif; font-size: 16px; font-weight: 600; cursor: pointer; }
.signin-apple:disabled, .signin-form .signin-go:disabled, .signin-step .signin-go:disabled { opacity: .6; cursor: default; }
.signin-apple-logo { width: 16px; height: 19px; background: currentColor; -webkit-mask: var(--apple-logo) center / contain no-repeat; mask: var(--apple-logo) center / contain no-repeat; }
.signin-socials { display: flex; flex-direction: column; gap: 10px; }
.signin-socials.hidden { display: none; }
.signin-socials.icons { flex-direction: row; justify-content: center; gap: 16px; }
.signin-social { display: flex; align-items: center; justify-content: center; gap: 10px; }
.signin-socials.icons > .signin-social { flex: none; width: 46px; height: 46px; padding: 0; border-radius: 50%; }
.signin-socials.icons > .signin-social.hidden { display: none; }
.signin-socials.icons .signin-social-label { display: none; }
.signin-social-logo { flex: none; width: 18px; height: 18px; background: currentColor; -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat; }
.signin-socials.icons .signin-social-logo { width: 20px; height: 20px; }
.signin-social-logo.google { -webkit-mask-image: var(--google-logo); mask-image: var(--google-logo); }
.signin-social-logo.twitch { -webkit-mask-image: var(--twitch-logo); mask-image: var(--twitch-logo); }
.signin-create { display: block; margin: 14px auto 0; font-size: 14px; }
#modal-signin .signin-form > .signup-away { display: none; }
#modal-signin.signin-inbox-open > :is(#signin-intro, .signin-server, .signin-server-note, .signin-move-note) { display: none; }
#modal-signin.signin-inbox-open #signin-create { display: none; }
.signin-inbox { display: flex; flex-direction: column; gap: 10px; }
.signin-inbox.hidden { display: none; }
.signin-inbox-text { margin: 0 0 6px; color: var(--text-normal); font-size: 14.5px; line-height: 1.45; text-align: center; overflow-wrap: anywhere; }
.signin-inbox-link { display: block; margin: 0 auto; font-size: 14px; }
.signin-create.hidden { display: none; }
#modal-signin.in-app > * { order: 2; }
#modal-signin.in-app > :is(.dstar, .signin-logo, h2, p) { order: 0; }
#modal-signin.in-app > :is(.signin-server, .signin-server-note, .signin-move-note) { order: 1; }
#modal-signin.in-app > :is(.signin-server-help, .signin-server-note.plain) { display: none; }
#modal-signin.in-app > .signin-server { margin: 16px 0 0; padding-top: 0; border-top: 0; }
#modal-signin.in-app > .signin-server-note { margin-bottom: 4px; }
.signin-server-field { position: relative; }
.signin-server-official { position: absolute; inset: 0 46px 0 var(--official-inset, 12px); z-index: 1; display: flex; align-items: center; gap: 6px; color: var(--header-primary, var(--text-normal)); font: 400 15px/1 var(--font); pointer-events: none; white-space: nowrap; overflow: hidden; }
.signin-server-official.hidden { display: none; }
html[data-look="studio"] .signin-server-official { --official-inset: 44px; }
#modal-signin .signin-server-field.official select#signin-server-select { color: transparent; }
.signin-verified { position: relative; flex: none; width: 17px; height: 17px; background: var(--accent); -webkit-mask: var(--verified-seal) center / contain no-repeat; mask: var(--verified-seal) center / contain no-repeat; }
.signin-verified::after { content: ""; position: absolute; inset: 0; background: #fff; -webkit-mask: var(--verified-check) center / contain no-repeat; mask: var(--verified-check) center / contain no-repeat; }
:root { --verified-seal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z'/%3E%3C/svg%3E"); --verified-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m8.5 12 2.5 2.5 4.5-5'/%3E%3C/svg%3E"); }
.signin-passkey { display: block; margin: 0 auto; font-size: 13px; }
.signin-passkey.hidden { display: none; }
.modal-signin .signin-start #signin-password.tucked { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; margin: 0; border: 0; opacity: 0; overflow: hidden; clip-path: inset(50%); pointer-events: none; }
.signin-adult { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; color: var(--text-normal); text-align: left; cursor: pointer; }
.signin-adult input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.signin-terms { padding: 0; font-size: inherit; color: var(--link); text-decoration: underline; }
.signin-check { display: flex; justify-content: center; min-height: 65px; }
.signin-check iframe { width: 300px; max-width: 100%; height: 65px; border: 0; background: transparent; }
:root { --apple-logo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701'/%3E%3C/svg%3E"); }
:root { --google-logo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.48 10.92v3.28h7.84c-.24 1.84-.853 3.187-1.787 4.133-1.147 1.147-2.933 2.4-6.053 2.4-4.827 0-8.6-3.893-8.6-8.72s3.773-8.72 8.6-8.72c2.6 0 4.507 1.027 5.907 2.347l2.307-2.307C18.747 1.44 16.133 0 12.48 0 5.867 0 .307 5.387.307 12s5.56 12 12.173 12c3.573 0 6.267-1.173 8.373-3.36 2.16-2.16 2.84-5.213 2.84-7.667 0-.76-.053-1.467-.173-2.053H12.48z'/%3E%3C/svg%3E"); --twitch-logo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11.571 4.714h1.715v5.143H11.57zm4.715 0H18v5.143h-1.714zM6 0L1.714 4.286v15.428h5.143V24l4.286-4.286h3.428L22.286 12V0zm14.571 11.143l-3.428 3.428h-3.429l-3 3v-3H6.857V1.714h13.714Z'/%3E%3C/svg%3E"); }
.modal.modal-accounts { width: min(440px, calc(100vw - 32px)); }
.modal-accounts p { line-height: 1.45; }
.account-list { display: flex; flex-direction: column; gap: 6px; margin: 14px 0 8px; }
.account-row { display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 10px 0 0; border-radius: 10px; background: var(--bg-raised); border: 1px solid var(--line); }
.account-row.current { border-color: var(--accent); }
.account-pick { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; gap: 12px; padding: 0 0 0 10px; border: none; background: none; color: var(--text-normal); font-family: inherit; text-align: left; border-radius: 10px 0 0 10px; cursor: pointer; }
.account-row.current .account-pick { cursor: default; }
.account-row:not(.current) .account-pick:hover .account-name { color: var(--accent); }
.account-avatar { width: 36px; height: 36px; flex: none; font-size: 14px; }
.account-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.account-name { font-family: var(--font-display); font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-email { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-check { flex: none; width: 20px; display: flex; align-items: center; justify-content: center; color: var(--accent); }
.account-row:not(.current) .account-check { visibility: hidden; }
.account-sign-out { flex: none; width: 84px; text-align: right; }
.account-add { width: 100%; height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 10px; border-radius: 10px; border: 1px dashed var(--line); background: none; color: var(--text-normal); font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.account-add:hover:not(:disabled) { border-color: var(--accent); }
.account-add:disabled { opacity: .5; cursor: default; }
.account-note { min-height: 32px; margin-top: 8px; text-align: center; }
.account-note.error { color: var(--red); }
.account-delete-card .btn-danger { flex: none; white-space: nowrap; }
.delete-account-step { display: flex; flex-direction: column; gap: 10px; }
.delete-account-step .btn-link { align-self: flex-start; }
.modal p.delete-account-note { min-height: 20px; font-size: 13px; }
.modal p.delete-account-note.error { color: var(--red); }
.account-add-icon { width: 36px; display: flex; justify-content: center; color: var(--text-muted); }
.signin-error { margin-top: 10px; padding: 8px 10px; border-radius: 6px; background: rgba(255, 77, 77, .12); color: var(--red); font-size: 13px; }
.account-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.signin-server { display: flex; flex-direction: column; gap: 6px; margin-top: 18px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.signin-server-field { display: grid; min-height: 40px; }
.signin-server select { width: 100%; min-width: 0; padding: 8px 10px; line-height: 1.4; text-overflow: ellipsis; text-transform: none; letter-spacing: 0; font-weight: 500; }
.signin-server-edit { display: flex; align-items: stretch; gap: 8px; text-transform: none; letter-spacing: 0; }
.signin-server-edit input { flex: 1; min-width: 0; padding-block: 8px; line-height: 1.4; font-weight: 500; }
.signin-server-edit input[aria-invalid="true"] { border-color: var(--red); }
.signin-server-edit .btn-small { flex: none; }
.signin-server-edit .btn-link { flex: none; font-weight: 600; }
.signin-server-note { margin-top: 8px; font-size: 12px; color: var(--text-faint); text-align: left; line-height: 1.4; min-height: 4.2em; }
.signin-server-note.warn { color: var(--text-normal); }
.signin-server-note.error { color: var(--red); }

.entry-recovery { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.entry-recovery input { flex: 1; min-width: 240px; font-family: var(--font-code, monospace); font-size: 13px; }
.entry-recovery .setting-sub { flex-basis: 100%; }
.entry-held { display: grid; gap: 6px; padding: 10px 12px; border-left: 4px solid var(--yellow); border-radius: 8px; background: var(--bg-raised); }
.entry-held.hidden { display: none; }
.entry-held-keys { display: flex; gap: 8px; flex-wrap: wrap; }
.entry-earlier-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; max-height: min(50vh, 420px); overflow-y: auto; }
.entry-earlier-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 8px; background: var(--bg-raised); }
.entry-earlier-row > div { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.entry-earlier-row > .btn-small { flex: none; }

.si-banner { height: 120px; margin: -4px -4px 14px; border-radius: 12px; background-size: cover; background-position: center; }
.si-games { padding: 10px 0 0; }
.si-games .game-chip.small { font-size: 12px; padding: 3px 9px; color: var(--text-normal); }
.si-section { margin-top: 14px; }
.si-label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
#si-rules { margin: 0; max-height: 36vh; }
.si-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.si-role { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--bg-raised); border: 1px solid var(--line); font-size: 13px; color: var(--text-normal); }
.si-role .role-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); }
.btn-secondary.danger-text { color: var(--accent); }

#pins-btn { position: relative; }
.pin-count {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-ink, #fff);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.pins-pop {
  position: absolute;
  top: 54px;
  right: 12px;
  width: 400px;
  max-width: calc(100% - 24px);
  max-height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  background: var(--bg-darkest);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
  z-index: 120;
  overflow: hidden;
}
.pins-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
}
.pins-pop-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--header-primary); }
.pins-pop-head .btn-link { font-size: 13px; color: var(--text-muted); padding: 0; }
.pins-pop-head .btn-link:hover { color: var(--header-primary); text-decoration: underline; }
.pins-list { overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.pins-list-wide { max-height: 56vh; margin: 0 -8px; }
.pin-row {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  transition: background var(--t-hover, .12s) ease;
}
.pin-row:hover, .pin-row:focus-visible { background: var(--bg-hover); outline: none; }
.pin-row .avatar { width: 32px; height: 32px; flex-shrink: 0; }
.pin-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pin-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; padding-right: 24px; }
.pin-author { font-family: var(--font-display); font-weight: 600; color: var(--header-primary); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin-time, .pin-channel { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.pin-channel { margin-left: auto; }
.pin-text {
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-normal);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.pin-text.muted { color: var(--text-muted); font-style: italic; }
.pin-thumb { max-width: 180px; max-height: 110px; border-radius: 8px; margin-top: 4px; }
.pin-by { font-size: 12px; color: var(--text-faint); }
.pin-unpin {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-faint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--t-hover, .12s) ease, background var(--t-hover, .12s) ease, color var(--t-hover, .12s) ease;
}
.pin-row:hover .pin-unpin, .pin-row:focus-within .pin-unpin { opacity: 1; }
.pin-unpin:hover { background: var(--accent); color: var(--accent-ink, #fff); }
.pins-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 36px 24px 40px;
  color: var(--text-muted);
}
.pins-empty-mark {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--bg-raised);
  color: var(--header-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.pins-empty strong { font-family: var(--font-display); font-size: 15px; color: var(--header-primary); }
.pins-empty span { font-size: 13px; line-height: 1.4; max-width: 280px; }
.pins-group-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 12px 4px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-muted);
}
.pins-group-head .hash { font-size: 16px; color: var(--text-faint); }
.pins-group-head .channel-icon { width: 18px; }
.msg-pinned {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--text-muted);
  cursor: default;
}
.msg-pinned svg { color: var(--accent); }
.msg.pinned { box-shadow: inset 3px 0 0 rgba(255, 77, 77, .55); }
.msg-held {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--text-muted);
  cursor: default;
}
.msg-held svg { color: var(--text-faint); }
.msg-tts {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  width: 62px;
  height: 16px;
  box-sizing: border-box;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--text-muted);
  cursor: default;
  white-space: nowrap;
  overflow: hidden;
}
.msg-tts svg { color: var(--accent); flex-shrink: 0; }
.tts-preview-row { padding-top: 10px; margin-top: 8px; border-top: 1px solid var(--line); }
.tts-voice-row { padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.settings-page select.tts-voice-select { width: 240px; min-width: 0; flex: none; text-overflow: ellipsis; }
.tts-voice-status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.msg.held { box-shadow: inset 3px 0 0 var(--text-faint); }
.msg.held .msg-body > :not(.msg-head) { opacity: .55; }

.channel .announce-icon { width: 20px; color: var(--text-faint); }
.channel .announce-icon svg { width: 18px; height: 18px; }
.chat-header .hash svg { vertical-align: -5px; }
.announce-gate { border-color: var(--line); background: var(--bg-dark); }
.announce-gate-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--bg-raised);
  color: var(--header-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.timeout-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  border-radius: 6px;
  background: var(--bg-active);
  color: var(--yellow);
  vertical-align: 2px;
}
.timeout-badge svg { width: 12px; height: 12px; }
.mc-name-row .timeout-badge { margin-left: 6px; }
.timeout-left { color: var(--header-primary); font-variant-numeric: tabular-nums; }
.timeout-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.timeout-choice {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-darkest);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 8px;
  cursor: pointer;
}
.timeout-choice:hover { color: var(--text-normal); background: var(--bg-hover); }
.timeout-choice.active { color: var(--ink-strong); background: var(--bg-active); border-color: var(--bg-active); }
.modal-moderate .timeout-choices { margin: 0 0 4px; }
.removed-list { display: flex; flex-direction: column; gap: 6px; }
.removed-list .manage-row-label { flex: 1; }
.removed-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.removed-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.removed-meta { color: var(--text-muted); font-size: 12px; font-weight: 400; }
.removed-actions { display: flex; gap: 6px; flex-shrink: 0; }

.update-card .update-state { min-height: calc(2 * 1.4em); }
.update-card .update-action { flex: 0 0 152px; width: 152px; white-space: nowrap; }
.conn-test-intro { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.conn-test-run { flex: 0 0 120px; width: 120px; white-space: nowrap; }
.conn-test-result { background: var(--bg-darkest); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-height: calc(4 * 1.4em + 52px); }
.conn-test-head { display: flex; align-items: center; gap: 8px; min-height: 20px; }
.conn-badge.idle { background: var(--bg-active); color: var(--text-muted); }
.conn-test-summary { font-size: 14px; font-weight: 600; color: var(--header-primary); }
.conn-test-grid { font-size: 13px; max-width: 420px; }
.conn-test-grid .conn-value { text-align: left; }
.conn-test-detail { min-height: calc(2 * 1.4em); }
.conn-test.running .conn-test-result { opacity: .6; }
.log-actions { display: flex; gap: 8px; flex: 0 0 auto; }
#settings-btn { position: relative; }
#settings-btn::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg-raised);
  opacity: 0;
  pointer-events: none;
}
#settings-btn.update-ready::after { opacity: 1; }
.sound-emoji { font-size: 16px; line-height: 1; flex: none; }
.sb-sound .custom-emoji { width: 16px; height: 16px; margin: 0; vertical-align: 0; flex: none; }
.sound-emoji-btn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.sound-emoji-btn .custom-emoji { width: 24px; height: 24px; margin: 0; vertical-align: 0; }
.sound-emoji-btn .sound-emoji { font-size: 22px; }
.rf-swatches input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.rf-swatches input[type="color"]::-webkit-color-swatch { border: 2px solid var(--bg-active); border-radius: 50%; }
.rf-swatches input[type="color"]::-moz-color-swatch { border: 2px solid var(--bg-active); border-radius: 50%; }

.main { --chat-gutter: max(0px, calc((100% - 1400px) / 2)); }
.messages { padding-inline: calc(16px + var(--chat-gutter)); }
.composer, .awaited-bar, .typing-strip { margin-inline: calc(12px + var(--chat-gutter)); }

@media (max-height: 760px) {
  .sidebar-header.has-banner { height: 76px; padding-top: 8px; }
  .sidebar-header.has-banner > #server-name { bottom: 8px; }
  .channel-scroll { padding: 8px; }
}

.channel-lock {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: inline-flex;
  color: var(--text-faint);
}
.channel.unreadable .channel-label { opacity: .55; }
.channel-bell {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: inline-flex;
  color: var(--header-primary);
  opacity: .55;
}
.channel-bell svg { width: 14px; height: 14px; }
.channel .channel-gear { margin-left: auto; }
.channel .channel-gear + .channel-bell { margin-left: 0; }
.channel .channel-label + .channel-bell, .channel .channel-lock + .channel-bell, .channel .voice-count + .channel-bell { margin-left: auto; }
.voice-channel .voice-count + .channel-bell { margin-left: 0; }

.msg-sealed {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-faint);
  font-style: italic;
}
.msg-sealed svg { flex-shrink: 0; }

.access-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.access-chip {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 15px;
  border: 1px solid var(--bg-active);
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.access-chip .role-dot { width: 10px; height: 10px; }
.access-chip:hover { background: var(--bg-hover); color: var(--text-normal); }
.access-chip.picked {
  border-color: var(--accent);
  background: rgba(255, 77, 77, .12);
  color: var(--text-normal);
}
.access-note {
  min-height: 20px;
  margin: 4px 2px 12px;
  font-size: 13px;
  color: var(--text-faint);
}
.modal.modal-template { width: min(580px, calc(100vw - 32px)); }
.template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.template-tile {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  height: 60px;
  padding: 0 12px;
  background: var(--bg-dark);
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-normal);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--t-hover) ease, border-color var(--t-hover) ease;
}
.template-tile:hover { background: var(--bg-hover); }
.template-tile[aria-checked="true"] { border-color: var(--accent); background: var(--bg-hover); }
.template-tile-icon {
  grid-row: span 2;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-active);
  color: var(--header-primary);
  transition: background var(--t-hover) ease, color var(--t-hover) ease;
}
.template-tile[aria-checked="true"] .template-tile-icon { background: var(--accent); color: var(--accent-ink); }
.template-tile-title { font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--header-primary); align-self: end; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.template-tile-blurb { font-size: 12px; color: var(--text-muted); align-self: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.template-preview {
  height: 188px;
  background: var(--input-bg);
  border-radius: var(--radius);
  padding: 12px 14px;
  overflow: hidden;
}
.template-preview-view, .template-code-entry { height: 100%; display: flex; flex-direction: column; gap: 8px; }
.template-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 18px; }
.template-preview-summary { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.template-preview-head .btn-link { font-size: 12px; color: var(--link); padding: 0; }
.template-preview-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.template-group { display: grid; grid-template-columns: 104px minmax(0, 1fr); column-gap: 8px; align-items: start; }
.template-group-name { height: 22px; line-height: 22px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.template-group-chips { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.template-chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: var(--radius-pill); background: var(--bg-raised); font-size: 13px; color: var(--text-normal); }
.template-chip svg, .template-chip .template-hash { color: var(--text-faint); flex: none; }
.template-hash { font-weight: 700; }
.template-role-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); flex: none; }
.template-code-entry textarea { flex: 1; min-height: 0; background: var(--bg-dark); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; word-break: break-all; }
.template-code-entry textarea:focus { border-color: var(--accent); }
.template-code-note { height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.template-code-note.error { color: var(--red); }
#server-template-copy { flex: none; white-space: nowrap; }

.search-box {
  flex: none;
  width: 208px;
  height: 32px;
  margin-left: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px 0 10px;
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-faint);
  cursor: text;
  transition: border-color var(--t-hover) ease, color var(--t-hover) ease;
}
.search-box:focus-within, .search-box.open { border-color: var(--line-strong); color: var(--text-muted); }
.search-box-icon { display: inline-flex; flex: none; }
.search-box input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: none;
  border: none;
  outline: none;
  color: var(--text-normal);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 400;
}
.search-box input::placeholder { color: var(--text-faint); }
.search-clear {
  flex: none;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-faint);
  cursor: pointer;
  visibility: hidden;
}
.search-box.has-text .search-clear { visibility: visible; }
.search-clear:hover { background: var(--bg-hover); color: var(--header-primary); }

.search-pop {
  position: absolute;
  top: 54px;
  right: 12px;
  width: 440px;
  max-width: calc(100% - 24px);
  height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  background: var(--bg-darkest);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
  z-index: 120;
  overflow: hidden;
}
.search-pop-head {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
}
.search-pop-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--header-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-pop-sub { font-size: 12px; color: var(--text-muted); min-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.search-row.active { background: var(--bg-hover); }
.search-filter-key { flex: none; width: 112px; font-family: var(--font-display); font-weight: 700; color: var(--header-primary); }
.search-filter-row .mention-hint, .search-tip-row .mention-hint { margin-left: 0; }
.search-hit { background: rgba(255, 77, 77, .24); color: var(--header-primary); border-radius: 3px; }
.search-empty { margin: auto 0; }
.search-scope {
  flex: none;
  display: flex;
  gap: 2px;
  margin-top: 8px;
  padding: 2px;
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.search-scope-btn {
  flex: 1 1 0;
  min-width: 0;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background var(--t-hover) ease, color var(--t-hover) ease;
}
.search-scope-btn:hover { color: var(--text-normal); }
.search-scope-btn.active { background: var(--bg-active); color: var(--header-primary); }
.search-scope-btn:disabled { color: var(--text-faint); opacity: .5; cursor: default; }
.search-scope-btn:disabled:hover { color: var(--text-faint); }
.search-pager {
  flex: none;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px 0 16px;
  border-top: 1px solid var(--line);
}
.search-pager.idle > * { visibility: hidden; }
.search-page-label { flex: 1; min-width: 0; font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-page-btn {
  flex: none;
  width: 68px;
  height: 28px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--bg-active);
  color: var(--header-primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--t-hover) ease, color var(--t-hover) ease, opacity var(--t-hover) ease;
}
.search-page-btn:hover { background: var(--header-primary); color: var(--bg-darkest); }
.search-page-btn:disabled { opacity: .35; cursor: default; }
.search-page-btn:disabled:hover { background: var(--bg-active); color: var(--header-primary); }
.search-run-head { margin-top: 6px; }
.search-run-head:first-child { margin-top: 0; }

.history-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  margin: 16px 16px 4px;
  flex: none;
  border: 1px dashed var(--line);
  border-radius: var(--radius-pill);
  font-size: 13px;
  color: var(--text-muted);
}
.history-notice svg { width: 16px; height: 16px; color: var(--text-faint); }

.history-pill {
  position: sticky;
  bottom: 8px;
  z-index: 2;
  align-self: center;
  flex: none;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 5px 5px 16px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  font-size: 13px;
  color: var(--text-muted);
}
.history-pill .btn-small { border-radius: var(--radius-pill); }
.search-tip-row { cursor: default; }
.search-tip-row:hover { background: none; }
.search-tips-head { margin-top: 10px; }

.upload-access { gap: 10px; margin-bottom: 14px; }
.upload-seg button { min-height: 48px; justify-content: center; }
.upload-roles { display: flex; flex-wrap: wrap; gap: 6px 18px; min-height: 28px; }
.upload-roles.off { opacity: 0.45; }
#attach-btn.locked { opacity: 0.4; cursor: not-allowed; }

.icon-card { gap: 14px; }
.icon-grid { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.icon-tile { width: 84px; height: 96px; padding: 10px 6px 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; background: var(--bg-darkest); border: 1px solid transparent; border-radius: 12px; color: var(--text-muted); font-family: inherit; cursor: pointer; }
.icon-tile:hover { color: var(--text-normal); }
.icon-tile.active { border-color: var(--accent); color: var(--header-primary); }
.icon-art { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 50%; overflow: hidden; }
.icon-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.icon-art img.icon-mark { width: 66%; height: 66%; object-fit: contain; }
.icon-label { font-size: 12px; font-weight: 600; text-align: center; line-height: 1.15; }
.icon-replace { align-self: center; }

.phone-back { display: none; }
body.mobile-app .desktop-only { display: none !important; }
body:not(.mobile-app) .mobile-only { display: none !important; }
body.mobile-app:not(.can-share-screen) .screen-share-only { display: none !important; }

@media (max-width: 1000px) and (min-width: 701px) {
  .app { --sidebar-w: 208px; grid-template-columns: var(--sidebar-w) minmax(0, 1fr) 232px; }
  .app.dm-mode { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .app.dm-mode .dm-profile { display: none; }
  .app.members-collapsed:not(.dm-mode):not(.thread-open) { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .app.thread-open { grid-template-columns: var(--sidebar-w) minmax(0, 1fr) minmax(280px, 38vw); }
}

@media (max-width: 700px) {
  .app {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: 56px minmax(0, 1fr);
    gap: 8px;
    height: 100dvh;
    padding: env(safe-area-inset-top) calc(8px + env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) calc(8px + env(safe-area-inset-left));
  }
  .app[data-pane="chat"], .app[data-pane="people"] {
    grid-template-rows: minmax(0, 1fr);
    padding-top: calc(8px + env(safe-area-inset-top));
  }
  .app > .sidebar, .app > .main, .app > .members, .app > .thread-panel, .app > .dm-profile { grid-column: 1; grid-row: -2; width: auto; }
  .app[data-pane="list"] > :is(.main, .members, .thread-panel, .dm-profile) { display: none !important; }
  .app[data-pane="chat"] > :is(.rail, .sidebar, .members, .dm-profile) { display: none !important; }
  .app[data-pane="chat"].thread-open > .main { display: none; }
  .app[data-pane="chat"].thread-open > .thread-panel { grid-row: 1; }
  .app[data-pane="people"] { grid-template-rows: auto minmax(0, 1fr); }
  .app[data-pane="people"] > :is(.rail, .sidebar, .thread-panel) { display: none !important; }
  .app[data-pane="people"] > .main { grid-row: 1; background: none; }
  .app[data-pane="people"] > .main > :not(.chat-header) { display: none !important; }
  .app[data-pane="people"] > :is(#member-list, .dm-profile) { grid-row: 2; }
  .app[data-pane="people"] > #member-list:not(.hidden) { display: block; }

  .rail { gap: 6px; padding: 0 2px; overflow: hidden; }
  .rail-context { display: none; }
  .rail-spacer { flex: 1 0 0; }
  .server-list { flex: 0 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 7px 8px 7px 0; margin: -7px -8px -7px 0; }
  .server-list::-webkit-scrollbar { display: none; }
  .count-badge { top: -5px; }
  .rail-btn, .server-icon { width: 42px; height: 42px; }
  .user-panel { padding: 0 4px; }
  .user-chip { flex: 0 0 auto; width: auto; padding: 0 2px; }
  .user-chip .user-meta { display: none; }

  .phone-back { display: flex; margin-left: -8px; flex-shrink: 0; }
  .chat-header { padding: 0 8px 0 12px; gap: 6px; }
  .chat-header #channel-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chat-header .topic, #search-box { display: none !important; }
  .header-actions { gap: 0; flex-shrink: 0; }
  .icon-btn { width: 40px; height: 40px; }
  .composer { margin: 0 8px 8px; }
  .composer input, .modal input[type="text"], .modal textarea, .settings-layer input[type="text"], .settings-layer textarea { font-size: 16px; }

  .members, .dm-profile { overflow-y: auto; }

  .modal-backdrop { padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom)); }
  .modal { width: 100% !important; max-width: 100% !important; max-height: 100%; overflow-y: auto; padding: 20px; }

  .settings-layer {
    flex-direction: column;
    gap: 8px;
    padding: calc(8px + env(safe-area-inset-top)) 8px calc(8px + env(safe-area-inset-bottom));
  }
  .settings-nav { flex: 0 0 auto; justify-content: flex-start; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-nav-inner { width: auto; flex-direction: row; align-items: center; padding: 6px; gap: 2px; }
  .settings-nav-group, .settings-nav-sep { display: none; }
  .settings-tab { white-space: nowrap; flex-shrink: 0; }
  .settings-content { flex: 1 1 auto; min-height: 0; flex-direction: column; }
  .settings-content-inner { padding: 4px 16px 60px; }
  .settings-close-wrap { order: -1; flex-direction: row; align-self: flex-end; padding: 10px 10px 0; position: static; }
}

.invite-custom-card { display: flex; flex-direction: column; gap: 10px; }
.invite-custom-row { display: flex; align-items: center; gap: 10px; }
.invite-custom-field {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 0 0 12px;
  background: var(--bg-darkest);
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: border-color var(--t-hover) ease;
  cursor: text;
}
.invite-custom-field:focus-within { border-color: var(--focus); }
.invite-custom-prefix { flex-shrink: 0; font-size: 14px; color: var(--text-faint); white-space: nowrap; }
.settings-layer .invite-custom-field input[type="text"] {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 12px 0 1px;
  background: none;
  border: none;
  font-size: 14px;
  color: var(--text-normal);
}
.settings-layer .invite-custom-field input[type="text"]:focus { border: none; }
.invite-custom-note { min-height: 36px; }
.invite-custom-note.error { color: var(--red); }
.invite-bg-preview {
  width: 240px;
  height: 135px;
  border-radius: 8px;
  background-color: var(--bg-darkest);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.invite-bg-preview span { display: none; font-size: 12px; color: var(--text-faint); }
.invite-bg-preview.empty span { display: block; }
.invite-list { display: flex; flex-direction: column; gap: 4px; }
.invite-row {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 12px;
  background: var(--bg-dark);
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: border-color .12s;
}
.invite-row:hover { border-color: var(--bg-active); }
.invite-row .avatar { flex-shrink: 0; }
.invite-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.invite-row-link, .invite-row-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.invite-row-link { font-size: 14px; color: var(--text-normal); font-weight: 600; }
.invite-row-meta { font-size: 12px; color: var(--text-faint); }
.invite-row-left { flex-shrink: 0; width: 150px; text-align: right; font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.invite-row-copy { flex-shrink: 0; width: 96px; }
.invite-row-revoke { flex-shrink: 0; width: 84px; }

.invite-link-hero { display: none; }
#modal-invite-link.has-hero { padding-top: 0; overflow: hidden; }
#modal-invite-link.has-hero .invite-link-hero {
  display: block;
  position: relative;
  height: 200px;
  margin: 0 -24px;
  background-color: var(--bg-darkest);
  background-size: cover;
  background-position: center;
}
#modal-invite-link.has-hero .invite-link-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 55%, var(--bg-raised));
}
#modal-invite-link.has-hero .sw-icon { margin-top: -44px; position: relative; box-shadow: 0 0 0 4px var(--bg-raised); }
.settings-page .invite-custom-row select.compact-select { flex: none; width: 170px; min-width: 0; }
.invite-custom-row .btn-primary { flex: none; width: 132px; }

.picker-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; background: var(--bg-darkest); border-radius: 8px; flex-shrink: 0; }
.picker-tabs button {
  height: 28px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-muted);
  font: 600 13px var(--font);
  cursor: pointer;
}
.picker-tabs button:hover { color: var(--text-normal); background: var(--bg-hover); }
.picker-tabs button.active { background: var(--bg-active); color: var(--header-primary); }
.emoji-picker .emoji-grid { flex: 1; min-height: 0; align-content: start; }
.emoji-picker .emoji-browser, .picker-plain { flex: 1; min-height: 0; }
.picker-plain { display: flex; flex-direction: column; gap: 8px; }
.emoji-picker .emoji-browser { margin: 0 -10px -10px; }
.emoji-picker .eb-head { padding-top: 0; }
.emoji-grid[data-kind="stickers"] { grid-template-columns: repeat(3, 1fr); gap: 6px; }
.emoji-grid[data-kind="emoticons"] { grid-template-columns: repeat(2, 1fr); gap: 4px; }
.emoji-section-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emoji-section-add {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 20px;
  padding: 0 7px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--bg-active);
  color: var(--text-muted);
  font: 700 10px var(--font);
  text-transform: uppercase;
  letter-spacing: .04em;
  cursor: pointer;
  flex-shrink: 0;
}
.emoji-section-add:hover { background: var(--accent); color: var(--accent-ink); }
.emoji-grid .emoji-section-add { font-size: 10px; padding: 0 7px; line-height: 1; }
.picker-empty { grid-column: 1 / -1; padding: 10px 6px; font-size: 13px; color: var(--text-faint); line-height: 1.4; }
.emoji-grid button.sticker-tile { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; padding: 6px; background: var(--bg-darkest); }
.emoji-grid button.sticker-tile:hover { background: var(--bg-active); }
.sticker-tile .sticker-img { width: 100%; height: 100%; max-width: 88px; max-height: 88px; object-fit: contain; }
.emoji-grid button.emoticon-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  height: 46px;
  padding: 5px 8px;
  text-align: left;
  background: var(--bg-darkest);
}
.emoji-grid button.emoticon-tile:hover { background: var(--bg-active); }
.emoticon-text { font-size: 14px; color: var(--text-normal); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.emoticon-name { font-size: 11px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.suggest-face { color: var(--text-normal); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.sticker-img { display: block; object-fit: contain; }
.sticker-img:not([src]) { background: var(--bg-active); border-radius: var(--radius); }
.sticker-img.missing { opacity: .4; }
.msg-content.sticker-msg { padding: 4px 0; }
.msg-content.sticker-msg .sticker-img { width: 160px; height: 160px; }
.expr-preview.sticker-preview { width: 56px; height: 56px; }
.expr-face { width: 160px; flex: none; font-size: 15px; color: var(--header-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.modal-sound { width: 480px; }
.modal p.sound-hint { min-height: 2.8em; line-height: 1.4; }
.sound-trim {
  position: relative;
  height: 76px;
  border-radius: var(--radius);
  background: var(--bg-darkest);
  touch-action: none;
  user-select: none;
  cursor: pointer;
}
.sound-wave { position: absolute; inset: 8px 0; display: flex; align-items: center; gap: 1px; pointer-events: none; }
.sound-wave span { flex: 1; min-width: 1px; min-height: 2px; border-radius: 1px; background: var(--text-muted); opacity: .45; }
.sound-wave span.on { background: var(--accent); opacity: 1; }
.sound-shade { position: absolute; top: 0; bottom: 0; background: rgba(0,0,0,.35); pointer-events: none; }
.sound-shade-start { left: 0; border-radius: var(--radius) 0 0 var(--radius); }
.sound-shade-end { right: 0; border-radius: 0 var(--radius) var(--radius) 0; }
.sound-window { position: absolute; top: 0; bottom: 0; border-top: 2px solid var(--accent); border-bottom: 2px solid var(--accent); box-sizing: border-box; cursor: grab; }
.sound-window:active { cursor: grabbing; }
.sound-playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--header-primary); pointer-events: none; }
.sound-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 24px;
  margin-left: -12px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: ew-resize;
}
.sound-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: 10px; width: 4px; border-radius: 2px; background: var(--accent); }
.sound-handle::after { content: ""; position: absolute; top: 50%; left: 6px; width: 12px; height: 24px; margin-top: -12px; border-radius: 6px; background: var(--accent); }
.sound-handle:focus-visible { outline: none; }
.sound-handle:focus-visible::after { box-shadow: 0 0 0 2px var(--header-primary); }
.sound-trim-bar { display: flex; align-items: center; gap: 10px; }
.sound-trim-play { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.sound-trim-play:hover { background: var(--accent-hover); color: var(--accent-ink); }
.sound-trim-times { font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sound-identity { display: flex; align-items: flex-end; gap: 10px; }
.sound-identity .field-label { flex: 1; min-width: 0; }
.sound-pick-emoji { width: 42px; height: 42px; border-radius: 10px; background: var(--input-bg); }

.emoticon-ideas { display: flex; flex-wrap: wrap; gap: 6px; }
.emoticon-idea {
  height: 30px;
  padding: 0 10px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--bg-darkest);
  color: var(--text-normal);
  font: 14px var(--font);
  cursor: pointer;
}
.emoticon-idea:hover { background: var(--bg-active); }

.modal.modal-catalog { width: min(620px, calc(100vw - 32px)); height: min(600px, calc(100vh - 48px)); gap: 10px; }
.catalog-head { display: flex; align-items: center; justify-content: space-between; }
.catalog-chips { display: flex; gap: 6px; overflow-x: auto; flex-shrink: 0; height: 32px; scrollbar-width: none; }
.catalog-chips::-webkit-scrollbar { display: none; }
.catalog-chip {
  flex-shrink: 0;
  height: 30px;
  padding: 0 12px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--bg-darkest);
  color: var(--text-muted);
  font: 600 13px var(--font);
  cursor: pointer;
}
.catalog-chip:hover { color: var(--text-normal); background: var(--bg-hover); }
.catalog-chip.active { background: var(--accent); color: var(--accent-ink); }
.catalog-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  grid-auto-rows: 72px;
  gap: 6px;
  align-content: start;
  padding: 2px;
}
.catalog-tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--bg-darkest);
  cursor: pointer;
}
.catalog-tile:hover { background: var(--bg-active); }
.catalog-tile.picked { background: var(--bg-active); box-shadow: inset 0 0 0 2px var(--accent); }
.catalog-tile img { width: 100%; height: 100%; object-fit: contain; }
.catalog-tile.missing img { opacity: .2; }
.catalog-gif {
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(11, 13, 23, .85);
  color: var(--text-muted);
  font: 700 9px/14px var(--font);
}
.catalog-note { grid-column: 1 / -1; align-self: center; padding: 24px 8px; text-align: center; font-size: 14px; color: var(--text-muted); line-height: 1.45; }
.catalog-more { grid-column: 1 / -1; justify-self: center; align-self: center; }
.catalog-pick { display: flex; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); flex-shrink: 0; }
.catalog-pick-preview {
  width: 48px;
  height: 48px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-darkest);
}
.catalog-pick-preview img { width: 40px; height: 40px; object-fit: contain; }
.catalog-pick-preview.sticker img { width: 44px; height: 44px; }
.catalog-pick-preview svg { color: var(--text-faint); }
.modal .catalog-pick input[type="text"] { flex: 1; min-width: 0; }
.catalog-attrib { font-size: 12px; color: var(--text-faint); flex-shrink: 0; }
.catalog-attrib strong { color: var(--text-muted); font-weight: 600; }

:is(.emoji-grid, .eb-cells) button.catalog-slot { height: 36px; padding: 4px; display: flex; align-items: center; justify-content: center; }
:is(.emoji-grid, .eb-cells) button.catalog-slot:disabled { cursor: default; background: none; }
:is(.emoji-grid, .eb-cells) button.catalog-slot img { width: 28px; height: 28px; object-fit: contain; display: block; }
:is(.emoji-grid, .eb-cells) button.catalog-slot.missing img { visibility: hidden; }
:is(.emoji-grid, .eb-cells) button.catalog-slot.busy { opacity: 0.45; cursor: progress; }
:is(.emoji-grid, .eb-cells) .catalog-none { height: 72px; padding-top: 0; padding-bottom: 0; display: flex; align-items: center; }

.call-modal { width: 320px; text-align: center; align-items: center; display: flex; flex-direction: column; gap: 6px; }
.call-avatar { margin: 6px auto 10px; }
.call-avatar .avatar-xl { width: 96px; height: 96px; font-size: 36px; }
.call-modal h2 { margin: 0; }
.call-sub { color: var(--text-muted); margin: 0 0 12px; }
.call-actions { display: flex; gap: 28px; justify-content: center; padding-bottom: 4px; }
.call-btn { width: 56px; height: 56px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; color: #fff; transition: filter var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.call-btn.accept { background: #2f9e5f; }
.call-btn.decline { background: var(--red); }
.call-btn:hover { filter: brightness(1.1); }
.call-btn:active { transform: scale(.95); }
#dm-call-btn.active { color: var(--red); }
.group-avatar { display: grid; place-items: center; background: var(--bg-active); color: var(--text-muted); }
.group-avatar svg { width: 18px; height: 18px; }
.dm-thread.active .group-avatar, .dm-thread:hover .group-avatar { color: var(--text-normal); }
.person-row .pick { width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--text-muted); display: grid; place-items: center; color: transparent; flex-shrink: 0; margin-left: auto; }
.person-row .pick svg { width: 14px; height: 14px; }
.person-row.picked .pick { background: var(--accent); border-color: var(--accent); color: #fff; }
.person-row.in-group { opacity: .5; cursor: default; }
.person-row.in-group:hover { background: none; }
.person-row.new-group { color: var(--text-normal); }
.person-row.new-group .group-avatar { width: 32px; height: 32px; }
.emoji-grid button.catalog-sticker:disabled { cursor: default; background: none; }
.emoji-grid button.catalog-sticker img { width: 100%; height: 100%; object-fit: contain; display: block; }
.emoji-grid button.catalog-sticker.missing img { visibility: hidden; }
.emoji-grid button.catalog-sticker.busy { opacity: 0.45; cursor: progress; }
:is(.emoji-grid, .eb-cells) .catalog-none.stickers { height: 120px; }

.play-box { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ac-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); }
.play-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--bg-raised), var(--bg-mid));
}
.ac-glow {
  position: absolute;
  inset: -40px;
  z-index: -1;
  background-size: cover;
  background-position: center;
  background-position: left center;
  filter: blur(36px) saturate(1.3);
  opacity: .32;
  -webkit-mask-image: linear-gradient(90deg, #000 20%, transparent 80%);
  mask-image: linear-gradient(90deg, #000 20%, transparent 80%);
}
.ac-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ac-cover, .acc-cover {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-darkest);
  color: var(--text-faint);
}
.ac-cover { width: 64px; height: 86px; border-radius: var(--radius-sm); box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
.ac-cover img, .acc-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ac-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ac-game {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--header-primary);
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}
.ac-time { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--green); font-variant-numeric: tabular-nums; }
.ac-steam {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  width: 100%;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--header-primary);
  color: var(--bg-darkest);
  font: 600 14px var(--font);
  cursor: pointer;
  transition: background-color var(--t-hover) var(--ease-out);
}
.ac-steam:hover { background: #ffffff; }

.game-link { cursor: pointer; }
.game-pop {
  position: fixed;
  z-index: 190;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 264px;
  max-width: calc(100vw - 16px);
  padding: 12px;
  border-radius: var(--radius);
  background: var(--bg-raised);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
.gp-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.gp-cover { flex: none; display: flex; align-items: center; justify-content: center; overflow: hidden; width: 60px; height: 80px; border-radius: var(--radius-sm); background: var(--bg-darkest); color: var(--text-faint); }
.gp-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gp-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gp-name { color: var(--header-primary); font: 700 16px/1.25 var(--font-display); overflow-wrap: anywhere; }
.gp-year, .gp-note { color: var(--text-muted); font-size: 13px; }

.playing-now { display: flex; flex-direction: column; gap: 6px; padding: 2px 2px 8px; }
.now-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 76px;
  overflow: hidden;
  padding: 8px 8px 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-mid);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--t-hover) var(--ease-out);
}
.now-card:hover { background: var(--bg-hover); }
.acc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.acc-who { display: flex; align-items: center; gap: 6px; height: 16px; font-size: 12px; line-height: 16px; color: var(--text-muted); min-width: 0; }
.acc-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-avatar.avatar { width: 16px; height: 16px; font-size: 8px; flex: none; }
.now-card .ac-game { font-size: 14px; line-height: 18px; height: 18px; -webkit-line-clamp: 1; display: block; white-space: nowrap; text-overflow: ellipsis; }
.now-card .ac-time { font-size: 12px; height: 16px; line-height: 16px; }
.acc-cover { width: 42px; height: 56px; border-radius: 6px; }

.channel-age {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 16px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1;
  color: var(--text-faint);
}
.channel:hover .channel-age, .channel.active .channel-age { color: var(--text-muted); }
.channel .channel-lock + .channel-age { margin-left: 2px; }
.channel .channel-age + .channel-bell { margin-left: auto; }
.channel-pin, .dm-pin {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: inline-flex;
  color: var(--text-faint);
}
.channel-pin svg, .dm-pin svg { width: 14px; height: 14px; }
.channel .channel-pin + .channel-bell { margin-left: auto; }
.channel .channel-lock + .channel-pin, .channel .channel-age + .channel-pin { margin-left: 2px; }
.channel:hover .channel-pin, .channel.active .channel-pin, .dm-thread:hover .dm-pin, .dm-thread.active .dm-pin { color: var(--text-muted); }
.dm-top .dm-pin { align-self: center; }

.age-gate-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.age-gate {
  width: 100%;
  max-width: 420px;
  padding: 32px 28px 28px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--bg-raised);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.age-gate-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 14px;
}
.age-gate-channel {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.age-gate h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--header-primary);
  margin-bottom: 8px;
}
.age-gate p {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-normal);
  margin-bottom: 22px;
}
.age-gate-actions { display: flex; gap: 10px; }
.age-gate-btn {
  width: 140px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.age-gate-btn.btn-primary { background: var(--accent); color: var(--accent-ink); }
.age-gate-btn.btn-primary:hover { background: var(--accent-hover); }
.ob-preview-badge { margin-left: auto; align-self: flex-start; flex: none; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 3px 8px; }
.ob-questions { display: flex; flex-direction: column; gap: 18px; max-height: 55vh; overflow-y: auto; padding: 2px 2px 2px 0; }
.ob-question { display: flex; flex-direction: column; gap: 10px; }
.ob-question-title { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--header-primary); letter-spacing: -.01em; }
.ob-question-sub { font-size: 13px; color: var(--text-muted); line-height: 1.4; margin-top: -6px; }
.ob-answers { display: flex; flex-direction: column; gap: 6px; }
.ob-answer {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 16px 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: var(--bg-dark);
  color: var(--text-normal);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.ob-answer:hover { background: var(--bg-active); }
.ob-answer.picked { border-color: var(--accent); }
.ob-check { flex: none; display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; border-radius: 50%; border: 2px solid var(--text-faint); color: transparent; }
.ob-answer.multiple .ob-check { border-radius: 6px; }
.ob-answer.picked .ob-check { background: var(--accent); border-color: var(--accent); color: #fff; }
.ob-answer-label { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-answer-roles { display: flex; align-items: center; gap: 2px; flex: none; }
.ob-answer-roles .role-dot { width: 8px; height: 8px; margin: 0; }
.ob-actions #ob-later { margin-right: auto; }
.ob-editor { display: flex; flex-direction: column; }
.ob-card-head { display: flex; align-items: center; gap: 12px; }
.ob-card-head .setting-title { flex: 1; min-width: 0; }
.ob-field { display: flex; flex-direction: column; gap: 6px; }
.ob-field input[type="text"] { width: 100%; }
.ob-type-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ob-answer-rows { display: flex; flex-direction: column; gap: 10px; }
.ob-answer-row { display: grid; grid-template-columns: minmax(0, 1fr) 28px; gap: 6px 8px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--bg-mid); }
.ob-answer-row input[type="text"] { min-width: 0; }
.ob-role-chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 32px; }
.ob-role-chip { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 6px 0 8px; border-radius: var(--radius-pill); background: var(--bg-raised); font-size: 12px; font-weight: 600; color: var(--text-normal); }
.ob-role-chip .role-dot { width: 8px; height: 8px; margin-right: 2px; }
.ob-role-chip .game-chip-x { width: 16px; height: 16px; align-items: center; justify-content: center; }
.ob-role-chips select.compact-select { min-width: 0; width: 150px; padding: 4px 8px; font-size: 13px; }
.ob-icon-btn { flex: none; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: none; background: transparent; color: var(--text-muted); cursor: pointer; }
.ob-icon-btn:hover { background: var(--bg-active); color: var(--header-primary); }
.ob-add-answer { align-self: flex-start; }
.voice-msg {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 300px;
  max-width: 100%;
  height: 40px;
  padding: 0 14px 0 6px;
  margin-top: 6px;
  box-sizing: border-box;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
}
.voice-play {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--t-hover) ease;
}
.voice-play:hover { background: var(--accent-hover); }
.voice-play:disabled { background: var(--bg-active); cursor: progress; }
.voice-play svg { display: block; }
.voice-wave {
  flex: 1;
  min-width: 0;
  height: 22px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.voice-wave i {
  flex: 1;
  min-height: 3px;
  border-radius: 1px;
  background: var(--text-faint);
}
.voice-wave i.played { background: var(--header-primary); }
.voice-time {
  flex-shrink: 0;
  min-width: 70px;
  text-align: right;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  white-space: nowrap;
}
.voice-time .voice-elapsed { color: var(--header-primary); }
.voice-time .voice-sep { margin: 0 3px; }

.voice-rec {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: var(--bg-raised);
  border-radius: 14px;
}
.voice-rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  animation: voice-rec-pulse 1.2s ease-in-out infinite;
}
@keyframes voice-rec-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.voice-rec-label { font-family: var(--font-display); font-weight: 600; color: var(--header-primary); }
.voice-rec-time { min-width: 40px; font-variant-numeric: tabular-nums; color: var(--header-primary); }
.voice-rec-hint { flex: 1; font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice-rec .btn-small { min-width: 68px; }
.voice-rec .btn-small:disabled { opacity: .5; cursor: progress; }

.switcher-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  z-index: 170;
}
.switcher {
  width: 560px;
  max-width: calc(100% - 32px);
  background: var(--panel);
  border: 1px solid var(--bg-raised);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.switcher-field {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 16px;
  border-bottom: 1px solid var(--bg-raised);
}
.switcher-icon { display: flex; color: var(--text-muted); flex-shrink: 0; }
.switcher-field input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--header-primary);
  font-family: var(--font);
  font-size: 16px;
}
.switcher-field input::placeholder { color: var(--text-faint); }
.switcher-chip, .shortcut-key {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-darkest);
  border: 1px solid var(--bg-raised);
  border-radius: 6px;
  padding: 3px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.switcher-list {
  height: 352px;
  overflow-y: auto;
}
.switcher-row {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 16px 0 13px;
  border-left: 3px solid transparent;
  cursor: pointer;
  color: var(--text-normal);
}
.switcher-row.active { background: var(--bg-raised); border-left-color: var(--accent); }
.switcher-row.active .switcher-sub { color: var(--text-normal); }
.switcher-glyph {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-raised);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
}
.switcher-row.active .switcher-glyph { background: var(--bg-active); color: var(--header-primary); }
.switcher-server-icon { border-radius: 50%; background: var(--tint, var(--bg-active)); color: #fff; font-size: 11px; }
.switcher-server-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.switcher-avatar { width: 28px; height: 28px; font-size: 12px; }
.switcher-text {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
  overflow: hidden;
}
.switcher-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--header-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  max-width: 60%;
}
.switcher-sub { font-size: 13px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.switcher-empty { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--text-faint); font-size: 14px; }
.switcher-foot {
  display: flex;
  gap: 16px;
  align-items: center;
  height: 32px;
  padding: 0 16px;
  border-top: 1px solid var(--bg-raised);
  font-size: 12px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
}
.switcher-foot b { font-weight: 600; color: var(--text-muted); }
.switcher-foot-tip { margin-left: auto; overflow: hidden; text-overflow: ellipsis; }
.shortcut-card { display: flex; flex-direction: column; gap: 14px; }
.shortcut-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.rail-discover.active { background: var(--accent); color: var(--accent-ink); }

.discover {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  background: var(--bg-mid);
  border-radius: inherit;
  min-height: 0;
}
.discover-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 12px;
}
.discover-title h2 {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: -.01em;
  color: var(--header-primary);
}
.discover-title p { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.discover-search {
  flex: 0 0 280px;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: var(--input-bg);
  border: 1px solid transparent;
  color: var(--text-muted);
}
.discover-search:focus-within { border-color: var(--focus); }
.discover-search-icon { display: flex; flex-shrink: 0; }
.discover-search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--header-primary);
  font-family: var(--font);
  font-size: 14px;
}
.discover-search input::placeholder { color: var(--text-faint); }
.discover-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 4px 24px 12px;
  height: 48px;
  overflow-x: auto;
  scrollbar-width: none;
  box-shadow: 0 1px 0 var(--line);
}
.discover-chips::-webkit-scrollbar { display: none; }
.discover-chip {
  flex-shrink: 0;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: var(--bg-raised);
  color: var(--text-normal);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-hover) ease, color var(--t-hover) ease;
}
.discover-chip:hover { background: var(--bg-active); color: var(--header-primary); }
.discover-chip[aria-pressed="true"], .discover-chip[aria-pressed="true"]:hover { background: var(--accent); color: var(--accent-ink); }
.discover-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 24px 24px; display: flex; flex-direction: column; }
.discover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}
.discover-card {
  height: 188px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg-raised);
  border: 1px solid transparent;
  transition: border-color var(--t-hover) ease;
}
.discover-card:hover { border-color: var(--bg-active); }
.discover-card-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -.01em;
  color: var(--header-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.discover-card-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 6px; align-items: center; height: 18px; }
.discover-card-meta .discover-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-faint); }
.discover-card-text {
  color: var(--text-normal);
  font-size: 14px;
  line-height: 1.4;
  height: calc(3 * 1.4em);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  user-select: text;
}
.discover-card-foot { margin-top: auto; display: flex; justify-content: flex-end; }
.discover-card-foot .btn-primary { min-width: 72px; }
.discover-empty { padding: 48px 0; }
.discover-empty-art { color: var(--text-faint); margin-bottom: 12px; display: flex; justify-content: center; }
.discover-retry { margin-top: 16px; padding: 9px 22px; font-size: 14px; }
.discover-foot { display: flex; justify-content: center; padding-top: 16px; height: 56px; }
.discover-more { padding: 9px 22px; font-size: 14px; }

.discovery-card.readonly textarea, .discovery-card.readonly select { opacity: .6; cursor: not-allowed; }
.discovery-card .field-label { display: flex; flex-direction: column; gap: 6px; }
.discovery-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.discovery-category { flex: 0 0 220px; }
.discovery-category select { text-transform: none; letter-spacing: 0; font-weight: 400; }
.discovery-actions { display: flex; align-items: center; gap: 12px; min-height: 34px; }
.saved-view {
  position: absolute;
  top: 48px;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-darkest);
  border-top: 1px solid var(--line);
  z-index: 110;
}
.saved-head {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.saved-head > svg { width: 20px; height: 20px; color: var(--text-muted); flex-shrink: 0; }
.saved-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--header-primary); }
.saved-sub { flex: 1; font-size: 12px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saved-list { flex: 1; overflow-y: auto; padding: 4px 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.saved-section {
  display: flex;
  align-items: baseline;
  gap: 8px;
  height: 36px;
  padding: 12px 8px 0;
  box-sizing: border-box;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.saved-section span:last-child { font-weight: 500; letter-spacing: 0; text-transform: none; }
.saved-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
  padding: 0 44px 0 12px;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  transition: background var(--t-hover, .12s) ease;
}
.saved-row:hover, .saved-row:focus-visible { background: var(--bg-hover); outline: none; }
.saved-row .avatar { width: 32px; height: 32px; flex-shrink: 0; }
.saved-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.saved-line { display: flex; align-items: center; gap: 8px; min-width: 0; height: 20px; }
.saved-author { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--header-primary); white-space: nowrap; flex-shrink: 0; }
.saved-origin { flex: 1; min-width: 0; font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saved-time { font-size: 12px; color: var(--text-faint); white-space: nowrap; flex-shrink: 0; }
.saved-text { font-size: 14px; line-height: 20px; color: var(--text-normal); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saved-text.muted { color: var(--text-muted); font-style: italic; }
.saved-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-raised);
  color: var(--text-normal);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.saved-chip svg { width: 14px; height: 14px; color: var(--text-muted); }
.saved-chip.due { background: var(--accent); color: var(--accent-ink, #fff); }
.saved-chip.due svg { color: inherit; }
.saved-remove {
  position: absolute;
  top: 20px;
  right: 10px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-faint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: .6;
  transition: opacity var(--t-hover, .12s) ease, background var(--t-hover, .12s) ease, color var(--t-hover, .12s) ease;
}
.saved-row:hover .saved-remove, .saved-row:focus-within .saved-remove { opacity: 1; }
.saved-remove:hover { background: var(--accent); color: var(--accent-ink, #fff); }
.saved-remove svg { width: 16px; height: 16px; }
.saved-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 36px 16px;
  text-align: center;
  color: var(--text-muted);
}
.saved-empty-mark {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-raised);
  color: var(--text-muted);
  margin-bottom: 6px;
}
.saved-empty strong { font-family: var(--font-display); font-size: 15px; color: var(--header-primary); }
.saved-empty span { font-size: 13px; line-height: 1.4; max-width: 300px; }
#saved-btn { position: relative; }
.saved-entry { height: 44px; box-sizing: border-box; }
.saved-entry-mark { display: inline-flex; align-items: center; justify-content: center; background: var(--bg-raised); color: var(--text-muted); }
.saved-entry-mark svg { width: 18px; height: 18px; }
.saved-entry:hover .saved-entry-mark, .saved-entry.active .saved-entry-mark { color: var(--header-primary); }
.remind-pop { min-width: 280px; }
.remind-pick { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px; box-sizing: border-box; }
.remind-pick-label { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.remind-pick input {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 0 6px;
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text-normal);
  font: inherit;
  font-size: 13px;
  color-scheme: dark;
}
.remind-pick input:focus { outline: none; border-color: var(--line-strong); }
.forum { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.forum-toolbar {
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 calc(16px + var(--chat-gutter));
  box-shadow: 0 1px 0 var(--line);
}
.forum-tags { flex: 1; min-width: 0; height: 28px; display: flex; align-items: center; gap: 6px; overflow: hidden; }
.forum-chip {
  height: 28px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid var(--bg-active);
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--t-hover) ease, color var(--t-hover) ease, border-color var(--t-hover) ease;
}
.forum-chip:hover { background: var(--bg-hover); color: var(--text-normal); }
.forum-chip.picked { border-color: var(--accent); background: rgba(255, 77, 77, .12); color: var(--header-primary); }
.forum-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.forum-modes { display: inline-flex; background: var(--bg-dark); border-radius: var(--radius-sm); padding: 2px; }
.forum-mode {
  width: 30px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.forum-mode:hover { color: var(--text-normal); }
.forum-mode.active { background: var(--bg-active); color: var(--header-primary); }
.forum-mode svg { width: 18px; height: 18px; }
.forum-new { padding: 7px 14px; }
.forum-posts { flex: 1; min-height: 0; overflow-y: auto; padding: 12px calc(16px + var(--chat-gutter)) 16px; }
.forum-posts.list { display: flex; flex-direction: column; gap: 4px; }
.forum-posts.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-content: start; }
@media (max-width: 1180px) { .forum-posts.gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.forum-post {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 0 8px 0 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
}
.forum-post:hover { background: var(--bg-hover); }
.forum-post.open, .forum-card.open { border-color: var(--bg-active); }
.forum-post-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.forum-post-head { display: flex; align-items: center; gap: 8px; min-width: 0; height: 20px; }
.forum-post-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--header-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.forum-pills { display: inline-flex; gap: 4px; flex-shrink: 0; overflow: hidden; }
.forum-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 11px;
  background: var(--bg-raised);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.forum-meta { display: flex; align-items: center; gap: 6px; height: 18px; font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; }
.forum-meta-author { color: var(--text-normal); font-weight: 500; }
.forum-meta-dot { color: var(--text-faint); }
.forum-edit, .forum-edit-slot { width: 32px; height: 32px; flex-shrink: 0; display: inline-block; }
.forum-edit { opacity: 0; }
.forum-post:hover .forum-edit, .forum-card:hover .forum-edit, .forum-edit:focus-visible { opacity: 1; }
.forum-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 184px;
  padding: 14px 14px 12px;
  border-radius: var(--radius);
  background: var(--bg-raised);
  border: 1px solid transparent;
  cursor: pointer;
  min-width: 0;
  transition: border-color var(--t-hover) ease;
}
.forum-card:hover { border-color: var(--bg-active); }
.forum-card-top { display: flex; align-items: flex-start; gap: 8px; height: 40px; }
.forum-card-top .forum-post-title {
  flex: 1;
  min-width: 0;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}
.forum-card .forum-edit, .forum-card .forum-edit-slot { width: 28px; height: 28px; margin: -6px -6px 0 0; }
.forum-card-excerpt {
  flex: 1;
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.forum-card-foot { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.forum-card-foot .forum-pills { height: 22px; }
.forum-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 48px 16px;
  color: var(--text-muted);
}
.forum-empty h2 { font-family: var(--font-display); color: var(--header-primary); font-size: 20px; margin: 8px 0 0; }
.forum-empty p { margin: 0; font-size: 14px; max-width: 360px; }
.modal-forum-post { width: 520px; }
.modal-forum-post textarea { resize: vertical; min-height: 120px; }
.forum-tags-label { flex-direction: row; align-items: baseline; gap: 6px; }
.forum-post-tags-left { font-weight: 400; color: var(--text-faint); }
.forum-pick-tags { margin-top: 0; min-height: 30px; }
.forum-no-tags { font-size: 13px; color: var(--text-faint); line-height: 30px; }
.forum-tag-rows { display: flex; flex-direction: column; gap: 4px; }
.forum-tag-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 4px 0 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-mid);
}
.forum-tag-row-emoji { width: 24px; text-align: center; font-size: 16px; flex-shrink: 0; }
.forum-tag-row-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.forum-tag-empty { font-size: 13px; color: var(--text-faint); }
.forum-tag-add { display: flex; align-items: center; gap: 8px; }
.forum-tag-add input[type="text"] { flex: 1; min-width: 0; }
.forum-tag-emoji {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--bg-active);
  background: var(--input-bg);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  padding: 0;
}
.forum-tag-emoji:hover { color: var(--text-normal); }
.channel-icon.forum-icon svg { width: 18px; height: 18px; }

.voice-invite {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 460px;
  height: 92px;
  box-sizing: border-box;
  margin-top: 6px;
  padding: 12px 14px;
  background: #151929;
  border: 1px solid #1f2438;
  border-radius: 12px;
}
.msg-content > .voice-invite:first-child { margin-top: 2px; }
.voice-invite-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.voice-invite-kicker { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; line-height: 1; color: var(--text-faint); }
.voice-invite-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--header-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.voice-invite-row { display: flex; align-items: center; gap: 8px; height: 24px; }
.voice-invite-faces { display: flex; align-items: center; flex: none; width: 114px; height: 24px; }
.voice-invite-faces .avatar { flex: none; width: 24px; height: 24px; font-size: 10px; margin-right: -6px; box-shadow: 0 0 0 2px #151929; }
.voice-invite-more {
  flex: none;
  min-width: 30px;
  height: 20px;
  padding: 0 6px;
  box-sizing: border-box;
  border-radius: 10px;
  background: var(--bg-active);
  color: var(--header-primary);
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.voice-invite-more.empty { visibility: hidden; }
.voice-invite-status { min-width: 0; font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice-invite-join {
  flex: none;
  width: 76px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.voice-invite-join:hover { background: var(--accent-hover); }
.voice-invite-join:disabled { background: var(--bg-active); color: var(--text-muted); cursor: default; }
.voice-invite-join:disabled:hover { background: var(--bg-active); }
.voice-invite-where { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--header-primary); margin: -6px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vp-grid:hover { color: var(--accent); }

.stage-group {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 18px;
  margin: 2px 8px 0 36px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-faint);
  user-select: none;
}
.stage-group-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-group-count { font-variant-numeric: tabular-nums; font-weight: 600; }
.voice-user .hand-slot { width: 14px; height: 14px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--yellow); }
.voice-user.audience { color: var(--text-faint); }
.voice-user.audience .vs-icon { color: var(--text-faint); }
.voice-user.audience:hover { color: var(--text-normal); }
.voice-user.hand .voice-user-name { color: var(--text-normal); }
.ctx-hand { gap: 8px; }
.ctx-hand svg { color: var(--yellow); flex-shrink: 0; }

.vp-stage {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 8px;
  background: var(--bg-dark);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--header-primary);
}
.vp-stage-icon { display: inline-flex; color: var(--yellow); flex-shrink: 0; width: 14px; }
.vp-stage-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-hand { min-width: 72px; text-align: center; padding: 4px 8px; }
.vp-hand.on { background: var(--yellow); color: var(--bg-darkest); }
.vp-hand.on:hover { background: var(--header-primary); color: var(--bg-darkest); }
.vp-hand.spent { visibility: hidden; }
.vp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#vp-activities { grid-column: 1 / -1; }
.vp-activities.vp-share.active { background: var(--red); color: #fff; }
.vp-activities.vp-share.active:hover { background: var(--red); }
.ap-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text-normal); cursor: pointer; }
.vp-activities {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  min-width: 0;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--bg-hover);
  color: var(--header-primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
.vp-activities > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.vp-activities > svg { flex: 0 0 auto; }
.vp-actions .vp-activities { padding: 0 4px; gap: 5px; }
.voice-panel { container: voice-panel / inline-size; }
@container voice-panel (max-width: 213px) {
  .vp-actions .vp-activities:not(#vp-activities) > span { display: none; }
  #vp-status-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.video-pop .segmented button { padding: 5px 6px; }
.vp-activities:hover { background: var(--bg-active); }
.vp-activities.running { background: var(--accent); color: var(--accent-ink); }
.vp-activities.running:hover { background: var(--accent-hover); }

.voice-activity-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 18px;
  padding: 0 7px 0 5px;
  border-radius: var(--radius-pill);
  background: var(--bg-raised);
  color: var(--header-primary);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.voice-activity-pill svg { width: 12px; height: 12px; color: var(--accent); }

.activity-panel {
  position: absolute;
  top: 48px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  padding: 12px;
  display: flex;
  flex-direction: column;
  background: var(--bg-mid);
}
.activity-head {
  flex: 0 0 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--bg-darkest);
}
.activity-icon { display: inline-flex; color: var(--accent); flex-shrink: 0; }
.activity-heading { display: flex; flex-direction: column; min-width: 0; flex: 0 1 auto; }
.activity-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--header-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.activity-sub { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-people { flex: 1; min-width: 0; display: flex; align-items: center; padding-left: 6px; height: 28px; }
.activity-people .avatar { margin-left: -5px; border: 2px solid var(--bg-darkest); width: 24px; height: 24px; font-size: 9px; flex-shrink: 0; }
.activity-people .avatar.player { box-shadow: 0 0 0 2px var(--accent); }
.activity-people .avatar.player.mark-x { box-shadow: 0 0 0 2px var(--header-primary); }
.activity-people .avatar.player.mark-o { box-shadow: 0 0 0 2px var(--accent); }
.activity-people-more {
  margin-left: 4px;
  height: 24px;
  min-width: 24px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-raised);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.activity-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.activity-actions .vp-pill { min-width: 64px; height: 28px; }
.activity-actions .vp-pill.ghost { visibility: hidden; }
.activity-actions .icon-btn { width: 28px; height: 28px; }
.activity-body {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--bg-darkest);
  overflow: hidden;
}

.activity-game { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 16px; }
.activity-turn { height: 24px; font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--header-primary); display: flex; align-items: center; }
.ttt-board { display: grid; grid-template-columns: repeat(3, 96px); grid-template-rows: repeat(3, 96px); gap: 6px; }
.ttt-cell {
  width: 96px;
  height: 96px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-mid);
  color: var(--header-primary);
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  transition: background var(--t-hover) ease;
}
.ttt-cell.open { cursor: pointer; }
.ttt-cell.open:hover { background: var(--bg-hover); }
.ttt-cell.o { color: var(--accent); }
.ttt-cell.win { border-color: var(--header-primary); box-shadow: inset 0 0 0 1px var(--header-primary); }
.activity-slot { height: 36px; display: flex; align-items: center; justify-content: center; }
.activity-hint { font-size: 13px; color: var(--text-muted); }

.activity-watch { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 12px; gap: 8px; }
.activity-screen { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: #000; border-radius: var(--radius-sm); overflow: hidden; }
.activity-screen video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.activity-screen-wait { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--text-muted); font-size: 13px; background: rgba(11, 13, 23, .7); }
.activity-youtube { position: absolute; inset: 0; background: #000; }
.activity-youtube iframe { width: 100%; height: 100%; border: 0; display: block; }
.activity-screen-note { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; color: var(--text-muted); font-size: 13px; line-height: 20px; background: rgba(11, 13, 23, .85); }
.activity-screen-note > span { max-width: 460px; }
.activity-watch-line { height: 32px; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-muted); }
.activity-watch-open { flex-shrink: 0; font-size: 12px; }
.activity-watch-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-normal); font-weight: 500; }
.activity-sync { flex-shrink: 0; width: 160px; text-align: right; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-sync.good { color: var(--green); }
.activity-sync.catching { color: var(--yellow); }

.modal-activities { width: 480px; }
.activity-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.activity-card {
  height: 128px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-dark);
  color: var(--text-normal);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--t-hover) ease, background var(--t-hover) ease;
}
.activity-card:hover { background: var(--bg-hover); }
.activity-card[aria-checked="true"] { border-color: var(--accent); }
.activity-card-icon { display: inline-flex; color: var(--accent); }
.activity-card-name { font-family: var(--font-display); font-weight: 700; font-size: 15px; line-height: 20px; color: var(--header-primary); }
.activity-card-blurb { font-size: 12px; color: var(--text-muted); line-height: 16px; max-height: 32px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.activity-setup { height: 132px; display: flex; flex-direction: column; justify-content: flex-start; }
.activity-setup-game { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: var(--radius); background: var(--bg-dark); height: 100%; }
.activity-setup-title { font-weight: 700; color: var(--header-primary); font-size: 14px; }
.activity-setup-watch { display: flex; flex-direction: column; gap: 8px; height: 100%; }
.activity-setup-watch .field-label input { width: 100%; }
.activity-chips { height: 26px; display: flex; gap: 6px; overflow: hidden; }
.activity-chips:empty::before { content: "No videos are attached in the open channel"; font-size: 12px; color: var(--text-faint); line-height: 26px; }
.activity-chip {
  height: 26px;
  max-width: 200px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--bg-active);
  color: var(--header-primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.activity-chip > span { overflow: hidden; text-overflow: ellipsis; }
.activity-chip:hover { background: var(--header-primary); color: var(--bg-darkest); }
.activity-chip[aria-pressed="true"] { border-color: var(--accent); }

.bots-actions { display: flex; align-items: center; gap: 12px; }
.bots-actions .btn-primary { width: 128px; }
.bots-list { display: flex; flex-direction: column; gap: 8px; }
.bots-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 32px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
}
.bots-empty-title { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--header-primary); }
.bots-empty .setting-sub { max-width: 420px; }
.bot-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-dark);
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: border-color .12s;
}
.bot-card:hover { border-color: var(--bg-active); }
.bot-card-top { display: flex; align-items: center; gap: 12px; height: 40px; }
.avatar.bot-card-avatar { width: 40px; height: 40px; font-size: 15px; position: relative; }
.bot-card-avatar .presence-dot { border-color: var(--bg-dark); }
.bot-card-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bot-card-name { display: flex; align-items: center; min-width: 0; }
.bot-card-label {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--header-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bot-card-status { font-size: 12px; color: var(--text-faint); }
.bot-card-status.online { color: var(--green); }
.bot-card-actions { display: flex; gap: 8px; flex-shrink: 0; }
.bot-card-actions .btn-small { width: 84px; }
.bot-card-ability { font-size: 13px; color: var(--text-muted); line-height: 1.45; }
.bot-card-row { display: flex; align-items: flex-start; gap: 12px; }
.bot-card-key {
  flex: none;
  width: 76px;
  padding-top: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.bot-card-row .role-chips { padding-left: 0; flex: 1; min-width: 0; }
.bot-card-commands { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.bot-command {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--bg-darkest);
  color: var(--text-normal);
  font-family: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  font-size: 12px;
}
.bot-card-none { display: inline-flex; align-items: center; height: 24px; font-size: 13px; color: var(--text-faint); }
button.role-chip { background: none; font-family: inherit; line-height: inherit; }
.role-chip.readonly { cursor: default; }
.role-chip.readonly:hover { background: none; }

#modal-add-bot { width: min(600px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; }
.bot-steps { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 18px; counter-reset: bot-step; }
.bot-step { position: relative; padding-left: 38px; display: flex; flex-direction: column; gap: 8px; counter-increment: bot-step; }
.bot-step::before {
  content: counter(bot-step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font: 700 13px/24px var(--font-display);
  text-align: center;
}
.bot-step-title { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--header-primary); }
.bot-step .setting-sub { line-height: 1.45; }
.bot-step .setting-sub code { background: var(--bg-darkest); padding: 1px 4px; border-radius: 3px; font-size: 12px; }
.btn-link.inline { padding: 0; font-size: inherit; color: var(--link); }
.bot-commands { display: flex; flex-direction: column; gap: 6px; }
.bot-code-row { display: flex; align-items: center; gap: 8px; height: 36px; }
.bot-code {
  flex: 1;
  min-width: 0;
  height: 36px;
  line-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-darkest);
  color: var(--text-normal);
  font-family: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bot-code.muted { color: var(--text-faint); font-family: var(--font); }
.bot-code-row .btn-small { flex: none; width: 72px; }
.bot-name-field { max-width: 260px; }
.bot-port { border-radius: var(--radius-sm); background: var(--bg-dark); padding: 0 12px; }
.bot-port[open] { padding-bottom: 12px; }
.bot-port summary { height: 36px; line-height: 36px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.bot-port summary:hover { color: var(--text-normal); }
.bot-port[open] > .setting-sub, .bot-port[open] > .bot-commands { margin-bottom: 8px; }
.bot-port .btn-link { padding: 0; color: var(--link); font-size: 13px; }
.bot-waiting, #add-bot-joined { min-height: 60px; }
.bot-waiting { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-muted); }
.bot-waiting-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--yellow); flex: none; animation: bot-wait 1.6s ease-in-out infinite; }
@keyframes bot-wait { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .bot-waiting-dot { animation: none; } }
#add-bot-joined { display: flex; flex-direction: column; gap: 8px; }
#add-bot-joined .role-chips { padding-left: 0; }
.bot-role-chips .role-chip.held { background: var(--bg-active); color: var(--header-primary); }
.bot-role-chips button.role-chip.held:hover { background: var(--bg-hover); }

.settings-phone-bar { display: none; }

@media (max-width: 700px) {
  .app[data-pane="list"] {
    grid-template-columns: 60px minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr);
    padding-top: calc(8px + env(safe-area-inset-top));
  }
  .app[data-pane="list"] > .rail { grid-column: 1; grid-row: 1; }
  .app[data-pane="list"] > .sidebar { grid-column: 2; grid-row: 1; }
  .app[data-pane="list"] > .rail {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 4px 0 0;
    overflow: hidden;
  }
  .app[data-pane="list"] .rail-divider { width: 28px; height: 1px; }
  .app[data-pane="list"] .server-list {
    flex-direction: column;
    flex: 0 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 8px 6px 2px;
    margin: -6px 0 0;
    gap: 10px;
  }
  .app[data-pane="list"] .count-badge { right: -4px; }
  .app[data-pane="list"] #home-badge { top: -2px; }
  .app[data-pane="list"] .rail-home { padding: 0; width: 48px; height: 48px; justify-content: center; border-radius: 16px; }
  .app[data-pane="list"] .rail-home-label { display: none; }
  .app[data-pane="list"] .rail-home > svg { width: 22px; height: 22px; }
  .app[data-pane="list"] :is(.server-icon, .rail-btn:not(.rail-home)) { width: 48px; height: 48px; border-radius: 16px; }
  .app[data-pane="list"] .rail-add { border-radius: 50%; }
  .app[data-pane="list"] .server-icon.active::before {
    left: -6px;
    top: 50%;
    bottom: auto;
    width: 3px;
    height: 24px;
    margin: -12px 0 0;
    border-radius: 0 3px 3px 0;
  }
  .app[data-pane="list"] .user-panel {
    flex-direction: column;
    height: auto;
    width: 52px;
    gap: 4px;
    padding: 6px 0;
    border-radius: 26px;
    margin-bottom: 0;
  }
  .app[data-pane="list"] .user-chip { padding: 0; justify-content: center; }
  .app[data-pane="list"] .user-panel #me-avatar { width: 40px; height: 40px; }
  .app[data-pane="list"] .user-actions { justify-content: center; width: 44px; }
  .app[data-pane="list"] .user-actions .icon-btn { flex: 0 0 44px; width: 44px; height: 44px; }

  .sidebar-header { min-height: 56px; }
  .sidebar .header-btns .icon-btn { width: 44px; height: 44px; }
  .channel { min-height: 44px; padding: 8px 10px; font-size: 16px; }
  .channel .hash { font-size: 19px; }
  .dm-thread { min-height: 56px; }
  .dm-thread .avatar { width: 40px; height: 40px; }
  .dm-name { font-size: 15px; }
  .dm-preview { font-size: 13px; }
  .channel-group { padding: 16px 10px 6px; }
  .dm-search { height: 40px; font-size: 16px; }

  .events-layer { padding: calc(24px + env(safe-area-inset-top)) 0 0; align-items: flex-end; }
  .events-panel { width: 100%; max-height: 100%; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .events-head { flex-wrap: wrap; row-gap: 10px; padding: 16px; }
  .events-head h2 { flex: 1 1 auto; }
  .events-tabs { order: 3; flex: 1 0 100%; }
  .events-tab { flex: 1; min-height: 40px; }

  .modal-backdrop { align-items: flex-end; padding: calc(24px + env(safe-area-inset-top)) 0 0; }
  .modal {
    border-radius: 20px 20px 0 0 !important;
    border-bottom: none;
    padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
    animation: phone-sheet-in .2s var(--ease-out, ease-out);
  }
  .modal .btn-primary, .modal .btn-secondary, .modal .btn-danger { min-height: 44px; }

  .emoji-pop, .emoji-picker {
    position: fixed;
    inset: auto 0 0 0 !important;
    width: 100%;
    height: min(60dvh, 520px);
    max-height: none;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    z-index: 185;
    animation: phone-sheet-in .2s var(--ease-out, ease-out);
  }
  .emoji-picker { padding-top: 14px; }
  .eb-foot { height: calc(44px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }
  .emoji-browser .eb-search input, .pop-gifs input { font-size: 16px; }

  .settings-layer { padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); gap: 0; }
  .settings-layer .settings-close-wrap { display: none; }
  .settings-phone-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 56px;
    padding: 0 6px;
    flex-shrink: 0;
  }
  .settings-phone-title {
    flex: 1;
    min-width: 0;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--header-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-left: 10px;
  }
  .settings-phone-bar .icon-btn { width: 44px; height: 44px; }
  .settings-layer[data-phone-view="page"] .settings-phone-title { padding-left: 0; }
  .settings-layer:not([data-phone-view="page"]) .settings-phone-back { display: none; }
  .settings-layer:not([data-phone-view="page"]) > .settings-content { display: none; }
  .settings-layer[data-phone-view="page"] > .settings-nav { display: none; }
  .settings-layer:not([data-phone-view="page"]) > .settings-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0 8px 8px;
  }
  .settings-layer:not([data-phone-view="page"]) .settings-nav-inner {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 8px;
  }
  .settings-layer:not([data-phone-view="page"]) :is(.settings-nav-group, .settings-nav-sep):not(.hidden) { display: block; }
  .settings-layer:not([data-phone-view="page"]) .settings-nav-title { display: none; }
  .settings-layer:not([data-phone-view="page"]) .settings-tab {
    display: flex;
    align-items: center;
    min-height: 48px;
    font-size: 16px;
    padding: 0 14px;
    border-radius: 12px;
  }
  .settings-layer:not([data-phone-view="page"]) .settings-tab.hidden { display: none; }
  .settings-layer:not([data-phone-view="page"]) .settings-tab.active { background: none; color: var(--text-muted); }
  .settings-layer[data-phone-view="page"] > .settings-content { margin: 0 8px 8px; }
  .settings-layer[data-phone-view="page"] .settings-page > h1:first-child { display: none; }
  .settings-layer[data-phone-view="page"] .settings-page > h1:first-child + .settings-intro { margin-top: 0; }
  .settings-search { height: 44px; font-size: 16px; }
  .settings-layer:not([data-phone-view="page"]) .settings-nav-inner.searching > :is(.settings-tab, .settings-nav-group, .settings-nav-sep) { display: none; }
  .settings-search-result { min-height: 48px; justify-content: center; padding: 6px 14px; }
  .settings-content-inner { padding: 12px 14px 60px; }
  .device-grid, .camera-card { grid-template-columns: minmax(0, 1fr) !important; }
  .member { min-height: 52px; padding: 6px 12px; font-size: 16px; }
  .member > .avatar { width: 36px; height: 36px; }
}

@keyframes phone-sheet-in {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .modal { animation: none; } }

.tray-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  background: var(--bg-darkest);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  cursor: pointer;
}
.tray-opt .switch { flex: none; }

.titlebar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 32px;
  display: flex;
  align-items: stretch;
  background: var(--bg-darkest);
  z-index: 1000;
}
.titlebar-drag {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
}
.titlebar-icon.server-icon, .titlebar-icon.server-icon:hover {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  font-size: 9px;
  flex: none;
  cursor: default;
  pointer-events: none;
}
.titlebar-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.titlebar-name {
  font-family: var(--font-display, inherit);
  font-size: 13px;
  font-weight: 600;
  color: var(--header-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}
.titlebar-controls { flex: none; display: flex; }
.titlebar-btn {
  width: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  color: var(--text-muted);
  cursor: default;
}
.titlebar-btn:hover { background: var(--bg-active); color: var(--header-primary); }
.titlebar-close:hover { background: #ff4d4d; color: #fff; }
body.has-titlebar .app { height: calc(100vh - 32px); margin-top: 32px; }

.modal-notify { width: 480px; gap: 10px; }
.notify-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.notify-head p { font-family: var(--font-display); font-weight: 600; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notify-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); margin-top: 8px; }
.notify-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; background: var(--bg-dark); border-radius: var(--radius); cursor: pointer; }
.notify-row .setting-title { color: var(--header-primary); }
.notify-row .setting-sub { margin-top: 2px; line-height: 1.4; }
.notify-levels { display: flex; flex-direction: column; background: var(--bg-dark); border-radius: var(--radius); padding: 4px; }
.notify-level { display: flex; align-items: center; gap: 12px; padding: 10px; border: none; border-radius: var(--radius-sm); background: transparent; color: var(--text-normal); font: inherit; text-align: left; cursor: pointer; transition: background var(--t-hover) var(--ease-out); }
.notify-level:hover:not(:disabled) { background: var(--bg-hover); }
.notify-level:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.notify-level > span:last-child { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.notify-level-name { font-weight: 600; color: var(--header-primary); }
.notify-level-sub { font-size: 13px; color: var(--text-muted); }
.notify-mark { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--text-muted); flex-shrink: 0; box-sizing: border-box; transition: border-color var(--t-hover) var(--ease-out), background var(--t-hover) var(--ease-out); }
.notify-level.picked .notify-mark { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--bg-dark); }
.modal-notify.muted .notify-levels { opacity: .45; }
.join-sound-list { max-height: 320px; overflow-y: auto; }
.notify-level:disabled { cursor: default; }

.vp-talk {
  height: 44px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--bg-hover);
  color: var(--header-primary);
  font: 700 14px var(--font);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: pointer;
}
.vp-talk.on { background: var(--accent); color: var(--accent-ink); }

.phone-voice { display: none; }
.phone-voice-where {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  padding: 0 8px;
  border: none;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--green);
  font: 600 14px var(--font);
  cursor: pointer;
}
.phone-voice-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-voice .vp-talk { flex: 0 1 112px; min-width: 92px; padding: 0; }
.phone-voice .icon-btn { flex-shrink: 0; width: 44px; height: 44px; }
.phone-voice .icon-btn.active { color: var(--header-primary); background: var(--bg-active); }

@media (max-width: 700px) {
  .phone-voice:not(.hidden) {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 52px;
    flex-shrink: 0;
    padding: 0 6px;
    border-bottom: 1px solid var(--bg-active);
  }
}

body.mobile-app .vp-actions { display: flex; }
body.mobile-app .vp-actions > * { flex: 1 1 0; }

@media (min-width: 701px) {
  body.mobile-app .app {
    height: 100dvh;
    padding: env(safe-area-inset-top) calc(10px + env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) calc(10px + env(safe-area-inset-left));
  }
  body.mobile-app .settings-layer {
    padding: calc(10px + env(safe-area-inset-top)) calc(10px + env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) calc(10px + env(safe-area-inset-left));
  }
  body.mobile-app .dm-card-stack { top: calc(64px + env(safe-area-inset-top)); right: calc(16px + env(safe-area-inset-right)); bottom: auto; }
}

@media (min-width: 701px) and (max-width: 1000px) {
  body.mobile-app .app { --sidebar-w: 248px; }
}

@media (min-width: 701px) and (max-height: 640px) {
  body.mobile-app .app { grid-template-rows: 52px minmax(0, 1fr); gap: 8px; }
  body.mobile-app .sidebar-header.has-banner { height: 56px; }
  body.mobile-app .voice-panel { gap: 6px; padding: 6px; }
  body.mobile-app :is(.vp-preview, .vp-live-source) { display: none; }
  body.mobile-app .sidebar { overflow-y: auto; }
  body.mobile-app .sidebar > .channel-scroll { flex-shrink: 0; min-height: 168px; }
}

.narrow-servers, .narrow-column, .narrow-menu, .narrow-dock, .voice-rings { display: none; }

@keyframes ring-speaking {
  0% { box-shadow: 0 0 0 0 rgba(255, 77, 77, .5); }
  100% { box-shadow: 0 0 0 6px rgba(255, 77, 77, 0); }
}

@media (max-width: 700px) {
  .app.narrow-split {
    --narrow-left: 64px;
    --narrow-tile: 48px;
    --narrow-radius: 14px;
    grid-template-columns: var(--narrow-left) minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
  }
  .app.narrow-split > .rail { display: none; }
  .app.narrow-split > .sidebar { grid-column: 1; grid-row: 1; }
  .app.narrow-split > :is(.main, .thread-panel) { grid-column: 2; grid-row: 1; }
  .app.narrow-split.thread-open > .main, .app.narrow-split > :is(.members, .dm-profile) { display: none !important; }
  .app.narrow-split :is(.phone-back, .sidebar-resize, .sidebar-header, .sidebar-game-tags, .sidebar-link, .sidebar-sep, .voice-status-line) { display: none; }
  .app.narrow-split .chat-header { padding: 0 10px 0 16px; }
  .app.narrow-split #members-btn { display: none; }
  .app.narrow-split .chat-image { max-width: min(400px, 100%); height: auto; }

  .app.narrow-split .narrow-servers { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: none; padding: 8px 0 0; }
  .app.narrow-split :is(.narrow-active, .narrow-grid) { position: relative; display: flex; align-items: center; justify-content: center; width: var(--narrow-tile); height: var(--narrow-tile); padding: 0; border: none; border-radius: var(--narrow-radius); cursor: pointer; }
  .app.narrow-split .narrow-active { background: none; }
  .app.narrow-split .narrow-active-icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 11px; overflow: hidden; box-shadow: 0 0 0 2px var(--bg-dark), 0 0 0 4px var(--header-primary); font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--header-primary); }
  .app.narrow-split :is(.narrow-active-icon, .narrow-grid-cell, .narrow-menu-icon) img { width: 100%; height: 100%; object-fit: cover; }
  .app.narrow-split .narrow-grid { display: grid; grid-template-columns: repeat(2, 18px); grid-auto-rows: 18px; gap: 3px; align-content: center; justify-content: center; background: var(--bg-raised); box-shadow: inset 0 0 0 1px var(--line); box-sizing: border-box; }
  .app.narrow-split .narrow-grid:hover { background: var(--bg-active); }
  .app.narrow-split .narrow-grid.lone { display: flex; color: var(--text-muted); }
  .app.narrow-split .voice-gate-pill { left: 8px; right: 8px; justify-content: center; padding: 10px 0; }
  .app.narrow-split .voice-gate-text { display: none; }
  .app.narrow-split .narrow-grid-cell { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; border-radius: 6px; overflow: hidden; font-size: 7px; font-weight: 700; color: var(--header-primary); }
  .app.narrow-split .narrow-grid-more { background: var(--bg-active); color: var(--text-muted); font-size: 9px; font-variant-numeric: tabular-nums; }
  .app.narrow-split :is(.narrow-grid, .narrow-channel).unread::after { content: ""; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg-dark); }

  .app.narrow-split .narrow-column { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; min-height: 0; overflow-y: auto; padding: 8px 0; scrollbar-width: none; }
  .app.narrow-split .narrow-column::-webkit-scrollbar { display: none; }
  .app.narrow-split :is(.narrow-channel, .narrow-voice-tile) {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    width: var(--narrow-tile);
    box-sizing: border-box;
    flex: none;
    padding: 8px 2px 6px;
    border: none;
    border-radius: var(--narrow-radius);
    background: var(--bg-raised);
    box-shadow: inset 0 0 0 1px var(--line);
    color: var(--text-muted);
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
  }
  .app.narrow-split :is(.narrow-channel, .narrow-voice-tile):hover { background: var(--bg-hover); color: var(--text-normal); }
  .app.narrow-split .narrow-channel { background: var(--bg-active); box-shadow: none; color: var(--ink-strong); }
  .app.narrow-split .narrow-channel { height: var(--narrow-tile); padding: 0 2px; justify-content: center; gap: 0; }
  .app.narrow-split .narrow-channel .narrow-channel-name { display: none; }
  .app.narrow-split .narrow-grid:has(.narrow-grid-cell:only-child) { grid-template-columns: 28px; grid-auto-rows: 28px; }
  .app.narrow-split .narrow-grid .narrow-grid-cell:only-child { width: 28px; height: 28px; border-radius: 9px; font-size: 10px; }
  .app.narrow-split.channels-open .narrow-channel { box-shadow: 0 0 0 2px var(--header-primary); }
  .app.narrow-split .narrow-channel-mark { display: flex; align-items: center; height: 20px; font-size: 18px; color: var(--text-faint); }
  .app.narrow-split :is(.narrow-channel-name, .narrow-voice-name) { max-width: 40px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app.narrow-split .narrow-channel > svg { color: var(--text-faint); margin-top: -2px; }
  .app.narrow-split .narrow-voice-head { display: flex; align-items: center; gap: 3px; max-width: 40px; }
  .app.narrow-split .narrow-voice-head svg { flex: none; }
  .app.narrow-split .narrow-voice-tile.connected { color: var(--header-primary); box-shadow: inset 0 0 0 1px rgba(242, 239, 230, .35); }
  .app.narrow-split .narrow-voice-tile.connected .narrow-voice-head svg { color: var(--accent); }
  .app.narrow-split .narrow-voice-grid { display: grid; grid-template-columns: repeat(2, 18px); grid-auto-rows: 18px; gap: 3px; padding: 2px 0; }

  .app.narrow-split .voice-rings { display: flex; flex-wrap: wrap; align-items: center; padding: 2px 8px 8px 32px; }
  .app.narrow-split .voice-ring {
    position: relative;
    width: 30px;
    height: 30px;
    padding: 0;
    margin-left: -6px;
    border-radius: 50%;
    background: var(--bg-raised);
    box-shadow: 0 0 0 2px var(--bg-raised);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    cursor: pointer;
  }
  .app.narrow-split .voice-ring:first-child { margin-left: 0; }
  .app.narrow-split .voice-ring:hover { background: var(--bg-raised); }
  .app.narrow-split .voice-ring .avatar { width: 30px; height: 30px; font-size: 11px; }
  .app.narrow-split .voice-ring .avatar::after { border-color: var(--accent); inset: -3px; }
  .app.narrow-split .voice-ring.speaking .avatar::before { animation-name: ring-speaking; }
  .app.narrow-split .voice-ring.muted .avatar { opacity: .55; }
  .app.narrow-split .narrow-voice-tile.voice-drop { box-shadow: inset 0 0 0 2px var(--accent); }
  .app.narrow-split .voice-ring .sb-flash { display: none; }
  .app.narrow-split .voice-ring-more { font-size: 11px; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; }
  .app.narrow-split .narrow-voice-grid .voice-ring { width: 18px; height: 18px; margin: 0; box-shadow: none; }
  .app.narrow-split .narrow-voice-grid .voice-ring .avatar { width: 18px; height: 18px; font-size: 8px; }
  .app.narrow-split .narrow-voice-grid .voice-ring-more { font-size: 9px; background: var(--bg-active); }

  .app.narrow-split .channel-scroll { display: none; }
  .app.narrow-split.channels-open .channel-scroll,
  .app.narrow-split.flyout-open .narrow-menu {
    display: block;
    position: fixed;
    z-index: 40;
    left: calc(var(--narrow-left) + 16px);
    width: 268px;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    padding: 8px;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
  }
  .app.narrow-split.flyout-open .narrow-menu { display: flex; flex-direction: column; gap: 2px; }
  .app.narrow-split .narrow-menu-title { padding: 8px 10px 6px; font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--header-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app.narrow-split .narrow-menu-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 4px 8px; border: none; border-radius: 12px; background: none; color: var(--text-normal); font: inherit; font-size: 15px; font-weight: 600; text-align: left; cursor: pointer; }
  .app.narrow-split .narrow-menu-row:hover { background: var(--bg-hover); }
  .app.narrow-split .narrow-menu-row.active { background: var(--bg-active); color: var(--header-primary); }
  .app.narrow-split .narrow-menu-icon { width: 36px; height: 36px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 11px; overflow: hidden; background: var(--bg-hover); color: var(--text-muted); font-size: 13px; }
  .app.narrow-split .narrow-menu-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app.narrow-split .narrow-menu-sep { height: 1px; margin: 6px 8px; background: var(--line); }

  .app.narrow-split .voice-panel { display: grid; grid-template-columns: repeat(2, 18px); gap: 4px; justify-content: center; width: var(--narrow-tile); box-sizing: border-box; margin: 0 auto 8px; padding: 4px; border-radius: var(--narrow-radius); }
  .app.narrow-split .voice-panel.hidden { display: none; }
  .app.narrow-split :is(.vp-conn-meta, .vp-grid, .vp-live, .vp-watch, .vp-streams, .vp-stage, .vp-game-share, .caret-btn, .vp-activities > span) { display: none; }
  .app.narrow-split :is(.vp-voice, .vp-conn, .vp-actions, .vp-voice .split-btn) { display: contents; }
  .app.narrow-split .voice-panel :is(.icon-btn, .vp-activities) { width: 18px; height: 18px; min-width: 0; flex: none; padding: 0; justify-content: center; border-radius: 7px; background: var(--bg-hover); }
  .app.narrow-split .voice-panel :is(.icon-btn, .vp-activities):hover { background: var(--bg-active); }
  .app.narrow-split .voice-panel :is(.icon-btn, .vp-activities) svg { width: 12px; height: 12px; }
  .app.narrow-split .voice-panel .vp-hangup { order: 1; }
  .app.narrow-split .voice-panel:has(#vp-activities:not(.hidden)) .vp-hangup { grid-column: 1 / -1; width: 100%; }

  .app.narrow-split .narrow-dock { display: flex; justify-content: center; flex: none; padding: 0 0 8px; }
  .app.narrow-split .narrow-dock .user-panel { flex-direction: column; width: var(--narrow-tile); box-sizing: border-box; height: auto; gap: 4px; padding: 6px 0; border-radius: var(--narrow-radius); }
  .app.narrow-split .narrow-dock .user-chip { flex: none; padding: 0; justify-content: center; }
  .app.narrow-split .narrow-dock .user-meta { display: none; }
  .app.narrow-split .narrow-dock #me-avatar { width: 34px; height: 34px; }
}

.avatar.has-border { position: relative; }
.avatar-border {
  position: absolute;
  inset: -9%;
  box-sizing: border-box;
  border-radius: 50%;
  pointer-events: none;
}
.avatar-border, .avatar-border * { animation-play-state: paused; }
.avatar:hover > .avatar-border, .avatar:hover > .avatar-border *,
.member:hover .avatar-border, .member:hover .avatar-border *,
.msg:hover .avatar-border, .msg:hover .avatar-border *,
.av-live .avatar-border, .av-live .avatar-border *,
.avatar.av-live > .avatar-border, .avatar.av-live > .avatar-border * { animation-play-state: running; }
.ab-ring { border: 2px solid var(--header-primary); }
.ab-double { border: 4px double var(--header-primary); }
.ab-sunset, .ab-ocean {
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  animation: ab-spin 6s linear infinite;
}
.ab-sunset { background: conic-gradient(#ffb347, #ff6b6b, #ff4d8d, #9b5cff, #ffb347); }
.ab-ocean { background: conic-gradient(#4fd6cb, #3a8dff, #84b4ff, #2ec4b6, #4fd6cb); }
.ab-neon { border: 2px solid #ff6b6b; box-shadow: 0 0 6px #ff4d4d, inset 0 0 4px #ff4d4d; animation: ab-neon 2.2s ease-in-out infinite; }
.ab-stars { border: 1.5px solid #f3c969; }
.ab-leaves { border: 1.5px solid #67c27a; }
.ab-orbit { border: 1px dashed color-mix(in srgb, var(--header-primary) 55%, transparent); animation: ab-spin 5s linear infinite; }
.ab-orbit-dot {
  position: absolute;
  top: -3px;
  left: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}
.ab-ornaments { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ab-stars .ab-ornaments path { fill: #f3c969; animation: ab-twinkle 2.4s ease-in-out infinite; }
.ab-stars .ab-ornaments path:nth-child(2n) { animation-delay: -1.2s; }
.ab-stars .ab-ornaments path:nth-child(3n) { animation-delay: -.6s; }
.ab-leaves .ab-ornaments path { fill: #67c27a; }
.ab-leaves .ab-ornaments path:nth-child(2n) { fill: #9bd66f; }
@keyframes ab-spin { to { transform: rotate(360deg); } }
@keyframes ab-neon {
  0%, 100% { box-shadow: 0 0 6px #ff4d4d, inset 0 0 4px #ff4d4d; }
  50% { box-shadow: 0 0 12px #ff6b6b, inset 0 0 6px #ff6b6b; }
}
@keyframes ab-twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

.card-effect {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  border-radius: inherit;
}
.ce-p {
  position: absolute;
  left: var(--x);
  top: var(--y);
  animation-duration: var(--t);
  animation-delay: calc(var(--d) * -1s);
  animation-iteration-count: infinite;
}
.ce-sparkles .ce-p {
  width: calc(var(--s) * 8px);
  height: calc(var(--s) * 8px);
  background: radial-gradient(circle, #fffbe8 0 18%, transparent 20%), conic-gradient(from 45deg, transparent 0 8%, #fff6c8 10% 15%, transparent 17% 33%, #fff6c8 35% 40%, transparent 42% 58%, #fff6c8 60% 65%, transparent 67% 83%, #fff6c8 85% 90%, transparent 92%);
  border-radius: 50%;
  animation-name: ce-twinkle;
  animation-timing-function: ease-in-out;
}
.ce-snow .ce-p {
  width: calc(var(--s) * 5px);
  height: calc(var(--s) * 5px);
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  animation-name: ce-fall;
  animation-timing-function: linear;
}
.ce-bubbles .ce-p {
  width: calc(var(--s) * 12px);
  height: calc(var(--s) * 12px);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .7);
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .45), transparent 60%);
  animation-name: ce-rise;
  animation-timing-function: ease-in;
}
.ce-aurora {
  background: linear-gradient(115deg, transparent 10%, rgba(53, 194, 107, .4) 30%, rgba(79, 214, 203, .35) 45%, rgba(132, 180, 255, .4) 60%, rgba(196, 160, 255, .35) 75%, transparent 90%);
  background-size: 300% 100%;
  mix-blend-mode: screen;
  animation: ce-aurora 9s ease-in-out infinite alternate;
}
@keyframes ce-twinkle {
  0%, 100% { opacity: 0; transform: scale(.4); }
  50% { opacity: 1; transform: scale(1); }
}
@keyframes ce-fall {
  from { top: -8%; transform: translateX(0); }
  to { top: 108%; transform: translateX(10px); }
}
@keyframes ce-rise {
  from { top: 110%; opacity: .9; }
  to { top: -15%; opacity: 0; }
}
@keyframes ce-aurora {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .avatar-border, .avatar-border *, .card-effect, .card-effect * { animation: none !important; }
}
html[data-reduced-motion] .avatar-border,
html[data-reduced-motion] .avatar-border *,
html[data-reduced-motion] .card-effect,
html[data-reduced-motion] .card-effect * { animation: none !important; }
.ce-sparkles .ce-p { opacity: .8; }

.look-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.look-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 72px;
  padding: 10px 4px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-mid);
  color: var(--text-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-hover) ease, border-color var(--t-hover) ease;
}
.look-option:hover { background: var(--bg-hover); color: var(--text-normal); }
.look-option[aria-checked="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); color: var(--header-primary); }
.look-option .avatar { width: 36px; height: 36px; font-size: 14px; }
.look-swatch {
  position: relative;
  width: 56px;
  height: 36px;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(135deg, #2d3554, #121630);
}

.drive { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.drive-toolbar {
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 calc(16px + var(--chat-gutter));
  box-shadow: 0 1px 0 var(--line);
}
.drive-crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; overflow: hidden; white-space: nowrap; }
.drive-crumb {
  flex-shrink: 1;
  min-width: 0;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 4px 6px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.drive-crumb:hover { background: var(--bg-hover); color: var(--header-primary); }
.drive-crumb.current { color: var(--header-primary); font-weight: 600; cursor: default; }
.drive-crumb.current:hover { background: none; }
.drive-crumb-sep { color: var(--text-faint); }
.drive-tools { display: flex; gap: 8px; flex-shrink: 0; }
.drive-tools .btn-small { padding: 7px 14px; }
.beta-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 9px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  vertical-align: middle;
  flex-shrink: 0;
}
.drive-note { flex-shrink: 0; padding: 10px calc(16px + var(--chat-gutter)) 0; color: var(--text-faint); font-size: 13px; line-height: 1.4; }
.drive-list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px calc(16px + var(--chat-gutter)) 16px; display: flex; flex-direction: column; gap: 2px; }
.drive-row {
  --drive-progress: 0;
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 220px 120px;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 8px 0 10px;
  border-radius: var(--radius-sm);
}
.drive-row:hover { background: var(--bg-hover); }
.drive-row::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: calc(var(--drive-progress) * 100%);
  background: var(--accent);
  border-radius: 1px;
}
.drive-row-icon { display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.drive-row.folder .drive-row-icon { color: var(--yellow); }
.drive-row-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 0; border: none; background: none; color: inherit; font: inherit; }
button.drive-row-main { cursor: pointer; }
.drive-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--header-primary); font-size: 15px; }
.drive-row-meta, .drive-row-kept { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-faint); font-size: 12.5px; }
.drive-row.away .drive-row-name { color: var(--text-muted); }
.drive-row-actions { display: flex; justify-content: flex-end; gap: 2px; }
.drive-action.danger:hover { color: var(--red); }
.drive-action.busy { opacity: .6; }
.drive-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 16px; color: var(--text-faint); text-align: center; }
.drive-item-text { margin: 0 0 16px; color: var(--text-muted); line-height: 1.45; }
.kind-text strong .beta-tag { margin-left: 6px; }
.storage-usage-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.storage-bar { display: flex; height: 10px; border-radius: var(--radius-pill); overflow: hidden; background: var(--bg-darkest); gap: 2px; }
.storage-slice { flex: 0 1 0; min-width: 3px; }
.storage-parts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 20px; min-height: 4.6em; }
.storage-part { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.storage-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.storage-part-name { flex: 1; min-width: 0; color: var(--text-normal); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.storage-part-size { color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.storage-folder { gap: 12px; }
.storage-path { margin-top: 6px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--bg-darkest); color: var(--text-normal); font-size: 13px; font-family: ui-monospace, Consolas, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: text; min-height: 1.4em; }
.storage-folder-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.modal-lines { display: flex; flex-direction: column; gap: 8px; }
.modal-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--text-muted); line-height: 1.4; }
#modal-clear-all .btn-link { align-self: flex-start; }
body.mobile-app .storage-parts { grid-template-columns: 1fr; }
.storage-action { flex: 0 0 auto; align-self: center; white-space: nowrap; }
.composer .icon-btn, .composer .gif-btn { align-self: center; margin: 0; flex: none; }
.composer { gap: 2px; padding: 0 10px; }

.startup { position: fixed; inset: 0; z-index: 990; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--bg-darkest); color: var(--text-normal); font-family: var(--font); transition: opacity 180ms var(--ease-out); }
.startup.leaving { opacity: 0; pointer-events: none; }
.reopen { z-index: 995; }
.app-lock { z-index: 994; }
.app-lock-unlock { margin-top: 22px; min-width: 220px; }
.reopen-text { margin: 0; max-width: 320px; font-size: 15px; line-height: 22px; text-align: center; color: var(--text-muted); }
.startup-card { width: min(400px, 100%); display: flex; flex-direction: column; align-items: center; gap: 0; }
.startup-logo { width: 64px; height: 64px; flex: none; }
.startup-title { margin: 14px 0 22px; height: 30px; font-family: var(--font-display); font-size: 22px; line-height: 30px; font-weight: 600; letter-spacing: -.01em; color: var(--header-primary); white-space: nowrap; }
.startup-steps { list-style: none; margin: 0; padding: 6px 0; width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 16px 40px rgba(0, 0, 0, .35); }
.startup-step { display: flex; align-items: flex-start; gap: 14px; padding: 12px 18px; height: 70px; box-sizing: border-box; }
.startup-step + .startup-step { border-top: 1px solid var(--line); }
.startup-mark { position: relative; flex: none; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--bg-active); box-sizing: border-box; display: grid; place-items: center; color: var(--bg-darkest); }
.startup-icon { display: none; grid-area: 1 / 1; }
.startup-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.startup-name { font-family: var(--font-display); font-size: 15px; line-height: 20px; font-weight: 600; color: var(--header-primary); }
.startup-detail { margin-top: 2px; font-size: 13px; line-height: 18px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.startup-bar { display: block; margin-top: 6px; height: 3px; border-radius: var(--radius-pill); background: var(--bg-active); overflow: hidden; visibility: hidden; }
.startup-bar.shown { visibility: visible; }
.startup-fill { display: block; height: 100%; background: var(--accent); transform-origin: left center; transform: scaleX(0); transition: transform 200ms linear; }
.startup-step[data-state="waiting"] .startup-name { color: var(--text-faint); }
.startup-step[data-state="working"] .startup-mark { border-color: var(--bg-active); border-top-color: var(--accent); animation: startup-turn 900ms linear infinite; }
.startup-step[data-state="done"] .startup-mark { border-color: var(--header-primary); background: var(--header-primary); }
.startup-step[data-state="done"] .startup-icon-done { display: block; }
.startup-step[data-state="skipped"] .startup-mark { border-color: var(--bg-active); color: var(--text-muted); }
.startup-step[data-state="skipped"] .startup-icon-skipped { display: block; }
.startup-step[data-state="failed"] .startup-mark { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.startup-step[data-state="failed"] .startup-icon-failed { display: block; }
.startup-step[data-state="failed"] .startup-detail { color: var(--text-normal); }
@keyframes startup-turn { to { transform: rotate(360deg); } }
.startup-skip { margin-top: 16px; height: 32px; padding: 0 12px; font-size: 13px; color: var(--text-muted); visibility: hidden; }
.startup-skip.shown { visibility: visible; }
.startup-skip:hover { color: var(--header-primary); }
.offline-chip { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 185; display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--radius-pill); background: var(--panel); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); font-size: 12px; line-height: 16px; color: var(--header-primary); white-space: nowrap; pointer-events: none; }
body.has-titlebar .offline-chip { top: 42px; }
.offline-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
@media (prefers-reduced-motion: reduce) {
  .startup { transition: none; }
  .startup-step[data-state="working"] .startup-mark { animation: none; }
  .startup-fill { transition: none; }
}

.dm-menu { position: fixed; z-index: 175; width: 300px; max-height: min(420px, calc(100vh - 80px)); overflow-y: auto; padding: 8px; border-radius: 16px; background: var(--bg-raised); box-shadow: 0 10px 28px rgba(0, 0, 0, .45), inset 0 0 0 1px var(--line); scrollbar-width: thin; }
.dm-menu-title { padding: 4px 8px 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.dm-menu-empty { padding: 10px 8px; font-size: 13px; color: var(--text-muted); }
.dm-menu-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: none; border-radius: 10px; background: none; color: var(--text-normal); font: inherit; text-align: left; cursor: pointer; position: relative; }
.dm-menu-row:hover { background: var(--bg-hover); }
.dm-menu-row.unread { background: var(--bg-active); }
.dm-menu-row.unread::after { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.dm-menu-row .avatar { position: relative; width: 32px; height: 32px; flex: none; font-size: 13px; }
.dm-menu-meta { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.dm-menu-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-menu-preview { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-menu-all { display: block; width: 100%; margin-top: 4px; padding: 10px 8px 6px; border: none; border-top: 1px solid var(--line); background: none; color: var(--accent-hover); font: inherit; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; }
.dm-menu-all:hover { color: var(--text-normal); }
.dm-card-stack { position: fixed; right: 16px; bottom: 84px; z-index: 180; display: flex; flex-direction: column; gap: 8px; width: 300px; max-width: calc(100vw - 32px); pointer-events: none; }
.dm-card { pointer-events: auto; padding: 12px; border-radius: 16px; background: var(--bg-raised); box-shadow: 0 10px 28px rgba(0, 0, 0, .45), inset 0 0 0 1px var(--line-strong); }
.dm-card-head { display: flex; align-items: center; gap: 10px; }
.dm-card-head .avatar { position: relative; width: 34px; height: 34px; flex: none; font-size: 14px; }
.dm-card-text { flex: 1; min-width: 0; }
.dm-card-name { font-size: 14px; font-weight: 700; color: var(--header-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-card-body { font-size: 13px; color: var(--text-normal); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-card-close { flex: none; width: 24px; height: 24px; padding: 0; border: none; border-radius: 50%; background: none; color: var(--text-faint); font-size: 18px; line-height: 24px; cursor: pointer; align-self: flex-start; }
.dm-card-close:hover { background: var(--bg-hover); color: var(--text-normal); }
.dm-card-row { display: flex; gap: 8px; margin-top: 10px; }
.dm-card-input { flex: 1; min-width: 0; height: 32px; padding: 0 10px; border: none; border-radius: 10px; background: var(--bg-darkest); box-shadow: inset 0 0 0 1px var(--line); color: var(--text-normal); font: inherit; font-size: 13px; outline: none; }
.dm-card-input:focus { box-shadow: inset 0 0 0 1px var(--line-strong); }
.dm-card-open { flex: none; height: 32px; padding: 0 14px; border: none; border-radius: 10px; background: var(--accent); color: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.dm-card-open:hover { background: var(--accent-hover); }

@media (max-width: 700px) {
  .dm-card-stack { top: calc(12px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right)); bottom: auto; left: calc(12px + env(safe-area-inset-left)); width: auto; max-width: none; }
}

.scroll-down-dock { position: relative; height: 0; z-index: 3; }
.scroll-down {
  position: absolute;
  right: calc(20px + var(--chat-gutter, 0px));
  bottom: 12px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg-raised);
  color: var(--header-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  cursor: pointer;
}
.scroll-down:hover { background: var(--bg-active); }

html.mobile-app, body.mobile-app { overscroll-behavior: none; }
body.mobile-app {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
body.mobile-app .app { height: var(--app-height, 100dvh); }
body.mobile-app .msg:hover { background: none; }
body.mobile-app .msg.touched { background: rgba(0, 0, 0, .12); }
body.mobile-app .msg:not(.touched):hover .msg-actions { display: none; }
body.mobile-app .msg:not(.touched):hover .reaction.add { opacity: 0; }
body.mobile-app .scroll-down { width: 44px; height: 44px; right: 16px; }
html.mobile-app { overflow: hidden; }
body.mobile-app { position: fixed; inset: 0; width: 100%; height: auto; }
html.viewport-shifted body.mobile-app { translate: 0 var(--app-top, 0px); }
body.mobile-app :is(.messages, .thread-messages) { overflow-x: hidden; overscroll-behavior: contain; }
body.mobile-app :is(.channel-scroll, .members, .eb-body, .gif-grid, .emoji-grid) { overscroll-behavior: contain; }
.file-catcher { position: fixed; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }
body.mobile-app .eb-foot { display: none; }

@media (max-width: 700px) {
  body.mobile-app :is(.emoji-picker, .emoji-pop) { bottom: var(--keyboard-height, 0px) !important; padding-bottom: env(safe-area-inset-bottom); }
  body.mobile-app .gif-picker:not(.gif-picker-float) {
    position: fixed;
    inset: auto 0 var(--keyboard-height, 0px) 0;
    width: 100%;
    max-width: none;
    height: min(60dvh, 520px);
    max-height: none;
    padding: 14px 12px calc(8px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    z-index: 185;
    animation: phone-sheet-in .2s var(--ease-out, ease-out);
  }
  html.keyboard-up body.mobile-app :is(.emoji-picker, .emoji-pop, .gif-picker:not(.gif-picker-float)) {
    height: calc(var(--app-height, 100dvh) - 56px - env(safe-area-inset-top));
    padding-bottom: 8px;
  }
  body.mobile-app :is(.gif-picker > input, .emoji-picker > input, .eb-search) { height: 44px; }
  body.mobile-app :is(.gif-picker input, .emoji-picker input) { font-size: 16px; }
  body.mobile-app .composer-menu > button { min-height: 48px; font-size: 16px; }
  body.mobile-app .pop-menu { max-height: calc(var(--app-height, 100dvh) - 24px); overflow-y: auto; overscroll-behavior: contain; }
  body.mobile-app .pop-menu button { min-height: 40px; }
  body.mobile-app .member-card {
    inset: auto 0 var(--keyboard-height, 0px) 0 !important;
    width: 100%;
    max-height: calc(var(--app-height, 100dvh) - 48px - env(safe-area-inset-top));
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    padding-bottom: env(safe-area-inset-bottom);
    animation: phone-sheet-in .2s var(--ease-out, ease-out);
  }
}

@media (max-width: 700px) {
  .discover-head { flex-wrap: wrap; align-items: center; gap: 8px 4px; padding: 10px 12px 8px; }
  .discover-head .phone-back { margin-left: -4px; }
  .discover-title { flex: 1 1 0; min-width: 0; }
  .discover-title h2 { font-size: 20px; }
  .discover-search { flex: 1 1 100%; height: 42px; }
  .discover-search input { font-size: 16px; }
  .discover-chips { padding: 4px 12px 10px; }
  .discover-body { padding: 12px; }
  .discover-grid { grid-template-columns: minmax(0, 1fr); }
}
body.mobile-app .channel.drive-channel { display: none; }

@media (max-width: 700px) {
  .setting-row:has(> select) { flex-wrap: wrap; gap: 8px 16px; }
  .setting-row:has(> select) > div:first-child { flex: 1 1 100%; }
  .setting-row > select { flex: 1 1 100%; width: 100%; min-width: 0; height: 44px; }
  .settings-layer select { font-size: 16px; }
  .settings-layer .form-actions .btn-primary { flex: 1 1 auto; min-height: 44px; font-size: 15px; }

  .profile-body { flex-wrap: wrap; gap: 8px 12px; padding: 0 12px; }
  .profile-names { flex: 1 1 0; }
  .profile-display { overflow-wrap: anywhere; }
  .profile-avatar-btn { flex: 1 1 100%; min-height: 44px; margin: 0; font-size: 15px; }
  .profile-fields { margin: 12px 8px 8px; padding: 14px 12px; }
  .profile-banner .role-banner-btn { height: 36px; padding: 0 14px; font-size: 14px; }
  .profile-banner .role-banner-btn.icon { width: 36px; padding: 0; }
  .look-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  .look-option { width: auto; min-height: 76px; padding: 12px 4px 8px; font-size: 13px; }
}

@media (min-width: 701px) and (max-width: 760px) {
  body.mobile-app .app { --sidebar-w: 224px; }
  body.mobile-app .chat-header .topic { display: none; }
  body.mobile-app .chat-header .search-box { flex: 0 1 132px; width: auto; min-width: 44px; }
}
body.mobile-app .header-actions .icon-btn:not(.active):hover { background: none; color: var(--text-muted); }

.stack-panels { display: flex; flex-direction: column; gap: 4px; }
.stack-panels-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.stack-panel { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.stack-panel-name { flex: 1; min-width: 0; color: var(--header-primary); font-size: 14px; }
.stack-panel-move { width: 32px; height: 32px; }
.stack-panel-move:disabled { opacity: .35; cursor: default; }

.home-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  padding: 0 5px;
  height: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.home-tag.home-checking { opacity: .7; }
.home-tag.home-official { opacity: 1; }
.home-tag .home-seal { width: 11px; height: 11px; }
.acct-official { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; color: var(--header-primary, var(--text-normal)); font-weight: 600; white-space: nowrap; }
.acct-official .acct-seal { width: 15px; height: 15px; }
.acct-move-now { margin-bottom: 10px; }
.home-tag.home-lookalike, .home-tag.home-unverified, .home-tag.home-expired { border-color: var(--yellow); color: var(--yellow); }
.home-tag.home-blocked { border-color: var(--red); color: var(--red); }
.blocked-home-add { display: flex; gap: 8px; margin-top: 8px; }
.blocked-home-add input { flex: 1; }
.blocked-home-error { min-height: 1.2em; color: var(--red); }
.msg-blocked-home .msg-content { font-style: italic; color: var(--text-muted); }

.move-guide { max-width: 520px; }
.move-guide > .field-label { margin-top: 4px; }
.modal p.move-guide-note { font-size: 13px; color: var(--text-faint); }
.modal p.move-guide-status { min-height: 20px; font-size: 13px; color: var(--text-normal); }
.modal p.move-guide-status.error { color: var(--red); }
.move-guide > .move-guide-learn, .invite-link-learn, .signin-server-help { align-self: flex-start; padding: 0; border: 0; background: none; color: var(--link); font-size: 13px; font-weight: 600; cursor: pointer; }
.move-guide > .move-guide-learn:hover, .invite-link-learn:hover, .signin-server-help:hover { text-decoration: underline; }
.invite-link-learn { margin: -4px 0 12px; }
.signin-server-help { margin-top: 6px; }
.signin-move-note { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg-active); color: var(--text-normal); font-size: 13px; line-height: 1.4; text-align: left; }
.btn-link.inline-help { display: inline; padding: 0; border: 0; background: none; color: var(--link); font: inherit; font-weight: 600; cursor: pointer; }
.btn-link.inline-help:hover { text-decoration: underline; }
.account-line-keys { display: flex; align-items: center; gap: 12px; flex: none; }

.avatar-crop-stage {
  position: relative;
  width: min(280px, 100%);
  aspect-ratio: 1;
  margin: 4px auto 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-darkest);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.avatar-crop-stage:active { cursor: grabbing; }
.avatar-crop-stage.wide { width: min(360px, 100%); aspect-ratio: var(--crop-ratio, 3); }
.avatar-crop-stage img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  transform-origin: 0 0;
  pointer-events: none;
}
.avatar-crop-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 200px rgb(0 0 0 / .55), inset 0 0 0 2px rgb(255 255 255 / .7);
  pointer-events: none;
}
.avatar-crop-stage.wide::after { border-radius: inherit; box-shadow: inset 0 0 0 2px rgb(255 255 255 / .7); }
.avatar-crop-zoom {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(280px, 100%);
  margin: 0 auto;
  color: var(--text-muted);
}
.avatar-crop-zoom input { flex: 1; min-width: 0; }
.avatar-crop-stage.wide + .avatar-crop-zoom { width: min(360px, 100%); }
.avatar-crop-zoom-icon { display: grid; place-items: center; width: 20px; }

.web-app .signin-server,
.web-app .signin-server-note,
.web-app .signin-server-edit { display: none; }
.web-app .native-only { display: none !important; }
.web-unlock-code { display: flex; gap: 8px; margin-top: 16px; }
.web-unlock-code input { flex: 1; }
#modal-web-unlock .signin-status { margin-top: 12px; }
