/* App styles — themes: Dark (default) and Light. Special themes can be added later
   as more [data-theme="…"] blocks that override these variables. */

:root {
  /* Brand colours (the app sets these from packages/core/src/brand.ts at startup;
     these are the same values, used before the script runs). */
  --brand: #F2622E;
  --brand-light: #FF8A50;
  --brand-deep: #D2441D;
  --bg-rail: #1e1f22;
  --bg-side: #2b2d31;
  --bg-chat: #313338;
  --bg-panel: #232428;
  --bg-deep: #1e1f22;
  --bg-input: #383a40;
  --bg-float: #111214;
  --bg-modal: #313338;
  --bg-modal-foot: #2b2d31;
  --bg-hover: rgba(78, 80, 88, 0.3);
  --bg-active: rgba(78, 80, 88, 0.6);
  --msg-hover: rgba(2, 2, 2, 0.06);
  --border: rgba(255, 255, 255, 0.06);
  --sep: rgba(255, 255, 255, 0.07);
  --chip: rgba(255, 255, 255, 0.06);
  --chip-hover: rgba(255, 255, 255, 0.1);
  --chip-border: rgba(255, 255, 255, 0.12);
  --rail-item: #313338;
  --intro-icon: #41434a;
  --popout: #232428;
  --popout-card: #111214;
  --popout-card-hover: #1a1b1e;
  --btn-2: #4e5058;
  --btn-2-hover: #6d6f78;
  --toggle-off: #72767d;
  --scroll: #1a1b1e;
  --scroll-hover: #121315;
  --shadow: rgba(0, 0, 0, 0.45);
  --text: #dbdee1;
  --strong: #f2f3f5;
  --muted: #949ba4;
  --faint: #80848e;
  --icon: #b5bac1;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --accent-soft: rgba(88, 101, 242, 0.16);
  --accent-text: #a5acff;
  --ok-text: #6fd39a;
  --link: #00a8fc;
  --green: #23a55a;
  --red: #f23f43;
  --yellow: #f0b232;
  --radius: 8px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg-rail: #e3e5e8;
  --bg-side: #f2f3f5;
  --bg-chat: #ffffff;
  --bg-panel: #ebedef;
  --bg-deep: #e3e5e8;
  --bg-input: #ebedef;
  --bg-float: #ffffff;
  --bg-modal: #ffffff;
  --bg-modal-foot: #f2f3f5;
  --bg-hover: rgba(116, 124, 138, 0.14);
  --bg-active: rgba(116, 124, 138, 0.24);
  --msg-hover: rgba(6, 6, 7, 0.03);
  --border: rgba(6, 6, 7, 0.08);
  --sep: rgba(6, 6, 7, 0.1);
  --chip: rgba(6, 6, 7, 0.05);
  --chip-hover: rgba(6, 6, 7, 0.08);
  --chip-border: rgba(6, 6, 7, 0.14);
  --rail-item: #ffffff;
  --intro-icon: #e3e5e8;
  --popout: #ffffff;
  --popout-card: #f2f3f5;
  --popout-card-hover: #e3e5e8;
  --btn-2: #6d6f78;
  --btn-2-hover: #4e5058;
  --toggle-off: #80848e;
  --scroll: #c4c9ce;
  --scroll-hover: #a3a9ae;
  --shadow: rgba(0, 0, 0, 0.16);
  --text: #313338;
  --strong: #060607;
  --muted: #5c5e66;
  --faint: #6d6f78;
  --icon: #4e5058;
  --accent-soft: rgba(88, 101, 242, 0.12);
  --accent-text: #4752c4;
  --ok-text: #1a7f45;
  --link: #006ce7;
  color-scheme: light;
}

/* Onyx: near-black, like Discord's darkest theme. */
:root[data-theme="onyx"] {
  --bg-rail: #000000;
  --bg-side: #050506;
  --bg-chat: #000000;
  --bg-panel: #0d0d0f;
  --bg-deep: #121214;
  --bg-input: #121214;
  --bg-float: #0b0b0d;
  --bg-modal: #0b0b0d;
  --bg-modal-foot: #050506;
  --bg-hover: rgba(255, 255, 255, 0.05);
  --bg-active: rgba(255, 255, 255, 0.09);
  --msg-hover: rgba(255, 255, 255, 0.025);
  --border: rgba(255, 255, 255, 0.07);
  --sep: rgba(255, 255, 255, 0.07);
  --rail-item: #121214;
  --intro-icon: #1a1a1d;
  --popout: #0b0b0d;
  --popout-card: #151517;
  --popout-card-hover: #1d1d20;
  --btn-2: #2b2b30;
  --btn-2-hover: #3a3a40;
  --scroll: #1d1d21;
  --scroll-hover: #2a2a2f;
  --shadow: rgba(0, 0, 0, 0.7);
}

/* Theme picker cards (Settings → Appearance) */
.theme-picks { display: flex; gap: 12px; }
.theme-pick {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: none;
  color: var(--text);
  font: 600 14px var(--font);
  cursor: pointer;
}
.theme-pick:hover { background: var(--bg-hover); }
.theme-pick.on { border-color: var(--accent); }
.theme-swatch { width: 100%; height: 64px; border-radius: 8px; display: flex; overflow: hidden; box-shadow: 0 0 0 1px var(--border); }
.theme-swatch i { display: block; }
.theme-swatch i:nth-child(1) { width: 18%; }
.theme-swatch i:nth-child(2) { width: 27%; }
.theme-swatch i:nth-child(3) { flex: 1; }
.theme-swatch.dark i:nth-child(1) { background: #1e1f22; }
.theme-swatch.dark i:nth-child(2) { background: #2b2d31; }
.theme-swatch.dark i:nth-child(3) { background: #313338; }
.theme-swatch.onyx i:nth-child(1) { background: #000000; }
.theme-swatch.onyx i:nth-child(2) { background: #050506; }
.theme-swatch.onyx i:nth-child(3) { background: #0d0d0f; }
.theme-swatch.light i:nth-child(1) { background: #e3e5e8; }
.theme-swatch.light i:nth-child(2) { background: #f2f3f5; }
.theme-swatch.light i:nth-child(3) { background: #ffffff; }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg-rail);
  color: var(--text);
  font: 14px/1.375 var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
/* Reset the browser's default button padding (1px 6px) so icons inside fixed-size
   buttons are perfectly centered. Components set their own padding where needed. */
button { font: inherit; color: inherit; padding: 0; }
button:focus-visible, [role="button"]:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
.hidden { display: none !important; }
.ico { flex-shrink: 0; display: block; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 4px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--scroll-hover); }

/* ------------------------------------------------------------ desktop title bar */

.titlebar {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg-rail);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  -webkit-app-region: drag;
  user-select: none;
}
.tb-logo { color: var(--brand); display: flex; }
.desktop .app { height: calc(100vh - 30px); }
.has-banner .app { height: calc(100vh - 36px); }
.desktop .has-banner .app { height: calc(100vh - 66px); }
.update-bar {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 40px;
  background: var(--green);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.ub-btn {
  height: 24px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 4px;
  background: none;
  color: #fff;
  font: 600 13px var(--font);
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  text-decoration: none;
}
.ub-btn:hover { background: #fff; color: var(--green); text-decoration: none; }
.ub-btn:disabled { opacity: 0.7; cursor: default; }
.ub-close { position: absolute; right: 10px; border: 0; background: none; color: #fff; display: flex; cursor: pointer; opacity: 0.85; }
.ub-close:hover { opacity: 1; }

/* ------------------------------------------------------------ layout */

.app {
  display: grid;
  grid-template-columns: 72px 240px minmax(0, 1fr) 240px;
  height: 100vh;
  height: 100dvh;
}
.app.hide-members { grid-template-columns: 72px 240px minmax(0, 1fr); }
.app.hide-members .members { display: none; }

/* ------------------------------------------------------------ server rail */

.rail {
  background: var(--bg-rail);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail-row { position: relative; width: 72px; display: flex; justify-content: center; flex-shrink: 0; }
.rail-pill {
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 0;
  border-radius: 0 4px 4px 0;
  background: var(--strong);
  transform: translateY(-50%);
  transition: height 0.15s ease;
}
.rail-pill.unread { height: 8px; }
.rail-row:hover .rail-pill:not(.active) { height: 20px; }
.rail-pill.active { height: 40px; }
.rail-tip { display: none; }

.rail-item {
  position: relative;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--rail-item);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: border-radius 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.rail-item:hover, .rail-item.active { border-radius: 16px; background: var(--c, var(--accent)); color: #fff; }
.rail-item.home { color: var(--text); }
.rail-item.home:hover, .rail-item.home.active { background: var(--brand); color: #fff; }
.rail-item.home .logo-hole { fill: var(--rail-item); }
.rail-item.home:hover .logo-hole, .rail-item.home.active .logo-hole { fill: var(--brand); }
.rail-item.action { color: var(--green); }
.rail-item.action:hover { background: var(--green); color: #fff; }
.rail-initials { pointer-events: none; }
.rail-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  border: 3px solid var(--bg-rail);
}
.rail-sep { width: 32px; height: 2px; border-radius: 1px; background: var(--sep); flex-shrink: 0; }

.tooltip {
  position: fixed;
  z-index: 300;
  background: var(--bg-float);
  color: var(--strong);
  font-size: 15px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 6px;
  box-shadow: 0 8px 16px var(--shadow);
  pointer-events: none;
  white-space: nowrap;
  transform: translateY(-50%);
  animation: pop 0.1s ease;
}
.tooltip::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 50%;
  border: 5px solid transparent;
  border-left: 0;
  border-right-color: var(--bg-float);
  transform: translateY(-50%);
}

/* ------------------------------------------------------------ sidebar */

.sidebar {
  background: var(--bg-side);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-top-left-radius: 8px;
}
.side-top {
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-bottom: 1px solid var(--border);
}
.side-top.flush { padding: 0; }
.side-search {
  width: 100%;
  height: 28px;
  border: 0;
  border-radius: 6px;
  padding: 0 8px;
  background: var(--bg-input);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
}
.side-search::placeholder { color: var(--muted); text-align: center; }
.side-search:focus::placeholder { text-align: left; }
.server-header {
  width: 100%;
  height: 100%;
  border: 0;
  background: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  color: var(--strong);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border-top-left-radius: 8px;
}
.server-header:hover { background: var(--bg-hover); }
.server-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-scroll { flex: 1; overflow-y: auto; padding: 8px 8px 16px; min-height: 0; }
.side-empty { color: var(--faint); font-size: 13px; padding: 12px 8px; }

.home-nav { padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.home-link {
  width: 100%;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  margin: 2px 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}
.home-link:hover { background: var(--bg-hover); color: var(--text); }
.home-link.active { background: var(--bg-active); color: var(--strong); }

.cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px 4px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  user-select: none;
}
.cat:hover { color: var(--text); }
.cat-add { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px; display: flex; border-radius: 4px; }
.cat-add:hover { color: var(--strong); }

.dm-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 8px;
  margin: 1px 0;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
}
.dm-item:hover { background: var(--bg-hover); color: var(--text); }
.dm-item.active { background: var(--bg-active); color: var(--strong); }
.dm-item.unread .dm-name { color: var(--strong); font-weight: 600; }
.dm-text { flex: 1; min-width: 0; }
.dm-name { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.in-call { color: var(--green); display: inline-flex; align-items: center; gap: 3px; }
.dm-close { opacity: 0; border: 0; background: none; color: var(--muted); padding: 2px; border-radius: 4px; cursor: pointer; display: flex; }
.dm-item:hover .dm-close { opacity: 1; }
.dm-close:hover { color: var(--strong); }

.ch-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 8px;
  margin: 1px 0;
  border-radius: 6px;
  color: var(--faint);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
.ch-ico { color: var(--faint); }
.ch-item:hover { background: var(--bg-hover); color: var(--text); }
.ch-item.active { background: var(--bg-active); color: var(--strong); }
.ch-item.unread { color: var(--strong); font-weight: 600; }
.ch-item.connected { color: var(--strong); }
.ch-item.connected .ch-ico { color: var(--green); }
.ch-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-unread-pill { position: absolute; left: -8px; width: 4px; height: 8px; border-radius: 0 4px 4px 0; background: var(--strong); }
.ch-tools { display: none; gap: 2px; }
.ch-item:hover .ch-tools, .ch-item.active .ch-tools { display: flex; }
.ch-item:hover .ch-count { display: none; }
.ch-count { font-size: 11px; font-weight: 600; color: var(--muted); background: var(--chip); padding: 1px 6px; border-radius: 8px; }

.voice-users { padding: 0 0 4px 28px; }
.voice-user {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 8px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
}
.voice-user:hover { background: var(--bg-hover); color: var(--text); }
.voice-user.speaking .vu-name { color: var(--strong); }
.vu-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vu-icons { color: var(--muted); display: flex; gap: 2px; }

/* voice connected + user panels */

.voice-panel { background: var(--bg-panel); border-bottom: 1px solid var(--border); padding: 8px; flex-shrink: 0; }
.vp-row { display: flex; align-items: center; gap: 4px; }
.vp-info { flex: 1; min-width: 0; padding-left: 4px; }
.vp-status { display: flex; align-items: center; gap: 6px; color: var(--green); font-weight: 600; font-size: 14px; }
.vp-status.connecting { color: var(--yellow); }
.vp-where {
  display: block;
  max-width: 100%;
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vp-where:hover { color: var(--text); text-decoration: underline; }
.icon-btn.vp-leave:hover { color: var(--red); }

.user-panel {
  height: 54px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 8px;
  background: var(--bg-panel);
}
.up-me {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 2px;
  border: 0;
  border-radius: 6px;
  background: none;
  text-align: left;
  cursor: pointer;
}
.up-me:hover { background: var(--bg-hover); }
.up-text { min-width: 0; }
.up-name { color: var(--strong); font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-status { color: var(--muted); font-size: 12px; white-space: nowrap; }

.icon-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--icon);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--strong); }
.icon-btn.danger { color: var(--red); }
.icon-btn.active { color: var(--strong); }
.icon-btn.tiny { width: 20px; height: 20px; border-radius: 4px; color: var(--muted); }
.icon-btn.tiny:hover { background: none; color: var(--strong); }
.icon-btn.danger-hover:hover { color: var(--red); }
.mobile-only { display: none; }

/* avatars */

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  user-select: none;
  transition: box-shadow 0.1s ease;
}
.avatar.xs { width: 24px; height: 24px; font-size: 10px; }
/* Default picture: the logo, sized to the avatar. */
.avatar .av-logo { width: 62%; height: 62%; display: block; pointer-events: none; }
.avatar.sm, .avatar.md { width: 32px; height: 32px; }
.avatar.xl { width: 80px; height: 80px; font-size: 28px; }
.avatar.xxl { width: 80px; height: 80px; font-size: 28px; }
.avatar.ring.speaking { box-shadow: 0 0 0 2px var(--bg-side), 0 0 0 4px var(--green); }
.avatar.xl.ring.speaking { box-shadow: 0 0 0 3px #000, 0 0 0 6px var(--green); }
.avatar-wrap { position: relative; flex-shrink: 0; }
.status-dot {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 4px solid var(--bg-panel);
  background: var(--green);
}
.members .status-dot { border-color: var(--bg-side); }
.status-dot.idle { background: var(--yellow); }

/* ------------------------------------------------------------ main / chat */

.main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg-chat);
}
.chat-header {
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 16px;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.hd-dyn { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; gap: 8px; }
.hd-search { flex-shrink: 0; display: flex; margin-left: 4px; }
.hd-search input {
  width: 150px;
  height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: var(--bg-deep);
  color: var(--text);
  font: 13px var(--font);
  outline: none;
  transition: width 0.2s ease;
}
.hd-search input:focus, .hd-search input:not(:placeholder-shown) { width: 230px; }
.hd-search input::placeholder { color: var(--muted); }
.hd-hash { color: var(--faint); }
.hd-title {
  color: var(--strong);
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 0;
  background: none;
  padding: 2px 4px;
  border-radius: 4px;
}
.hd-title.editable { cursor: text; }
.hd-title.editable:hover { background: var(--bg-input); }
.hd-divider { width: 1px; height: 24px; background: var(--border); margin: 0 4px; flex-shrink: 0; }
.e2e { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.e2e .ico { color: var(--green); }
.hd-spacer { flex: 1; }

.chat-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}
.messages > * { flex-shrink: 0; }
.messages > :first-child { margin-top: auto; }
.msg-spacer { height: 24px; }

.msg { position: relative; padding: 2px 56px 2px 72px; min-height: 22px; }
.msg.first { margin-top: 17px; }
.msg:hover { background: var(--msg-hover); }
.msg-avatar { position: absolute; left: 16px; top: 4px; width: 40px; height: 40px; font-size: 15px; cursor: default; }
.msg-head { display: flex; align-items: baseline; gap: 8px; line-height: 22px; min-width: 0; }
.msg-author { color: var(--strong); font-size: 15px; font-weight: 600; }
.msg-time { color: var(--faint); font-size: 12px; font-weight: 500; white-space: nowrap; }
.msg-text { color: var(--text); font-size: 15px; line-height: 1.375; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
.msg-gutter-time {
  position: absolute;
  left: 0;
  width: 72px;
  top: 4px;
  text-align: center;
  font-size: 11px;
  color: var(--faint);
  opacity: 0;
}
.msg:hover .msg-gutter-time { opacity: 1; }
.msg-actions {
  position: absolute;
  right: 16px;
  top: -14px;
  display: none;
  background: var(--bg-side);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.msg:hover .msg-actions { display: flex; }

.day-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 24px 16px 8px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
}
.day-divider::before, .day-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.attach-img-wrap {
  display: block;
  margin-top: 6px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  max-width: min(400px, 100%);
  background: var(--chip);
  cursor: zoom-in;
}
.attach-img { display: block; max-width: 100%; height: auto; max-height: 350px; min-height: 40px; min-width: 40px; }
.attach-error { margin-top: 6px; color: var(--muted); font-size: 13px; font-style: italic; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 8px; background: var(--chip); }
.attach-file {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  max-width: 432px;
  padding: 12px;
  background: var(--bg-side);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.af-ico { color: var(--accent); }
.af-info { flex: 1; min-width: 0; }
.af-name {
  display: block;
  max-width: 100%;
  border: 0;
  background: none;
  padding: 0;
  color: var(--link);
  font-size: 15px;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.af-name:hover { text-decoration: underline; }
.af-size { color: var(--faint); font-size: 12px; }

.intro { padding: 16px 16px 4px; }
.intro-icon { width: 68px; height: 68px; border-radius: 50%; background: var(--intro-icon); color: var(--strong); display: grid; place-items: center; }
.intro h1 { color: var(--strong); font-size: 30px; font-weight: 700; margin: 8px 0 4px; line-height: 1.2; }
.intro p { color: var(--muted); font-size: 15px; margin: 0; }
.intro-e2e {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(35, 165, 90, 0.1);
  border: 1px solid rgba(35, 165, 90, 0.25);
  color: var(--ok-text);
  font-size: 13px;
  max-width: 640px;
}
.intro-e2e .ico { color: var(--green); }

.msg-status { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); padding: 32px 16px; text-align: center; }
.msg-status.small { padding: 12px; font-size: 13px; margin-bottom: auto; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--bg-active); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }

.composer-wrap { padding: 0 16px; flex-shrink: 0; }
.composer {
  display: flex;
  align-items: flex-start;
  background: var(--bg-input);
  border-radius: 8px;
  padding-right: 16px;
  min-height: 44px;
}
.attach-btn {
  width: 24px;
  height: 24px;
  margin: 10px 16px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: var(--icon);
  color: var(--bg-input);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.attach-btn:hover { background: var(--strong); }
.attach-btn .ico { stroke-width: 3; }
#input {
  flex: 1;
  min-width: 0;
  max-height: 300px;
  padding: 11px 0;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--text);
  font: 15px/22px var(--font);
}
#input::placeholder { color: var(--faint); }
.composer-tools { display: flex; align-items: center; height: 44px; gap: 4px; margin-left: 8px; }
.composer-tool { border: 0; background: none; color: var(--icon); padding: 4px; border-radius: 4px; cursor: pointer; display: grid; place-items: center; transition: transform 0.1s ease, color 0.1s ease; }
.composer-tool:hover { color: var(--strong); transform: scale(1.12); }

.msg-text.jumbo { font-size: 44px; line-height: 1.2; }

.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.react-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--chip);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}
.react-chip:hover { border-color: var(--chip-border); background: var(--chip-hover); }
.react-chip.mine { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.react-chip .re { font-size: 16px; line-height: 1; }
.react-chip .rc { font-weight: 600; font-size: 13px; }
.react-chip.add { opacity: 0; padding: 0 6px; }
.msg:hover .react-chip.add { opacity: 1; }

.emoji-pop {
  position: fixed;
  z-index: 190; /* above profile popouts (170) */
  width: 352px;
  padding: 10px;
  border-radius: 10px;
  background: var(--bg-float);
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px var(--shadow);
  animation: pop 0.1s ease;
}
.emoji-head { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; padding: 2px 4px 8px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-btn { height: 40px; border: 0; border-radius: 6px; background: none; font-size: 24px; cursor: pointer; line-height: 1; }
.emoji-btn:hover { background: var(--bg-hover); }

.search-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 16px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-side);
  border: 1px solid var(--border);
  color: var(--strong);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: auto;
}
.search-banner .ico { color: var(--green); }
.search-banner small { color: var(--muted); font-weight: 400; flex: 1; }
.btn.small { height: 28px; padding: 0 8px; font-size: 13px; }

.typing { height: 24px; display: flex; align-items: center; gap: 6px; padding-left: 4px; color: var(--text); font-size: 13px; white-space: nowrap; overflow: hidden; }
.typing strong { font-weight: 700; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--text); animation: blink 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }

.drop-hint { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(0, 0, 0, 0.6); pointer-events: none; }
.drop-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 40px; border-radius: 12px; background: var(--accent); color: #fff; box-shadow: 0 0 0 8px rgba(91, 102, 245, 0.3); }
.drop-card strong { font-size: 20px; }

.empty-main { margin: auto; padding: 32px 16px; max-width: 480px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.empty-logo { color: var(--brand); }
.empty-logo .logo-hole, .welcome-logo .logo-hole { fill: var(--bg-chat); }
.empty-main h1 { color: var(--strong); font-size: 24px; margin: 16px 0 8px; }
.empty-main p { color: var(--muted); font-size: 15px; margin: 0 0 24px; }
.empty-actions { display: flex; flex-direction: column; gap: 8px; width: 260px; }

/* ------------------------------------------------------------ group call */

.call {
  flex-shrink: 0;
  background: #000;
  padding: 24px 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--border);
}
.call-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; max-height: 260px; overflow-y: auto; padding: 6px; }
.call-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 96px; }
.call-name { color: var(--text); font-size: 13px; max-width: 96px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call-muted { position: absolute; top: 56px; right: 4px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #fff; border: 3px solid #000; }
.call-controls { display: flex; gap: 12px; }
.call-btn { width: 52px; height: 52px; border: 0; border-radius: 50%; background: #2a2b38; color: #fff; display: grid; place-items: center; cursor: pointer; }
.call-btn:hover { background: #393a4a; }
.call-btn.off { background: #fff; color: #111; }
.call-btn.hangup { background: var(--red); }
.call-btn.hangup:hover { background: #d8353a; }
.call-btn.join { width: auto; padding: 0 22px; border-radius: 26px; background: var(--green); display: flex; gap: 8px; font-weight: 600; font-size: 15px; }
.call-btn.join:hover { background: #1f9150; }
.call-e2e { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 4px; }
.call-e2e .ico { color: var(--green); }

/* ------------------------------------------------------------ members */

.members { background: var(--bg-side); overflow-y: auto; padding: 0 8px 20px; min-height: 0; }
.mem-cat { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; padding: 24px 8px 4px; }
.mem { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 8px; margin: 1px 0; border-radius: 6px; cursor: default; }
.mem:hover { background: var(--bg-hover); }
.mem.off { opacity: 0.4; }
.mem.off:hover { opacity: 1; }
.mem-text { min-width: 0; flex: 1; }
.mem-name { color: var(--text); font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; }
.mem-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.you-tag { margin-left: 6px; padding: 0 4px; border-radius: 4px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; }

/* ------------------------------------------------------------ buttons, inputs */

.btn {
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.primary.ok { background: var(--green); }
.btn.secondary { background: var(--btn-2); color: #fff; }
.btn.secondary:hover { background: var(--btn-2-hover); }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger:hover { background: #d8353a; }
.btn.link { background: none; color: var(--strong); }
.btn.link:hover { text-decoration: underline; }
.btn.danger-link { background: none; color: var(--red); margin-right: auto; padding-left: 0; }
.btn.danger-link:hover { text-decoration: underline; }
.btn.wide { width: 100%; }

.input {
  width: 100%;
  height: 40px;
  padding: 10px;
  border: 0;
  border-radius: 6px;
  background: var(--bg-deep);
  color: var(--text);
  font: 15px var(--font);
  outline: none;
}
.input:focus { box-shadow: 0 0 0 2px rgba(91, 102, 245, 0.5); }
select.input { padding: 0 10px; cursor: pointer; }
.field-label { display: block; margin: 18px 0 8px; color: var(--icon); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.field-label:first-child { margin-top: 0; }
.req { color: var(--red); margin-left: 3px; }
.field-hint { margin-top: 8px; color: var(--muted); font-size: 12px; }
.field-hint code { background: var(--bg-deep); padding: 1px 4px; border-radius: 4px; font-size: 11px; word-break: break-all; }
.field-error { color: var(--red); font-size: 12px; margin-top: 6px; min-height: 0; }
.field-error:empty { display: none; }

/* ------------------------------------------------------------ modals */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.72);
  display: grid;
  place-items: center;
  padding: 16px;
  animation: fade 0.12s ease;
}
.overlay.out { opacity: 0; transition: opacity 0.12s ease; }
.modal {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--bg-modal);
  border-radius: 10px;
  padding: 24px 16px 0;
  box-shadow: 0 16px 48px var(--shadow);
  animation: pop 0.15s ease;
}
.modal-x { position: absolute; top: 12px; right: 12px; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 4px; display: flex; }
.modal-x:hover { color: var(--strong); }
.modal-title { color: var(--strong); text-align: center; font-size: 22px; font-weight: 700; margin: 0 24px 8px; }
.modal-sub { color: var(--muted); text-align: center; font-size: 15px; margin: 0 8px 4px; }
.modal-body { padding: 16px 0; }
.modal-text { color: var(--text); font-size: 15px; margin: 0; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin: 0 -16px;
  padding: 16px;
  background: var(--bg-modal-foot);
  border-radius: 0 0 10px 10px;
}

.add-modal .modal-body { padding-bottom: 0; }
.add-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding: 10px 16px 10px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: none;
  color: var(--strong);
  text-align: left;
  cursor: pointer;
}
.add-option:hover { background: var(--bg-hover); }
.ao-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.ao-text { flex: 1; display: flex; flex-direction: column; }
.ao-text strong { font-size: 15px; }
.ao-text small { color: var(--muted); font-size: 12px; }
.ao-chev { transform: rotate(-90deg); color: var(--muted); }
.add-footer { margin: 16px -16px 0; padding: 16px; background: var(--bg-modal-foot); text-align: center; border-radius: 0 0 10px 10px; }
.add-footer h3 { color: var(--strong); font-size: 18px; font-weight: 600; margin: 0 0 10px; }

.copy-row { display: flex; align-items: center; gap: 4px; padding: 4px; background: var(--bg-deep); border-radius: 6px; }
.copy-row .input { background: transparent; height: 32px; padding: 0 6px; font-size: 14px; }
.copy-row .input:focus { box-shadow: none; }
.copy-btn { height: 32px; min-width: 75px; }
.invite-warn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}
.invite-warn .ico { margin-top: 1px; color: var(--accent-text); }
.invite-warn.yellow { background: rgba(240, 178, 50, 0.12); }
.invite-warn.yellow .ico { color: var(--yellow); }

.ch-types { display: flex; flex-direction: column; gap: 8px; }
.ch-type {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  background: var(--bg-deep);
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}
.ch-type > span:not(.radio) { flex: 1; display: flex; flex-direction: column; }
.ch-type strong { color: var(--text); font-size: 15px; }
.ch-type small { font-size: 12px; }
.ch-type:hover, .ch-type.on { background: var(--bg-active); }
.radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--muted); flex-shrink: 0; }
.ch-type.on .radio { border-color: var(--strong); box-shadow: inset 0 0 0 3px var(--bg-active), inset 0 0 0 10px var(--strong); }

.lightbox { background: transparent; box-shadow: none; padding: 0; width: auto; max-width: 92vw; overflow: visible; }
.lightbox .modal-x { display: none; }
.lightbox .modal-body { padding: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.lightbox img { display: block; max-width: 92vw; max-height: 82vh; border-radius: 6px; }
.lightbox-open { border: 0; background: none; color: var(--muted); padding: 0; font-size: 14px; cursor: pointer; }
.lightbox-open:hover { color: var(--strong); text-decoration: underline; }

.profile-card { border-radius: 8px; overflow: hidden; background: var(--bg-deep); margin-bottom: 4px; }
.profile-banner { height: 64px; }
.profile-row { display: flex; align-items: flex-end; gap: 12px; padding: 0 16px 14px; margin-top: -40px; }
.profile-row .avatar { box-shadow: 0 0 0 6px var(--bg-deep); }
.profile-name { color: var(--strong); font-size: 20px; font-weight: 700; padding-bottom: 6px; }
.settings-h { color: var(--icon); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; margin: 24px 0 12px; padding-top: 18px; border-top: 1px solid var(--border); }

.toggle-row { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-row > span:last-child { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.toggle-row strong { color: var(--strong); font-size: 15px; font-weight: 600; }
.toggle-row small { color: var(--muted); font-size: 13px; }
.toggle-ui { position: relative; width: 40px; height: 24px; border-radius: 12px; background: var(--toggle-off); flex-shrink: 0; transition: background-color 0.15s ease; margin-top: 2px; }
.toggle-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.15s ease; }
.toggle-row input:checked + .toggle-ui { background: var(--green); }
.toggle-row input:checked + .toggle-ui::after { transform: translateX(16px); }
.toggle-row input:focus-visible + .toggle-ui { outline: 2px solid var(--accent); outline-offset: 2px; }
.host-status { margin: 10px 0 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.host-status.ok { color: var(--ok-text); }
.host-status.bad { color: var(--red); }

.welcome-modal .modal-body { text-align: left; }
.welcome-logo { color: var(--brand); display: flex; justify-content: center; margin-bottom: 16px; }

/* ------------------------------------------------------------ popover, toasts */

.popover {
  position: fixed;
  z-index: 190; /* above profile popouts (170), below toasts */
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--bg-float);
  box-shadow: 0 0 0 1px var(--border), 0 8px 24px var(--shadow);
  animation: pop 0.1s ease;
}
.pop-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  margin: 2px 0;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--icon);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.pop-item:hover { background: var(--accent); color: #fff; }
.pop-item.accent { color: var(--accent-text); }
.pop-item.accent:hover { color: #fff; }
.pop-item.danger { color: var(--red); }
.pop-item.danger:hover { background: var(--red); color: #fff; }
.pop-sep { height: 1px; margin: 4px; background: var(--border); }

.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 250; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  max-width: min(480px, calc(100vw - 32px));
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--bg-float);
  color: var(--strong);
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: rise 0.15s ease;
}
.toast.out { opacity: 0; transition: opacity 0.2s ease; }

.insecure { height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.insecure h1 { color: var(--strong); }
.insecure p { color: var(--muted); max-width: 520px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); } 40% { opacity: 1; transform: scale(1); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0.96); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------------ status dots */

.sdot {
  position: relative;
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--green);
}
.sdot.idle { background: var(--yellow); }
.sdot.idle::after { content: ""; position: absolute; width: 6px; height: 6px; border-radius: 50%; top: -1px; left: -1px; background: var(--dot-cut, var(--bg-float)); }
.sdot.dnd { background: var(--red); }
.sdot.dnd::after { content: ""; position: absolute; left: 2px; right: 2px; top: 4px; height: 2px; border-radius: 1px; background: var(--dot-cut, var(--bg-float)); }
.sdot.offline { background: transparent; box-shadow: inset 0 0 0 2.5px #80848e; }
.sdot.on-panel, .sdot.on-list, .sdot.on-popout {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 16px;
  height: 16px;
  border: 3px solid var(--bg-panel);
  box-sizing: border-box;
}
.sdot.on-panel { --dot-cut: var(--bg-panel); }
.sdot.on-list { border-color: var(--bg-side); --dot-cut: var(--bg-side); }
.sdot.on-panel.idle::after, .sdot.on-list.idle::after { width: 6px; height: 6px; top: -1px; left: -1px; }
.sdot.on-panel.dnd::after, .sdot.on-list.dnd::after { left: 1px; right: 1px; top: 4px; }
.sdot.on-panel.offline, .sdot.on-list.offline { background: var(--bg-panel); box-shadow: inset 0 0 0 2.5px #80848e; }
.sdot.on-list.offline { background: var(--bg-side); }
.sdot.on-popout {
  right: 2px;
  bottom: 2px;
  width: 24px;
  height: 24px;
  border-width: 5px;
  border-color: var(--popout);
  --dot-cut: var(--popout);
}
.sdot.on-popout.idle::after { width: 9px; height: 9px; top: -2px; left: -2px; }
.sdot.on-popout.dnd::after { left: 2px; right: 2px; top: 6px; height: 2px; }
.sdot.on-popout.offline { background: var(--popout); box-shadow: inset 0 0 0 3.5px #80848e; }
.sdot.po-ico { width: 12px; height: 12px; margin: 0 3px; --dot-cut: var(--popout-card); }
.sdot.po-ico.idle::after { width: 7px; height: 7px; }
.sdot.po-ico.dnd::after { top: 5px; }
.po-fly-item .sdot.po-ico { --dot-cut: var(--popout-card); }
.po-fly-item:hover .sdot.po-ico { --dot-cut: var(--accent); }

.up-status.warn { color: var(--yellow); }

/* ------------------------------------------------------------ avatars with pictures */

.avatar.has-img { background: var(--rail-item); overflow: hidden; }
.avatar.has-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatar.clickable, .msg-avatar { cursor: pointer; }
.msg-author { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: var(--strong); font-size: 15px; font-weight: 600; }
.msg-author:hover { text-decoration: underline; }
.unverified { color: var(--yellow); font-size: 11px; font-weight: 700; background: rgba(240, 178, 50, 0.12); border-radius: 4px; padding: 0 5px; cursor: help; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 18px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--chip);
  border: 1px solid var(--chip-border);
  color: var(--strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1;
  vertical-align: middle;
}
.tag-emoji { font-size: 11px; }
.mem-name { gap: 6px; }
.mem-name-text { overflow: hidden; text-overflow: ellipsis; }
.mem { cursor: pointer; }

/* ------------------------------------------------------------ profile popout */

.popout {
  position: fixed;
  z-index: 170;
  width: 300px;
  background: var(--popout);
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--border), 0 16px 40px var(--shadow);
  padding-bottom: 12px;
  animation: pop 0.12s ease;
}
.popout.preview { position: relative; z-index: auto; animation: none; box-shadow: 0 0 0 1px var(--border); }
.po-banner { height: 105px; border-radius: 10px 10px 0 0; opacity: 0.95; }
.po-top { position: relative; height: 52px; padding: 0 16px; }
.po-avatar-wrap { position: absolute; left: 16px; top: -46px; border-radius: 50%; padding: 6px; background: var(--popout); }
.po-avatar { width: 80px; height: 80px; font-size: 28px; }
.po-bubble-wrap { position: absolute; left: 112px; right: 16px; top: -24px; }
.pb-dot1, .pb-dot2 { position: absolute; border-radius: 50%; background: var(--popout-card); }
.pb-dot1 { width: 8px; height: 8px; left: -12px; top: 8px; }
.pb-dot2 { width: 14px; height: 14px; left: -3px; top: 16px; }
.po-bubble {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content; /* hug the text: a single emoji makes a small bubble */
  max-width: 100%;
  margin-top: 12px;
  padding: 8px 12px;
  border: 0;
  border-radius: 14px;
  background: var(--popout-card);
  color: var(--text);
  font: 14px var(--font);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 2px 8px var(--shadow);
}
.po-bubble:hover { background: var(--popout-card-hover); }
.po-bubble.static { cursor: default; }
.pb-plus { color: var(--icon); }
.pb-ph { color: var(--muted); font-style: italic; }
.pb-emoji { font-size: 18px; line-height: 1; }
.pb-text { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.po-id { padding: 0 16px; }
.po-name { color: var(--strong); font-size: 20px; font-weight: 700; line-height: 1.25; word-break: break-word; }
/* One line: username • pronouns, server tag, badges. Badges collapse into "+N" first. */
.po-sub { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; margin-top: 2px; color: var(--text); font-size: 14px; min-width: 0; }
.po-sub > * { flex-shrink: 0; white-space: nowrap; }
.po-sub.po-sub-tight > span:not(.po-dot):not(.tag-chip) { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.po-dot { color: var(--muted); }
.uname.bad { color: var(--red); text-decoration: line-through; cursor: help; }
.po-bio { padding: 10px 16px 0; color: var(--text); font-size: 14px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.po-menu {
  margin: 12px 12px 0;
  padding: 4px;
  border-radius: 8px;
  background: var(--popout-card);
}
.po-menu + .po-menu { margin-top: 8px; }
.po-row {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font: 500 14px var(--font);
  text-align: left;
  cursor: pointer;
}
.po-row:hover, .po-fly-wrap:hover > .po-row { background: var(--bg-hover); color: var(--strong); }
.po-ico { color: var(--icon); }
.po-row-label { flex: 1; }
.po-chev { color: var(--muted); }
.po-sep { height: 1px; margin: 2px 10px; background: var(--sep); }
.po-fly-wrap { position: relative; }
.po-flyout { position: fixed; padding-left: 14px; z-index: 175; animation: pop 0.08s ease; }
.po-flyout.flip { padding-left: 0; padding-right: 14px; }
.po-fly-inner {
  width: 250px;
  padding: 6px;
  border-radius: 8px;
  background: var(--popout-card);
  box-shadow: 0 0 0 1px var(--border), 0 12px 32px var(--shadow);
}
.po-fly-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--text);
  font: 500 14px var(--font);
  text-align: left;
  cursor: pointer;
}
.po-fly-item:hover { background: var(--accent); color: #fff; }
.po-fly-item:hover small { color: rgba(255, 255, 255, 0.85); }
.po-fly-item.danger { color: var(--red); }
.po-fly-item.danger:hover { background: var(--red); color: #fff; }
.po-fly-item.danger .po-ico { color: inherit; }
.pfi-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pfi-text small { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.3; }
.pfi-check { color: var(--green); }
.po-fly-sep { height: 1px; margin: 4px 6px; background: var(--sep); }

/* ------------------------------------------------------------ edit profile, custom status, settings */

.profile-modal { width: min(760px, 100%); }
.pe-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.pe-preview { position: sticky; top: 0; }
.pe-btns { display: flex; align-items: center; gap: 8px; }
.textarea { height: auto; min-height: 90px; resize: vertical; line-height: 1.4; font-size: 14px; }
.char-count { float: right; color: var(--muted); font-weight: 600; text-transform: none; }
.color-input { width: 64px; height: 36px; padding: 2px; border: 0; border-radius: 6px; background: var(--bg-deep); cursor: pointer; }
.input[readonly] { color: var(--muted); cursor: default; }
@media (max-width: 720px) { .pe-grid { grid-template-columns: 1fr; } }

.cs-row { display: flex; align-items: center; gap: 8px; padding: 4px; background: var(--bg-deep); border-radius: 6px; }
.cs-row .input { background: transparent; }
.cs-row .input:focus { box-shadow: none; }
.cs-emoji { width: 40px; height: 40px; border: 0; border-radius: 6px; background: none; color: var(--icon); font-size: 22px; cursor: pointer; display: grid; place-items: center; flex-shrink: 0; }
.cs-emoji:hover { background: var(--bg-hover); }

.acct-card { border-radius: 8px; overflow: hidden; background: var(--bg-deep); }
.acct-banner { height: 70px; }
.acct-row { display: flex; align-items: flex-end; gap: 12px; padding: 0 16px 14px; margin-top: -36px; }
.acct-row .avatar { box-shadow: 0 0 0 6px var(--bg-deep); }
.acct-text { flex: 1; min-width: 0; padding-bottom: 4px; }
.acct-name { color: var(--strong); font-size: 18px; font-weight: 700; }
.acct-user { color: var(--muted); font-size: 13px; }
.acct-user::before { content: "@"; }
.acct-user:empty::before { content: ""; }

.tag-row { display: flex; gap: 8px; align-items: center; }
.tag-row .tag-input { width: 110px; text-transform: uppercase; font-weight: 700; letter-spacing: 0.06em; }
.tag-emoji-btn { width: 44px; padding: 0; font-size: 18px; display: grid; place-items: center; }
.tag-preview-box { margin-top: 12px; padding: 12px; border-radius: 8px; background: var(--bg-deep); display: flex; flex-direction: column; gap: 6px; }
.tag-preview { display: flex; align-items: center; gap: 8px; }

/* ------------------------------------------------------------ sign up / log in */

.auth {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 24px 16px;
}
.desktop .auth { top: 30px; }
.has-banner .auth { top: 36px; }
.desktop .has-banner .auth { top: 66px; }
.titlebar, .update-bar { position: relative; z-index: 95; }
.auth-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--bg-rail);
}
.auth-card {
  width: min(480px, 100%);
  padding: 32px;
  border-radius: 10px;
  background: var(--bg-modal);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: rise 0.25s ease;
}
.auth-logo { color: var(--brand); display: flex; justify-content: center; margin-bottom: 8px; }
.auth-logo .logo-hole { fill: var(--bg-modal); }
.auth-card h1 { color: var(--strong); text-align: center; font-size: 24px; font-weight: 700; margin: 0 0 6px; }
.auth-sub { color: var(--muted); text-align: center; font-size: 15px; margin: 0 0 20px; }
.auth-card h1 + .auth-server, .auth-card h1 + .auth-field { margin-top: 20px; }
.auth-field { display: block; margin-bottom: 18px; }
.auth-field .field-label { margin-top: 0; }
.auth-hint { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.auth-hint.ok { color: var(--ok-text); }
.auth-hint.bad { color: var(--red); }
.at-input { display: flex; align-items: center; background: var(--bg-deep); border-radius: 6px; }
.at-input span { padding-left: 10px; color: var(--muted); font-size: 15px; }
.at-input .input { padding-left: 2px; }
.auth-error { color: var(--red); font-size: 14px; margin: -6px 0 12px; }
.auth-error:empty { display: none; }
.auth-submit { height: 44px; font-size: 16px; display: grid; place-items: center; }
.auth-foot { margin-top: 12px; color: var(--muted); font-size: 14px; }
.auth-link { border: 0; background: none; padding: 0; color: var(--link); font: inherit; font-size: 14px; cursor: pointer; }
.auth-link:hover { text-decoration: underline; }
/* Two-factor step on the login card */
.auth-2fa { text-align: center; }
.auth-2fa .auth-field { text-align: left; }
.auth-2fa-icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--accent); }
.auth-2fa .auth-sub { margin-bottom: 22px; }
.auth-2fa .auth-foot { margin-top: 14px; }
.auth-2fa > .auth-link { display: block; margin: 8px auto 0; }
.auth-code { text-align: center; font-size: 22px; letter-spacing: 6px; font-variant-numeric: tabular-nums; height: 48px; }
.auth-code.backup { font-size: 18px; letter-spacing: 2px; }

/* ---------------------------------------------------------------- log in / sign up: split layout */
.auth-bg {
  background:
    radial-gradient(800px 500px at 15% 10%, rgba(91, 102, 245, 0.22), transparent 60%),
    radial-gradient(700px 500px at 90% 100%, rgba(138, 92, 246, 0.16), transparent 60%),
    var(--bg-rail);
}
.auth-shell {
  width: min(1000px, 100%);
  min-height: min(640px, calc(100vh - 64px));
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  border-radius: 22px;
  overflow: hidden;
  background: var(--bg-modal);
  border: 1px solid var(--border);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  animation: rise 0.3s ease;
}
.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 40px 44px;
  color: #fff;
  overflow: hidden;
  background: linear-gradient(150deg, #1c0b06 0%, #7a2a12 52%, var(--brand) 100%);
}
.ab-rings {
  position: absolute; right: -180px; bottom: -180px; width: 520px; height: 520px; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.10), 0 0 0 70px rgba(255, 255, 255, 0.03), 0 0 0 71px rgba(255, 255, 255, 0.08), 0 0 0 150px rgba(255, 255, 255, 0.02), 0 0 0 151px rgba(255, 255, 255, 0.06);
}
.ab-logo { position: relative; display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; letter-spacing: -0.3px; color: #fff; }
.ab-logo svg { color: #fff; }
.ab-logo .logo-hole { fill: var(--brand-deep); }
.ab-copy { position: relative; margin-top: auto; }
.ab-copy h2 { margin: 0 0 12px; font-size: 38px; line-height: 1.05; font-weight: 900; letter-spacing: -1px; }
.ab-copy p { margin: 0; max-width: 360px; color: rgba(255, 255, 255, 0.78); font-size: 15px; line-height: 1.5; }
.ab-points { position: relative; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.ab-points li { display: flex; align-items: flex-start; gap: 12px; }
.ab-ico { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.14); color: #fff; }
.ab-points strong { display: block; font-size: 15px; }
.ab-points li span:not(.ab-ico) { display: block; color: rgba(255, 255, 255, 0.72); font-size: 13px; line-height: 1.4; }
.ab-foot { position: relative; display: flex; gap: 16px; font-size: 13px; }
.ab-foot a { color: rgba(255, 255, 255, 0.7); text-decoration: none; }
.ab-foot a:hover { color: #fff; text-decoration: underline; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 44px 48px; }
.auth-shell .auth-card {
  width: 100%; max-width: 380px; padding: 0; border-radius: 0; background: none; box-shadow: none; animation: none;
}
.auth.settled .auth-shell { animation: none; }
.auth.settled .auth-card { animation: auth-swap 0.18s ease; }
@keyframes auth-swap { from { opacity: 0; transform: translateX(8px); } }
.auth-shell .auth-logo { display: none; }
.auth-shell .auth-card h1 { text-align: left; font-size: 28px; font-weight: 800; letter-spacing: -0.5px; margin: 0 0 6px; }
.auth-shell .auth-sub { text-align: left; font-size: 14px; line-height: 1.45; margin: 0 0 26px; }
.auth-step { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; margin-bottom: 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 700; }
.auth-shell .auth-field { margin-bottom: 16px; }
.auth-shell .auth-field .field-label { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; color: var(--text); }
.auth-shell .af-ico { color: var(--muted); }
.auth-shell .req { display: none; }
.auth-shell .input { height: 46px; padding: 0 14px; border-radius: 10px; background: var(--bg-deep); border: 1px solid var(--border); font-size: 15px; }
.auth-shell .input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-shell .at-input { border-radius: 10px; border: 1px solid var(--border); }
.auth-shell .at-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-shell .at-input .input { border: 0; box-shadow: none; }
.auth-shell .auth-submit { height: 48px; margin-top: 6px; border-radius: 10px; font-size: 15px; font-weight: 700; background: linear-gradient(135deg, #6a74ff, #5560ee); box-shadow: 0 8px 20px rgba(91, 102, 245, 0.3); }
.auth-shell .auth-submit:hover:not(:disabled) { background: linear-gradient(135deg, #5d68fb, #4a55e6); }
.auth-shell .auth-foot { margin-top: 16px; text-align: left; }
.auth-shell .auth-2fa { text-align: left; }
.auth-shell .auth-2fa-icon { margin: 0 0 16px; width: 56px; height: 56px; border-radius: 16px; }
.auth-shell .auth-2fa > .auth-link { margin: 10px 0 0; }
.auth-shell .auth-server { margin-bottom: 18px; }
@media (max-width: 820px) {
  .auth-shell { grid-template-columns: 1fr; min-height: 0; border-radius: 18px; }
  .auth-brand { display: none; }
  .auth-main { padding: 32px 24px; }
  .auth-shell .auth-logo { display: flex; justify-content: flex-start; margin-bottom: 14px; }
}
.auth-code::placeholder { letter-spacing: 1px; font-size: 15px; }

/* ---------------------------------------------------------------- invite codes, closed beta, official servers */
.auth-invite { text-align: center; font-size: 20px; letter-spacing: 3px; font-variant-numeric: tabular-nums; height: 48px; text-transform: uppercase; }
.auth-invite::placeholder { letter-spacing: 2px; }
a.auth-link { text-decoration: none; }
a.auth-link:hover { text-decoration: underline; }
.join-code { font-size: 16px; letter-spacing: 1px; }
.copy-row .invite-code-box { font: 600 20px/1 ui-monospace, "Cascadia Code", Consolas, monospace; letter-spacing: 2px; color: var(--strong); height: 40px; }
.iv-code { color: var(--strong); letter-spacing: .5px; }
.iv-hidden { color: var(--faint); font-style: italic; cursor: help; }
.official-badge { display: block; flex: none; }
.sh-name .official-badge { margin-right: 2px; }
.ss-head { display: flex; align-items: center; gap: 6px; }
.ss-head span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.of-hero { display: flex; align-items: center; gap: 18px; padding: 18px; border-radius: 10px; background: var(--bg-side); margin-bottom: 20px; }
.of-hero h3 { margin: 0 0 4px; color: var(--strong); font-size: 18px; }
.of-hero p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.of-hero:not(.on) .official-badge { filter: saturate(.85); }
.of-status { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; font-size: 14px; margin-bottom: 14px; }
.of-status.ok { background: rgba(35, 165, 90, .14); color: var(--ok-text); }
.of-status.warn { background: rgba(240, 178, 50, .14); color: var(--yellow); }
.of-status.bad { background: rgba(242, 63, 67, .12); color: #ff8b8e; }
.of-status svg { flex: none; }
.of-sent { padding: 12px 14px; border-radius: 8px; background: var(--bg-deep); margin-bottom: 12px; }
.of-sent strong { color: var(--strong); }
.of-sent p { margin: 6px 0 0; color: var(--text); font-size: 14px; white-space: pre-wrap; }
.btn.of-btn { width: fit-content; align-self: flex-start; justify-self: start; margin-top: 4px; }
.of-list { margin: 0; padding-left: 20px; color: var(--text); font-size: 14px; line-height: 1.55; }
.of-list li { margin-bottom: 4px; }
.ad-pill.ok { background: rgba(35, 165, 90, 0.16); color: var(--ok-text); }
.ad-pill.warn { background: rgba(240, 178, 50, 0.16); color: var(--yellow); }
.ad-pill.bad { background: rgba(242, 63, 67, 0.16); color: var(--red); }
.ad-pill.neutral { background: var(--chip); color: var(--muted); }
.ad-chip { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); font-size: 11px; font-weight: 700; }
.ad-wl-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.ad-wl-tools .input { flex: 1; min-width: 180px; height: 34px; }
.ad-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ad-filter { height: 30px; padding: 0 12px; border: 0; border-radius: 15px; background: var(--chip); color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.ad-filter:hover { background: var(--chip-hover); color: var(--text); }
.ad-filter.on { background: var(--accent); color: #fff; }
.ad-wl-list { display: flex; flex-direction: column; }
.ad-wl-row { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 4px; border-bottom: 1px solid var(--sep); }
.ad-wl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ad-wl-main strong { color: var(--strong); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-wl-main small { color: var(--muted); font-size: 12px; }
.ad-wl-row .btn { height: 30px; padding: 0 12px; flex: none; }
.ad-codes { display: flex; flex-direction: column; margin-top: 10px; }
.ad-code-row { display: flex; align-items: center; gap: 10px; min-height: 44px; border-bottom: 1px solid var(--sep); }
.ad-code-row code { font: 600 14px ui-monospace, "Cascadia Code", Consolas, monospace; color: var(--strong); letter-spacing: 1px; flex: none; }
.ad-code-note { flex: 1; min-width: 0; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-code-row .btn { height: 28px; padding: 0 10px; flex: none; }
.ad-code-big { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 8px; background: var(--bg-deep); margin-bottom: 14px; }
.ad-code-big code { font: 700 24px ui-monospace, "Cascadia Code", Consolas, monospace; letter-spacing: 3px; color: var(--strong); }
.ad-mail-note { margin-top: 10px; font-size: 13px; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.ad-app { padding: 14px 16px; border-radius: 8px; background: var(--bg-side); margin-bottom: 10px; }
.ad-app.ok { box-shadow: inset 3px 0 0 #3b8cf5; }
.ad-app-head { display: flex; align-items: center; gap: 8px; }
.ad-app-head strong { color: var(--strong); font-size: 16px; }
.ad-app p { margin: 8px 0 0; color: var(--text); font-size: 14px; white-space: pre-wrap; }
.ad-app-meta { margin: 8px 0 10px; color: var(--muted); font-size: 12px; }

.cat.static, .cat.static span { cursor: default; }
/* Drop strip above the first category (drag a channel here to remove it from its category) */
.uncat-drop { height: 6px; margin: 0 8px; border-radius: 6px; transition: height .12s ease, background .12s ease; }
.uncat-drop span { display: none; }
.dragging-ch .uncat-drop { height: 30px; margin: 6px 8px 2px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--chip-border); color: var(--muted); font-size: 12px; font-weight: 600; }
.dragging-ch .uncat-drop span { display: inline; }
.dragging-ch .uncat-drop.drop-into { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.cs-toggle { margin-top: 20px; }
.cs-toggle.disabled { pointer-events: none; opacity: .6; }

/* ---------------------------------------------------------------- Security (2FA) */
.st-2fa-on { display: inline-flex; align-items: center; gap: 5px; color: var(--ok-text); font-weight: 600; }
.st-2fa-card { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 8px; background: var(--bg-side); margin-bottom: 12px; }
.st-2fa-card + .st-2fa-actions { margin-top: 0; }
.st-2fa-ico { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-deep); color: var(--muted); }
.st-2fa-card.on .st-2fa-ico { background: var(--green); color: #fff; }
.st-2fa-text strong { display: block; color: var(--strong); font-size: 16px; margin-bottom: 4px; }
.st-2fa-text p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.4; }
.st-2fa-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 4px; }
.st-2fa-note { margin-top: 12px; font-size: 13px; }
.btn.danger-outline { background: none; color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.btn.danger-outline:hover { background: var(--red); color: #fff; }
.modal.st-2fa-modal { width: 480px; }
.st-2fa-step { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--sep); }
.st-2fa-step:last-child { border-bottom: 0; padding-bottom: 0; }
.st-2fa-num { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.st-2fa-step-body { flex: 1; min-width: 0; }
.st-2fa-step-body > strong { display: block; color: var(--strong); font-size: 15px; line-height: 26px; }
.st-2fa-step-body > p { margin: 2px 0 10px; color: var(--muted); font-size: 14px; line-height: 1.4; }
.st-2fa-qr { display: flex; justify-content: center; margin: 4px 0 12px; }
.st-2fa-qr svg { display: block; border-radius: 8px; }
.st-2fa-key { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 6px; background: var(--bg-deep); }
.st-2fa-key code { flex: 1; min-width: 0; font-size: 13px; color: var(--strong); word-break: break-all; letter-spacing: .5px; }
.st-code-input { text-align: center; font-size: 18px; letter-spacing: 4px; font-variant-numeric: tabular-nums; }
.st-code-input::placeholder { letter-spacing: 1px; font-size: 14px; }
.st-backup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px; border-radius: 8px; background: var(--bg-deep); }
.st-backup-grid code { text-align: center; font-size: 15px; color: var(--strong); letter-spacing: 1px; padding: 4px 0; }
.auth-card > .auth-link { display: block; margin-top: 10px; }
.auth-server { margin-bottom: 18px; border-radius: 8px; background: var(--bg-deep); }
.auth-server summary { padding: 10px 12px; color: var(--icon); font-size: 13px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 6px; list-style: none; }
.auth-server summary::-webkit-details-marker { display: none; }
.auth-server-body { padding: 4px 12px 14px; }
.auth-server-body .input { background: var(--bg-modal); }
.spinner.light { border-color: rgba(255, 255, 255, 0.3); border-top-color: #fff; }

/* ------------------------------------------------------------ server header, categories, icons */

.server-header { display: flex; align-items: center; width: 100%; height: 100%; padding: 0 8px 0 0; border-top-left-radius: 8px; cursor: default; }
.server-header:hover { background: none; }
.sh-name {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px 0 16px;
  border: 0;
  background: none;
  color: var(--strong);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border-top-left-radius: 8px;
}
.sh-name:hover { background: var(--bg-hover); }
.cat { cursor: pointer; padding-top: 18px; }
.cat-label { display: flex; align-items: center; gap: 2px; }
.cat-chev { transition: transform 0.15s ease; }
.cat.collapsed .cat-chev { transform: rotate(-90deg); }
.rail-icon { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; pointer-events: none; }
.rail-item:has(.rail-icon) { overflow: hidden; background: var(--rail-item); }
.auth-server-change { margin-left: auto; color: var(--link); font-weight: 500; }
.ss-icon-row { display: flex; align-items: center; gap: 16px; margin-bottom: 4px; }

/* ------------------------------------------------------------ create-server wizard */

.wizard { width: min(460px, 100%); padding-bottom: 0; }
.wiz .modal-title { margin-top: 0; }
.wiz-list { max-height: 330px; overflow-y: auto; margin: 16px -4px 0; padding: 0 4px; }
.wiz-opt {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-side);
  color: var(--strong);
  font: 600 15px var(--font);
  text-align: left;
  cursor: pointer;
}
.wiz-opt:hover { background: var(--bg-hover); }
.wiz-emoji { width: 32px; height: 32px; display: grid; place-items: center; font-size: 24px; line-height: 1; }
.wiz-label { flex: 1; }
.wiz-chev { color: var(--muted); }
.wiz-section { margin: 14px 0 8px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.wiz-skip { text-align: center; color: var(--text); font-size: 14px; margin: 12px 0 0; }
.wiz-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 20px -16px 0;
  padding: 16px;
  background: var(--bg-modal-foot);
  border-radius: 0 0 10px 10px;
}
.wiz-foot.center { flex-direction: column; text-align: center; }
.wiz-foot.center h3 { margin: 0 0 4px; color: var(--strong); font-size: 18px; }
.wiz-upload-row { display: flex; justify-content: center; margin: 20px 0 8px; }
.wiz-upload {
  position: relative;
  width: 80px;
  height: 80px;
  border: 2px dashed var(--icon);
  border-radius: 50%;
  background: none;
  color: var(--icon);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.wiz-upload:hover { border-color: var(--strong); color: var(--strong); }
.wiz-upload.has-img { border: 0; }
.wiz-upload img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.wiz-upload.small { width: 64px; height: 64px; flex-shrink: 0; }
.wiz-up-inner { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; font-weight: 700; }
.wiz-plus { position: absolute; top: -2px; right: -2px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; }
.wiz-fine { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.wiz-fine .ico { color: var(--green); }

/* ------------------------------------------------------------ server welcome checklist */

.welcome { margin: auto; padding: 32px 16px; width: min(420px, 100%); text-align: center; align-self: center; }
.welcome h1 { color: var(--strong); font-size: 28px; font-weight: 800; line-height: 1.2; margin: 0 0 8px; }
.welcome p { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.wl-list { display: flex; flex-direction: column; gap: 8px; }
.wl-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--bg-side);
  color: var(--strong);
  font: 600 14px var(--font);
  text-align: left;
  cursor: pointer;
}
.wl-item:hover { background: var(--bg-hover); }
.wl-item.done .wl-label { color: var(--muted); }
.wl-emoji { font-size: 20px; width: 28px; text-align: center; }
.wl-label { flex: 1; }
.wl-chev { color: var(--muted); }
.wl-check { width: 22px; height: 22px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; }

/* ============================================================ v0.3: friends, settings, roles, replies, updates */

/* ---- preferences */
:root { --chat-font: 15px; }
.msg-text { font-size: var(--chat-font); }
.msg-text.jumbo { font-size: calc(var(--chat-font) * 3); }
.compact .msg { padding-top: 1px; padding-bottom: 1px; }
.compact .msg.first { margin-top: 8px; }
.compact .msg-avatar { width: 32px; height: 32px; left: 24px; font-size: 13px; }
.underline-links .msg-text a { text-decoration: underline; }
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }

/* ---- shared small pieces */
.icon-btn.tiny { width: 24px; height: 24px; padding: 0; border-radius: 4px; display: inline-grid; place-items: center; }
.ico.flip { transform: rotate(180deg); }
.mono { font-family: "Cascadia Mono", Consolas, ui-monospace, monospace; font-size: 13px; }
.danger-text { color: var(--red) !important; }
.crown { display: inline-block; flex-shrink: 0; vertical-align: -2px; margin-left: 4px; }
.badge-ico { display: inline-grid; place-items: center; border-radius: 6px; background: color-mix(in srgb, var(--bc) 22%, transparent); color: var(--bc); flex-shrink: 0; }
.role-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px;
  border-radius: 6px; background: var(--chip); border: 1px solid var(--chip-border);
  color: var(--text); font-size: 12px; font-weight: 500; white-space: nowrap; max-width: 100%;
}
.ro-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.role-x, .role-add {
  width: 16px; height: 16px; border: 0; border-radius: 50%; display: inline-grid; place-items: center;
  background: none; color: var(--muted); cursor: pointer;
}
.role-x:hover { background: var(--red); color: #fff; }
.role-add { width: 24px; height: 24px; border-radius: 6px; background: var(--chip); border: 1px solid var(--chip-border); }
.role-add:hover { color: var(--strong); background: var(--chip-hover); }
.invite-warn.yellow .ico { color: var(--yellow); }

/* ---- rail & home nav counters */
.rail-badge.count {
  width: auto; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--red); font-size: 11px; font-weight: 700; line-height: 1;
}
.nav-count {
  margin-left: auto; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 16px; text-align: center;
}
.avatar.group-av { color: #fff; display: grid; place-items: center; }

/* ---- header topic & DM avatar */
.hd-av { display: flex; align-items: center; }
.hd-topic {
  min-width: 0; flex: 0 1 auto; max-width: 420px; border: 0; background: none; padding: 0;
  color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer; text-align: left;
}
.hd-topic:hover { color: var(--text); }
.topic-full { white-space: pre-wrap; overflow-wrap: anywhere; }
.intro-user { color: var(--strong); font-size: 20px; font-weight: 500; margin: -2px 0 8px; }

/* ---- spoiler channels */
.chat-body { position: relative; }
.messages.spoiler-hidden > .msg, .messages.spoiler-hidden > .day-divider { filter: blur(10px); pointer-events: none; user-select: none; }
.spoiler-cover {
  position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 5;
  width: min(360px, calc(100% - 32px)); padding: 24px; border-radius: 12px;
  background: var(--bg-float); box-shadow: 0 8px 30px var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--muted);
}
.spoiler-cover strong { color: var(--strong); font-size: 16px; }
.spoiler-cover .btn { margin-top: 6px; }

/* ---- replies */
.msg.has-reply .msg-avatar { top: 26px; }
.msg-reply {
  position: relative; display: flex; align-items: center; gap: 4px; height: 22px; max-width: 100%;
  margin: 0 0 0; padding: 0; border: 0; background: none; color: var(--muted); font-size: 14px;
  cursor: pointer; text-align: left; min-width: 0;
}
.reply-spine {
  position: absolute; left: -37px; top: 11px; width: 33px; height: 13px;
  border-left: 2px solid var(--toggle-off); border-top: 2px solid var(--toggle-off); border-top-left-radius: 6px;
  opacity: 0.7;
}
.avatar.reply-av { width: 16px; height: 16px; font-size: 7px; flex-shrink: 0; }
.reply-name { color: var(--strong); font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.reply-text { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-reply:hover .reply-text { color: var(--strong); }
.msg.mentioned { background: rgba(240, 178, 50, 0.08); box-shadow: inset 2px 0 0 var(--yellow); }
.msg.mentioned:hover { background: rgba(240, 178, 50, 0.12); }
.msg.flash { animation: msg-flash 1.6s ease; }
@keyframes msg-flash { 0%, 40% { background: var(--accent-soft); } 100% { background: transparent; } }
.composer-wrap { position: relative; }
.reply-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 34px; padding: 0 8px 0 16px;
  border-radius: 8px 8px 0 0; background: var(--bg-side); color: var(--muted); font-size: 14px;
}
.reply-bar strong { color: var(--strong); font-weight: 600; }
.reply-bar .icon-btn { color: var(--icon); }
.composer.replying { border-top-left-radius: 0; border-top-right-radius: 0; }
.slow-note {
  position: absolute; right: 16px; bottom: 0; height: 24px; display: flex; align-items: center; gap: 4px;
  color: var(--muted); font-size: 12px; font-weight: 600;
}
.composer.locked { opacity: 0.6; }

/* ---- friends page */
.app.friends-view .chat-body, .app.friends-view .call { display: none !important; }
div#friends-view { flex: 1; min-height: 0; display: flex; }
.fr-title { display: flex; align-items: center; gap: 8px; color: var(--strong); font-weight: 600; font-size: 15px; padding: 0 4px 0 0; }
.fr-title .ico { color: var(--icon); }
.fr-tab {
  height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--muted);
  font-size: 15px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.fr-tab:hover { background: var(--bg-hover); color: var(--text); }
.fr-tab.on { background: var(--bg-active); color: var(--strong); }
.fr-tab.add { background: var(--green); color: #fff; margin-left: 4px; }
.fr-tab.add.on { background: none; color: var(--ok-text); }
.fr-count { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 16px; text-align: center; }
.fr-page { flex: 1; min-width: 0; display: flex; }
.fr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 16px 20px 0 30px; overflow-y: auto; }
.fr-search-wrap { display: flex; align-items: center; height: 36px; padding: 0 10px; margin: 0 10px 8px 0; border-radius: 6px; background: var(--bg-deep); color: var(--icon); }
.fr-search { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text); font: 15px var(--font); }
.fr-search::placeholder { color: var(--muted); }
.fr-label { margin: 16px 20px 8px 0; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; }
.fr-list { display: flex; flex-direction: column; padding-right: 10px; }
.fr-row {
  display: flex; align-items: center; gap: 12px; height: 62px; padding: 0 10px; margin: 0 -10px;
  border-top: 1px solid var(--sep); border-radius: 8px; cursor: pointer;
}
.fr-row:hover { background: var(--bg-hover); border-top-color: transparent; }
.fr-row:hover + .fr-row { border-top-color: transparent; }
.fr-text { flex: 1; min-width: 0; }
.fr-name { display: flex; align-items: baseline; gap: 6px; color: var(--strong); font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-user { display: none; color: var(--muted); font-size: 14px; font-weight: 500; }
.fr-row:hover .fr-user { display: inline; }
.fr-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-acts { display: flex; gap: 10px; }
.fr-act {
  width: 36px; height: 36px; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg-side); color: var(--icon); cursor: pointer;
}
.fr-row:hover .fr-act { background: var(--bg-deep); }
.fr-act:hover { color: var(--strong); }
.fr-act.ok:hover { color: var(--green); }
.fr-act.no:hover { color: var(--red); }
.fr-empty { margin: auto; padding: 40px 16px; max-width: 420px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.fr-empty-art { width: 120px; height: 120px; border-radius: 50%; background: var(--bg-side); display: grid; place-items: center; color: var(--faint); }
.fr-empty p { margin: 0; font-size: 15px; }
.fr-add { padding: 4px 10px 20px 0; }
.fr-add h2 { margin: 4px 0 6px; color: var(--strong); font-size: 18px; font-weight: 700; }
.fr-add p { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.fr-add-box { border-radius: 8px; background: var(--bg-deep); border: 1px solid transparent; }
.fr-add-box:focus-within { border-color: var(--link); }
.fr-add-box.err { border-color: var(--red); }
.fr-add-box.ok { border-color: var(--green); }
.fr-add-top { display: flex; align-items: center; gap: 12px; padding: 0 12px 0 14px; height: 52px; }
.fr-add-input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text); font: 16px var(--font); }
.fr-add-input::placeholder, .fr-add-note::placeholder { color: var(--muted); }
.fr-add-top .btn { height: 32px; padding: 0 16px; flex-shrink: 0; }
.fr-add-top .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.fr-add-bottom { display: flex; align-items: center; gap: 8px; padding: 8px 14px 10px; border-top: 1px solid var(--sep); }
.fr-add-note { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: 14px var(--font); resize: none; height: 20px; line-height: 20px; padding: 0; }
.fr-add-count { color: var(--muted); font-size: 12px; font-weight: 600; }
.fr-add-msg { min-height: 20px; margin-top: 8px; font-size: 14px; }
.fr-add-msg.ok { color: var(--ok-text); }
.fr-add-msg.err { color: var(--red); }
.fr-add-sep { height: 1px; margin: 20px 0 24px; background: var(--sep); }
.fr-explore {
  width: min(400px, 100%); height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg-side); color: var(--strong);
  font-size: 15px; font-weight: 600; cursor: pointer; text-align: left;
}
.fr-explore > span:nth-child(2) { flex: 1; }
.fr-explore:hover { background: var(--bg-hover); }
.fr-explore-ico { width: 36px; height: 36px; border-radius: 8px; background: var(--green); color: #fff; display: grid; place-items: center; }
.fr-active { width: 340px; flex-shrink: 0; padding: 16px; border-left: 1px solid var(--sep); overflow-y: auto; }
.fr-active h2 { margin: 6px 0 16px; color: var(--strong); font-size: 20px; font-weight: 800; }
.fr-active-card {
  width: 100%; display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 12px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg-side); cursor: pointer; text-align: left;
}
.fr-active-card:hover { background: var(--bg-hover); }
.fr-quiet { text-align: center; padding: 16px 8px; }
.fr-quiet strong { color: var(--strong); font-size: 16px; }
.fr-quiet p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
@media (max-width: 1100px) { .fr-active { display: none; } }

/* ---- profile popout extras */
.popout { max-height: calc(100vh - 16px); overflow-y: auto; scrollbar-width: none; }
.popout::-webkit-scrollbar { display: none; }
.po-banner { position: relative; overflow: hidden; }
.po-banner img, .st-acct-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.po-top-btns { position: absolute; top: 12px; right: 12px; z-index: 2; display: flex; gap: 8px; }
.po-top-btn {
  width: 32px; height: 32px; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.5); color: #fff; cursor: pointer;
}
.po-top-btn:hover { background: rgba(0, 0, 0, 0.72); }
.po-top-btn:disabled { cursor: default; opacity: 0.75; }
.po-badges { display: inline-flex; gap: 4px; align-items: center; }
.po-mutual { display: flex; align-items: center; gap: 8px; margin: 10px 16px 0; color: var(--muted); font-size: 13px; font-weight: 500; }
.po-mutual-icons { display: inline-flex; }
.po-mini-server {
  width: 20px; height: 20px; border-radius: 6px; margin-left: -4px; box-shadow: 0 0 0 2px var(--popout);
  display: grid; place-items: center; overflow: hidden; color: #fff; font-size: 8px; font-weight: 700;
}
.po-mini-server:first-child { margin-left: 0; }
.po-mini-server img { width: 100%; height: 100%; object-fit: cover; }
.po-card { margin: 12px 12px 0; padding: 12px; border-radius: 8px; background: var(--popout-card); display: flex; flex-direction: column; gap: 10px; }
.po-card-title { color: var(--strong); font-size: 12px; font-weight: 700; }
.po-voice { display: flex; align-items: center; gap: 10px; min-width: 0; }
.po-voice-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--green); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.po-voice > div { min-width: 0; display: flex; flex-direction: column; }
.po-voice strong { color: var(--strong); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.po-voice small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn.small.wide { height: 32px; }
.po-section { margin: 12px 16px 0; display: flex; flex-direction: column; gap: 6px; }
.po-roles { display: flex; flex-wrap: wrap; gap: 4px; }
.po-since { display: flex; align-items: center; gap: 6px; color: var(--text); font-size: 14px; }
.po-since-ico { color: var(--brand); display: flex; }
.po-since-ico .logo-hole { fill: var(--popout); }
.po-msg-wrap { margin: 12px 12px 0; }
.po-message {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--chip-border); border-radius: 8px; outline: 0;
  background: var(--popout-card); color: var(--text); font: 14px var(--font);
}
.po-message:focus { border-color: var(--accent); }

/* ---- DM profile side panel */
.members.dm-profile { padding: 0; background: var(--popout); width: auto; }
.app:has(.members.dm-profile) { grid-template-columns: 72px 240px minmax(0, 1fr) 340px; }
.app.hide-members:has(.members.dm-profile) { grid-template-columns: 72px 240px minmax(0, 1fr); }
.dp { padding-bottom: 20px; }
.dp .po-banner { border-radius: 0; height: 120px; }
.dp .po-avatar-wrap { top: -50px; }
.dp .po-top { height: 56px; }
.dp-fold { margin: 12px 12px 0; border-radius: 8px; background: var(--popout-card); }
.dp-fold summary { display: flex; align-items: center; justify-content: space-between; height: 40px; padding: 0 12px; list-style: none; cursor: pointer; color: var(--strong); font-size: 13px; font-weight: 600; }
.dp-fold summary::-webkit-details-marker { display: none; }
.dp-fold[open] .dp-chev { transform: rotate(90deg); }
.dp-chev { color: var(--muted); transition: transform 0.15s ease; }
.dp-list { padding: 0 6px 6px; display: flex; flex-direction: column; }
.dp-item { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 6px; border: 0; border-radius: 6px; background: none; color: var(--text); font-size: 14px; font-weight: 500; text-align: left; cursor: pointer; }
.dp-item:hover { background: var(--bg-hover); color: var(--strong); }
.po-mini-server.big { width: 28px; height: 28px; border-radius: 8px; margin: 0; box-shadow: none; font-size: 10px; }
.dp-full { display: block; width: calc(100% - 24px); margin: 16px 12px 0; height: 36px; border: 0; border-radius: 8px; background: none; color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; }
.dp-full:hover { background: var(--bg-hover); color: var(--strong); }
@media (max-width: 1100px) { .app:has(.members.dm-profile) { grid-template-columns: 72px 240px minmax(0, 1fr); } }

/* ---- settings window (full screen like Discord) */
/* Sits below dialogs (.overlay 100), popovers (150) and profile popouts (170), so those open on top of Settings. */
.st-overlay { position: fixed; inset: 0; z-index: 96; background: var(--bg-chat); animation: st-in 0.16s ease; }
.desktop .st-overlay { top: 30px; }
.st-overlay.out { animation: st-out 0.12s ease forwards; }
@keyframes st-in { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
@keyframes st-out { to { opacity: 0; transform: scale(1.04); } }
.st-panel { display: flex; height: 100%; }
.st-side {
  flex: 1 0 218px; display: flex; flex-direction: column; align-items: flex-end;
  background: var(--bg-side); overflow-y: auto; padding: 60px 6px 60px 20px;
}
.st-side > * { width: 218px; }
.st-me {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px; margin-bottom: 10px;
  border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer;
}
.st-me:hover { background: var(--bg-hover); }
.st-me-text { display: flex; flex-direction: column; min-width: 0; }
.st-me-text strong { color: var(--strong); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-me-text small { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
.st-search-wrap { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px; margin: 0 0 10px; border-radius: 6px; background: var(--bg-deep); color: var(--muted); }
.st-search { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text); font: 14px var(--font); }
.st-nav { display: flex; flex-direction: column; gap: 2px; }
.st-nav-title { padding: 6px 10px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.st-nav-title.big { color: var(--strong); font-size: 13px; padding: 6px 10px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-nav-item {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border: 0; border-radius: 6px;
  background: none; color: var(--muted); font-size: 15px; font-weight: 500; text-align: left; cursor: pointer;
}
.st-nav-item > span:not(.st-nav-badge) { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-nav-item:hover { background: var(--bg-hover); color: var(--text); }
.st-nav-item.on { background: var(--bg-active); color: var(--strong); }
.st-nav-item.sub { padding-left: 38px; font-size: 14px; height: 30px; }
.st-nav-item.danger { color: var(--red); }
.st-nav-item.danger:hover { background: rgba(242, 63, 67, 0.1); }
.st-nav-ico { color: currentColor; }
.st-nav-badge { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 16px; text-align: center; }
.st-nav-sep { height: 1px; margin: 8px 10px; background: var(--sep); }
.st-main { position: relative; flex: 1 1 800px; min-width: 0; display: flex; }
.st-scroll { flex: 1; overflow-y: auto; padding: 60px 40px 100px; }
.st-content { max-width: 740px; min-width: 0; }
.st-title { margin: 0 0 20px; color: var(--strong); font-size: 20px; font-weight: 700; }
.st-close {
  position: absolute; top: 60px; right: 40px; z-index: 2; border: 0; background: none; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); cursor: pointer;
}
.st-close-x { width: 36px; height: 36px; border-radius: 50%; border: 2px solid currentColor; display: grid; place-items: center; }
.st-close-esc { font-size: 13px; font-weight: 600; }
.st-close:hover { color: var(--strong); }
.st-close:hover .st-close-x { background: var(--bg-hover); }
.st-main .st-content { margin-right: 80px; }
.st-savebar-holder { position: absolute; left: 40px; right: 40px; bottom: 20px; z-index: 3; pointer-events: none; max-width: 740px; }
.st-savebar {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px;
  border-radius: 8px; background: var(--bg-float); box-shadow: 0 6px 24px var(--shadow); color: var(--strong); font-size: 15px; font-weight: 500;
  animation: rise 0.2s ease;
}
.st-savebar > span { flex: 1; }
.st-savebar .btn.link { color: var(--text); }
.st-savebar .btn.primary { background: var(--green); }
.st-savebar.shake { animation: shake 0.4s ease; background: var(--red); color: #fff; }
.st-savebar.shake .btn.link { color: #fff; }
@keyframes shake { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.st-section { margin: 0 0 28px; padding-bottom: 28px; border-bottom: 1px solid var(--sep); display: flex; flex-direction: column; gap: 14px; }
.st-section:last-child { border-bottom: 0; }
.st-h3 { margin: 6px 0 0; color: var(--strong); font-size: 16px; font-weight: 700; }
.st-row { display: flex; align-items: center; gap: 16px; min-height: 40px; }
.st-row-text { flex: 1; min-width: 0; }
.st-row-label { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.st-row-value { color: var(--strong); font-size: 15px; margin-top: 2px; overflow-wrap: anywhere; }
.st-row-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.st-row > .btn { flex-shrink: 0; height: 32px; padding: 0 16px; }
.toggle-row.st-toggle { align-items: center; }
.toggle-row.st-toggle > span:first-child { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.toggle-row.st-toggle > span.toggle-ui:last-child { flex: 0 0 40px; display: block; margin-top: 0; }
.st-toggle.disabled { opacity: 0.5; cursor: not-allowed; }
.st-radios { display: flex; flex-direction: column; gap: 8px; }
.st-radio {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 8px;
  background: var(--bg-side); color: var(--text); text-align: left; cursor: pointer;
}
.st-radio:hover { background: var(--bg-hover); }
.st-radio.on { background: var(--bg-active); }
.st-radio.on .radio { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--bg-active), inset 0 0 0 10px var(--accent); }
.st-radio-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-radio-text strong { color: var(--strong); font-size: 15px; font-weight: 600; }
.st-radio-text small { color: var(--muted); font-size: 13px; }
.st-error { padding: 12px; border-radius: 8px; background: rgba(242, 63, 67, 0.12); color: var(--red); }
.st-muted { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.st-divider { height: 1px; margin: 22px 0 4px; background: var(--sep); }
.st-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.st-two > div > .field-label:first-child { margin-top: 0; }
.st-acct-card { border-radius: 10px; overflow: hidden; background: var(--bg-deep); margin-bottom: 32px; }
.st-acct-banner { position: relative; height: 100px; overflow: hidden; }
.st-acct-head { display: flex; align-items: flex-end; gap: 14px; padding: 0 16px; margin-top: -40px; position: relative; }
.st-acct-av { position: relative; border-radius: 50%; padding: 6px; background: var(--bg-deep); flex-shrink: 0; }
.st-acct-av .sdot.on-popout { --dot-cut: var(--bg-deep); border-color: var(--bg-deep); }
.st-acct-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding-bottom: 12px; }
.st-acct-name strong { color: var(--strong); font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-acct-head > .btn { margin-bottom: 14px; height: 32px; padding: 0 16px; flex-shrink: 0; }
.st-badges { display: inline-flex; gap: 4px; align-items: center; }
.st-acct-rows { margin: 8px 16px 16px; padding: 16px; border-radius: 8px; background: var(--bg-side); display: flex; flex-direction: column; gap: 20px; }
.st-standing { padding: 16px; border-radius: 8px; background: var(--bg-side); }
.st-standing-top { display: flex; gap: 12px; align-items: flex-start; }
.st-standing-top > .ico { margin-top: 2px; color: var(--green); }
.st-standing:not(.ok) .st-standing-top > .ico { color: var(--yellow); }
.st-standing.bad .st-standing-top > .ico { color: var(--red); }
.st-standing-top strong { color: var(--strong); font-size: 15px; }
.st-standing-top p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.st-meter { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 16px 0 6px; }
.st-meter-step { height: 8px; border-radius: 4px; background: var(--bg-active); }
.st-meter-step.cur { background: var(--green); }
.st-standing:not(.ok) .st-meter-step.cur { background: var(--yellow); }
.st-standing.bad .st-meter-step.cur { background: var(--red); }
.st-meter-labels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; color: var(--muted); font-size: 11px; text-align: center; }
.st-warnings { margin-top: 14px; }
.st-warning { color: var(--text); font-size: 14px; padding: 4px 0; }
.st-badge-list { display: flex; flex-wrap: wrap; gap: 10px; }
.st-badge-item { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 8px; background: var(--bg-side); color: var(--strong); font-weight: 500; }
.pe-media { display: flex; flex-direction: column; gap: 6px; }
.pe-color { display: flex; align-items: center; gap: 12px; }
.pe-form .field-label:first-child { margin-top: 0; }
.st-privacy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.st-privacy-col { padding: 14px 16px; border-radius: 8px; background: var(--bg-side); }
.st-privacy-col strong { display: flex; align-items: center; gap: 6px; color: var(--strong); }
.st-privacy-col.ok strong .ico { color: var(--green); }
.st-privacy-col ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.st-mic-row { display: flex; align-items: center; gap: 16px; }
.st-mic-row .btn { flex-shrink: 0; height: 32px; padding: 0 16px; }
.st-mic-meter { flex: 1; height: 8px; border-radius: 4px; background: var(--bg-active); overflow: hidden; }
.st-mic-fill { width: 0; height: 100%; background: var(--green); transition: width 0.06s linear; }
.st-range-row { display: flex; align-items: center; gap: 12px; }
.st-range { flex: 1; accent-color: var(--accent); }
.st-range-a { color: var(--muted); font-size: 20px; font-weight: 600; line-height: 1; }
.st-range-a.small { font-size: 13px; }
.st-range-val { width: 44px; color: var(--strong); font-weight: 600; text-align: right; }

/* ---- admin panel & shared tabs */
.ad-tabs { display: flex; gap: 4px; margin: 4px 0 18px; border-bottom: 1px solid var(--sep); }
.ad-tab {
  height: 36px; padding: 0 12px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none;
  color: var(--muted); font-size: 15px; font-weight: 500; cursor: pointer;
}
.ad-tab:hover { color: var(--text); }
.ad-tab.on { color: var(--strong); border-bottom-color: var(--accent); }
.ad-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 28px; }
.ad-stat { padding: 16px; border-radius: 8px; background: var(--bg-side); display: flex; flex-direction: column; gap: 4px; }
.ad-stat strong { color: var(--strong); font-size: 24px; font-weight: 700; }
.ad-stat span { color: var(--muted); font-size: 13px; }
.ad-inline { display: flex; align-items: center; gap: 8px; }
.ad-inline .input { flex: 1; }
.ad-inline .btn { flex-shrink: 0; height: 36px; padding: 0 16px; }
.ad-users-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.ad-users { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; max-height: 60vh; overflow-y: auto; }
.ad-user {
  display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 8px; border: 0; border-radius: 6px;
  background: none; text-align: left; cursor: pointer;
}
.ad-user:hover { background: var(--bg-hover); }
.ad-user .sdot { position: static; width: 10px; height: 10px; border: 0; flex-shrink: 0; }
.ad-user-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ad-user-text strong { color: var(--strong); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-user-text small { color: var(--muted); font-size: 12px; }
.ad-pill {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 10px;
  background: rgba(35, 165, 90, 0.16); color: var(--ok-text); font-size: 11px; font-weight: 700; text-transform: capitalize; white-space: nowrap;
}
.ad-pill.limited, .ad-pill.very_limited, .ad-pill.at_risk { background: rgba(240, 178, 50, 0.16); color: var(--yellow); }
.ad-pill.suspended, .ad-pill.banned { background: rgba(242, 63, 67, 0.16); color: var(--red); }
.ad-pill.big { height: auto; min-height: 24px; margin-top: 8px; padding: 4px 10px; border-radius: 6px; text-transform: none; font-size: 13px; white-space: normal; }
.ad-detail { min-width: 0; padding: 16px; border-radius: 8px; background: var(--bg-side); }
.ad-detail .st-section { padding-bottom: 18px; margin-bottom: 18px; }
.ad-user-card { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.ad-user-card > div:last-child { min-width: 0; }
.ad-user-name { display: flex; align-items: center; gap: 8px; }
.ad-user-name strong { color: var(--strong); font-size: 20px; }
.ad-user-card .st-muted { margin: 2px 0 0; }
.ad-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ad-actions .btn { height: 32px; padding: 0 14px; }
.ad-dur { width: auto; height: 32px; padding: 0 8px; }
.ad-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.ad-check {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 10px; border-radius: 8px;
  background: var(--bg-deep); color: var(--text); font-size: 14px; cursor: pointer;
}
.ad-check input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.ad-check .avatar.xs { width: 20px; height: 20px; font-size: 9px; }
.ad-audit { display: flex; flex-direction: column; }
.ad-audit-row { padding: 10px 0; border-bottom: 1px solid var(--sep); color: var(--text); font-size: 14px; }
.ad-audit-row strong { color: var(--strong); }
.ad-audit-when { display: inline-block; min-width: 180px; color: var(--muted); font-size: 13px; }

/* ---- server settings: overview, roles, members, invites */
.so-top { display: flex; gap: 24px; align-items: flex-start; margin-bottom: 28px; }
.so-icon { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; }
.so-icon .wiz-upload { width: 100px; height: 100px; }
.so-fields { flex: 1; min-width: 0; }
.so-fields .field-label { margin-top: 0; }
.so-id { flex: 1; padding: 8px 10px; border-radius: 6px; background: var(--bg-deep); color: var(--text); overflow-wrap: anywhere; }
.ro-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; align-items: start; }
.ro-list { display: flex; flex-direction: column; gap: 2px; }
.ro-create { height: 32px; margin-bottom: 10px; }
.ro-list-head { display: flex; justify-content: space-between; padding: 4px 8px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.ro-item { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px; border-radius: 6px; color: var(--text); cursor: pointer; }
.ro-item:hover { background: var(--bg-hover); }
.ro-item.on { background: var(--bg-active); color: var(--strong); }
.ro-item.locked { color: var(--muted); }
.ro-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.ro-lock { color: var(--muted); }
.ro-count { color: var(--muted); font-size: 13px; min-width: 16px; text-align: right; }
.ro-move { display: none; gap: 0; }
.ro-item:hover .ro-move { display: inline-flex; }
.ro-item:hover .ro-count { display: none; }
.ro-editor { min-width: 0; padding: 16px; border-radius: 8px; background: var(--bg-side); }
.ro-editor-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; color: var(--strong); font-size: 15px; }
.ro-editor .st-toggle { margin-top: 18px; }
.ro-editor .st-h3 { margin-top: 18px; text-transform: uppercase; font-size: 12px; color: var(--muted); }
.ro-editor .st-toggle + .st-toggle { margin-top: 14px; }
.ro-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 10px; text-align: center; color: var(--muted); }
.ro-empty p { margin: 0; max-width: 360px; }
.ro-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.ro-sw { width: 32px; height: 32px; border: 0; border-radius: 6px; cursor: pointer; position: relative; padding: 0; }
.ro-sw.default { background: #99aab5; width: 48px; }
.ro-sw.on { box-shadow: 0 0 0 2px var(--bg-side), 0 0 0 4px var(--strong); }
.ro-sw.custom { display: grid; place-items: center; background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red); overflow: hidden; }
.ro-sw.custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.ro-sw:disabled { cursor: not-allowed; opacity: 0.6; }
.ro-delete { margin-top: 24px; height: 32px; padding: 0 14px; }
.ro-members { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.ro-member { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 8px; border-radius: 6px; }
.ro-member:hover { background: var(--bg-hover); }
.ro-member > span { flex: 1; min-width: 0; color: var(--strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-list { display: flex; flex-direction: column; margin-top: 12px; }
.mb-head { display: flex; justify-content: space-between; padding: 8px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; border-bottom: 1px solid var(--sep); }
.mb-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px; border-bottom: 1px solid var(--sep); }
.mb-name { width: 200px; flex-shrink: 0; min-width: 0; display: flex; flex-direction: column; }
.mb-name strong { display: flex; align-items: center; color: var(--strong); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-name small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.mb-roles { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.mb-acts { display: flex; gap: 4px; flex-shrink: 0; }
.mb-acts .btn { height: 28px; }
.iv-table { margin-top: 16px; display: flex; flex-direction: column; }
.iv-row { display: grid; grid-template-columns: minmax(0, 1.4fr) 1fr 70px minmax(0, 1.4fr) 28px; align-items: center; gap: 12px; min-height: 48px; padding: 6px 8px; border-bottom: 1px solid var(--sep); color: var(--text); font-size: 14px; }
.iv-row.head { min-height: 32px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.iv-who { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iv-empty { padding: 24px 8px; color: var(--muted); text-align: center; }
.st-content > .btn.small { height: 32px; padding: 0 16px; margin: 4px 0 4px; }
.st-content > .invite-warn { margin-bottom: 12px; }

/* ---- channel settings */
.cs-head { display: flex; align-items: center; gap: 4px; color: var(--strong); text-transform: none; min-width: 0; }
.cs-head > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-head small { color: var(--muted); font-weight: 500; text-transform: uppercase; margin-left: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-topic-box { position: relative; border-radius: 8px; background: var(--bg-deep); }
.cs-toolbar { display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--sep); }
.cs-fmt {
  width: 28px; height: 28px; border: 0; border-radius: 4px; background: none; color: var(--icon);
  display: grid; place-items: center; font-size: 15px; cursor: pointer;
}
.cs-fmt:hover { background: var(--bg-hover); color: var(--strong); }
.cs-fmt:disabled { opacity: 0.5; cursor: default; }
.cs-sep { width: 1px; height: 18px; margin: 0 4px; background: var(--sep); }
.cs-grow { flex: 1; }
.cs-topic { background: none; min-height: 110px; padding-bottom: 24px; border-radius: 0 0 8px 8px; }
.cs-topic:focus { box-shadow: none; }
.cs-count { position: absolute; right: 12px; bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.cs-synced { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 16px; border-radius: 8px; background: var(--bg-side); color: var(--text); }
.cs-synced .ico { color: var(--icon); }
.cs-private { display: flex; align-items: flex-start; gap: 12px; padding: 16px; margin-bottom: 20px; border-radius: 8px; background: var(--bg-side); }
.cs-private > .ico { margin-top: 2px; color: var(--icon); }
.cs-private > .st-toggle { flex: 1; }
.channel-settings .ad-checks + .field-label, .channel-settings .st-muted + .field-label { margin-top: 18px; }

/* ---- announcements, blocked screen */
.announce-bar {
  position: relative; z-index: 95; height: 36px; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 0 44px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; text-align: center;
}
.announce-bar > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.announce-bar.warning { background: #c27c0e; }
.announce-bar.danger { background: var(--red); }
.has-announce .app { height: calc(100vh - 36px); }
.desktop.has-announce .app, .desktop .has-announce .app { height: calc(100vh - 66px); }
.blocked-screen { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 24px; background: var(--bg-rail); }
.desktop .blocked-screen { top: 30px; }
.blocked-screen .auth-card { text-align: center; display: flex; flex-direction: column; gap: 8px; }
.blocked-screen .auth-card .btn { height: 40px; }

/* ---- updates: what's new, red UPDATE button, urgent overlay */
.titlebar { position: relative; }
.tb-actions {
  position: absolute; top: 0; bottom: 0; right: 146px; display: flex; align-items: center; gap: 8px;
  -webkit-app-region: no-drag;
}
.tb-update {
  height: 22px; padding: 0 10px; border: 0; border-radius: 4px; display: inline-flex; align-items: center; gap: 5px;
  background: var(--red); color: #fff; font: 700 12px var(--font); letter-spacing: 0.04em; cursor: pointer; text-decoration: none;
  animation: pop 0.2s ease;
}
.tb-update:hover { background: #d8353a; color: #fff; text-decoration: none; }
.tb-update:disabled { opacity: 0.75; cursor: default; }
.update-modal { width: min(440px, 100%); }
.um-art {
  height: 120px; margin: 0 0 16px; border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 12px;
  background: linear-gradient(135deg, var(--brand-light), var(--brand-deep)); color: #fff;
}
.um-art .logo-hole { fill: var(--brand); }
.um-ver { font-size: 26px; font-weight: 800; }
.um-notes { margin: 0; padding-left: 20px; color: var(--text); font-size: 15px; line-height: 1.6; max-height: 40vh; overflow-y: auto; }
.um-empty { margin: 0; color: var(--muted); }
.update-modal .modal-actions .btn { min-width: 110px; }
.update-urgent { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: rgba(0, 0, 0, 0.7); }
.uu-card {
  width: min(380px, calc(100% - 32px)); padding: 28px 24px; border-radius: 12px; background: var(--bg-modal);
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--muted);
}
.uu-card strong { color: var(--strong); font-size: 18px; }
.uu-card .spinner { width: 28px; height: 28px; border-width: 3px; }

@media (max-width: 760px) {
  .st-side { flex: 0 0 170px; padding: 20px 4px 20px 8px; align-items: stretch; }
  .st-side > * { width: auto; }
  .st-scroll { padding: 24px 16px 100px; }
  .st-main .st-content { margin-right: 48px; }
  .st-close { top: 20px; right: 12px; }
  .st-two, .st-privacy-grid, .ad-users-layout, .ro-layout { grid-template-columns: 1fr; }
  .fr-main { padding: 16px; }
  .mb-name { width: 140px; }
}

/* ============================================================ v0.4: badges, mentions, banners, voice chat, honeycomb */

/* ---- badge pill (next to usernames) */
.badge-pill {
  display: inline-flex; align-items: center; gap: 0; height: 24px; padding: 0 1px; flex: 0 0 auto; width: max-content;
  border-radius: 7px; background: var(--chip); border: 1px solid var(--chip-border); vertical-align: middle; box-sizing: border-box;
}
.po-sub .badge-pill, .po-sub .tag-chip { margin-left: 4px; }
.badge-btn {
  width: 22px; height: 22px; border: 0; border-radius: 6px; background: none; padding: 0;
  display: grid; place-items: center; cursor: pointer;
}
.badge-btn:hover { background: var(--chip-hover); }
.badge-more { height: 22px; padding: 0 4px; border: 0; background: none; color: var(--text); font-size: 12px; font-weight: 600; cursor: pointer; border-radius: 6px; }
.badge-more:hover { background: var(--chip-hover); }
.badge-svg { display: block; flex-shrink: 0; }
.badge-ico { display: inline-grid; place-items: center; flex-shrink: 0; }
.badge-tip {
  position: fixed; z-index: 400; min-width: 150px; max-width: 220px; padding: 14px 16px 12px; border-radius: 10px;
  background: var(--bg-float); box-shadow: 0 8px 24px var(--shadow), 0 0 0 1px var(--border);
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; pointer-events: none; animation: pop 0.1s ease;
}
.bt-ico { margin-bottom: 8px; display: grid; place-items: center; }
.badge-tip strong { color: var(--strong); font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; }
.badge-tip span { color: var(--muted); font-size: 13px; }
.badges-overlay { position: fixed; inset: 0; z-index: 260; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, 0.6); animation: fade 0.12s ease; }
.bw {
  position: relative; width: min(680px, 100%); min-height: 420px; display: grid; grid-template-columns: 260px minmax(0, 1fr);
  border-radius: 12px; overflow: hidden; background: var(--bg-float); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--border);
}
.bw-x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border: 0; border-radius: 6px; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.bw-x:hover { color: var(--strong); background: var(--bg-hover); }
.bw-left { display: flex; flex-direction: column; padding: 24px 20px 20px; border-right: 1px solid var(--sep); }
.bw-head strong { color: var(--strong); font-size: 20px; font-weight: 700; line-height: 1.2; }
.bw-sub { color: var(--muted); font-size: 13px; margin: 8px 0 16px; }
.bw-grid { display: grid; grid-template-columns: repeat(4, 48px); gap: 8px; }
.bw-tile { width: 48px; height: 48px; border: 1px solid transparent; border-radius: 10px; background: var(--bg-hover); display: grid; place-items: center; cursor: pointer; }
.bw-tile:hover { background: var(--bg-active); }
.bw-tile.on { border-color: var(--accent); background: var(--accent-soft); }
.bw-spacer { flex: 1; min-height: 20px; }
.bw-mine { height: 36px; border: 0; border-radius: 8px; background: var(--bg-active); color: var(--strong); font-weight: 600; cursor: pointer; }
.bw-mine:hover { background: var(--btn-2); }
.bw-right { display: flex; flex-direction: column; align-items: center; padding: 48px 28px 28px; text-align: center; }
.bw-big { height: 110px; display: grid; place-items: center; margin-bottom: 12px; }
.bw-title { color: var(--strong); font-size: 24px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.02em; }
.bw-meta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin-top: 6px; color: var(--muted); font-size: 13px; }
.bw-dot { color: var(--faint); }
.bw-rarity { height: 20px; padding: 0 8px; border-radius: 10px; border: 1px solid currentColor; display: inline-flex; align-items: center; font-size: 11px; font-weight: 800; letter-spacing: 0.04em; }
.bw-rarity.mythic { color: #f59e0b; background: rgba(245, 158, 11, 0.12); }
.bw-rarity.legendary { color: #f97316; background: rgba(249, 115, 22, 0.12); }
.bw-rarity.epic { color: #a855f7; background: rgba(168, 85, 247, 0.12); }
.bw-rarity.rare { color: #3b82f6; background: rgba(59, 130, 246, 0.12); }
.bw-rarity.uncommon { color: #22c55e; background: rgba(34, 197, 94, 0.12); }
.bw-card { width: 100%; margin-top: 22px; padding: 16px; border-radius: 10px; background: var(--bg-hover); color: var(--text); font-size: 14px; text-align: left; }
.bw-empty { margin: auto; color: var(--muted); display: flex; flex-direction: column; align-items: center; }
@media (max-width: 640px) { .bw { grid-template-columns: 1fr; } .bw-left { border-right: 0; border-bottom: 1px solid var(--sep); } }

/* ---- Member Since */
.po-member-since { margin-top: 12px; }
.po-member-since .po-since { font-size: 14px; color: var(--text); }

/* ---- @mentions */
.mention { padding: 0 2px; border-radius: 3px; background: rgba(88, 101, 242, 0.24); color: #c9cdfb; font-weight: 500; cursor: pointer; }
:root[data-theme="light"] .mention { color: #4752c4; background: rgba(88, 101, 242, 0.15); }
.mention:hover { background: var(--accent); color: #fff; }
.mention.role { cursor: default; }
.mention-count {
  min-width: 16px; height: 16px; padding: 0 4px; margin-left: 4px; border-radius: 8px; flex-shrink: 0;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 16px; text-align: center;
}
.ch-item:hover .mention-count { display: none; }
.mention-pop {
  position: absolute; left: 16px; right: 16px; bottom: calc(100% + 6px); z-index: 30; max-height: 360px; overflow-y: auto;
  padding: 8px 0; border-radius: 8px; background: var(--bg-float); box-shadow: 0 8px 24px var(--shadow), 0 0 0 1px var(--border);
}
.mp-title { padding: 4px 16px 8px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.mp-row { display: flex; align-items: center; gap: 10px; height: 40px; margin: 0 8px; padding: 0 8px; border-radius: 6px; cursor: pointer; }
.mp-row.on { background: var(--bg-active); }
.mp-role-ico { width: 24px; height: 24px; display: grid; place-items: center; font-weight: 800; font-size: 16px; color: var(--text); flex-shrink: 0; }
.mp-name { color: var(--strong); font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-sub { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ---- hover pencil on avatar / banner (settings) */
.media-edit { position: relative; cursor: pointer; }
.me-overlay {
  position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; color: #fff;
  background: rgba(0, 0, 0, 0); opacity: 0; transition: opacity 0.12s ease, background-color 0.12s ease;
}
/* The avatar/name row overlaps the bottom of the banner: keep it above the banner's hover layer. */
.po-top, .st-acct-head { z-index: 2; }
.po-top-btns { z-index: 3; }
.media-edit.round .me-overlay { border-radius: 50%; }
.media-edit.square .me-overlay { border-radius: inherit; }
.media-edit:hover .me-overlay, .media-edit:focus-visible .me-overlay { opacity: 1; background: rgba(0, 0, 0, 0.45); }
.me-pencil { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.55); }
.po-banner.media-edit .me-pencil, .st-acct-banner.media-edit .me-pencil { position: absolute; top: 10px; right: 10px; }
.image-picker { width: min(560px, 100%); }
.image-picker .modal-title { text-align: left; margin-left: 0; }
.ip-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ip-tile {
  height: 190px; border: 0; border-radius: 10px; background: var(--bg-hover); color: var(--strong);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; cursor: pointer; text-align: center;
}
.ip-tile:hover { background: var(--bg-active); }
.ip-tile strong { font-size: 16px; }
.ip-tile small { color: var(--muted); font-size: 12px; margin-top: -4px; }
.ip-tile-ico { color: var(--icon); display: flex; }
.ip-gif-badge { padding: 4px 8px; border-radius: 6px; background: var(--strong); color: var(--bg-float); font-size: 12px; font-weight: 900; letter-spacing: 0.04em; }
.ip-recent-title { display: flex; flex-direction: column; gap: 2px; margin: 22px 0 12px; }
.ip-recent-title strong { color: var(--strong); font-size: 16px; }
.ip-recent-title span { color: var(--muted); font-size: 13px; }
.ip-recent { display: flex; flex-wrap: wrap; gap: 12px; }
.ip-recent-av { width: 64px; height: 64px; border: 0; padding: 0; border-radius: 50%; overflow: hidden; background: var(--bg-hover); display: grid; place-items: center; cursor: pointer; }
.ip-recent-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ip-recent-av:hover { box-shadow: 0 0 0 3px var(--accent); }

/* ---- server profile page + banner */
.sp-intro { margin-top: -8px; }
.sp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; align-items: start; }
.sp-form { min-width: 0; }
.sp-field { padding: 0 0 24px; margin: 0 0 24px; border-bottom: 1px solid var(--sep); }
.sp-field:last-child { border-bottom: 0; }
.sp-label { color: var(--strong); font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.sp-hint { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.sp-field .input + * { margin-top: 0; }
.sp-icon-row { display: flex; align-items: center; gap: 8px; }
.sp-icon-row .btn { height: 32px; padding: 0 16px; }
.sp-swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.sp-sw {
  position: relative; aspect-ratio: 16 / 10; border: 2px solid transparent; border-radius: 8px; padding: 0; cursor: pointer; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.sp-sw:hover { filter: brightness(1.1); }
.sp-sw.on { border-color: var(--strong); box-shadow: 0 0 0 2px var(--accent); }
.sp-sw.upload, .sp-sw.none { background: var(--bg-hover); color: var(--icon); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 600; border-style: dashed; border-color: var(--chip-border); }
.sp-sw.upload.on { border-style: solid; border-color: var(--strong); }
.sp-sw.upload img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sp-sw.none { border-style: solid; border-color: transparent; }
.sp-side { position: sticky; top: 0; }
.sp-preview { border-radius: 12px; overflow: hidden; background: var(--bg-float); box-shadow: 0 0 0 1px var(--border); }
.sp-banner { position: relative; height: 110px; background: linear-gradient(180deg, #000000, #3b3b3b); overflow: hidden; }
.sp-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sp-body { position: relative; padding: 0 16px 16px; }
.sp-icon {
  width: 64px; height: 64px; margin-top: -32px; border-radius: 18px; border: 4px solid var(--bg-float); background: var(--bg-side);
  display: grid; place-items: center; overflow: hidden; color: var(--strong); font-weight: 600; font-size: 15px;
}
.sp-icon img { width: 100%; height: 100%; object-fit: cover; }
.sp-name { margin-top: 8px; color: var(--strong); font-size: 18px; font-weight: 800; overflow-wrap: anywhere; }
.sp-counts { display: flex; align-items: center; gap: 6px; margin-top: 2px; color: var(--muted); font-size: 13px; }
.sp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.sp-dot.on { background: var(--green); }
.sp-counts .sp-dot:not(:first-child) { margin-left: 4px; }
.sp-est { color: var(--muted); font-size: 13px; margin-top: 2px; }
.sp-desc { color: var(--text); font-size: 13px; margin-top: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 900px) { .sp-layout { grid-template-columns: 1fr; } .sp-side { position: static; } .sp-swatches { grid-template-columns: repeat(4, 1fr); } }

/* Banner behind the server name in the channel list */
.side-top.flush:has(.server-header.has-banner) { height: auto; border-bottom: 0; }
.server-header.has-banner { position: relative; height: 136px; align-items: flex-start; gap: 4px; padding: 8px 8px 0; overflow: hidden; }
.sh-banner { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.sh-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sh-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 45%); }
/* On a banner: the name is a rounded pill that fits its text (like Discord), darkened on hover. */
.server-header.has-banner .sh-name, .server-header.has-banner .sh-invite {
  position: relative; z-index: 1; height: 32px; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  border-radius: 8px; transition: background-color 0.12s ease;
}
.server-header.has-banner .sh-name { flex: 0 1 auto; min-width: 0; max-width: calc(100% - 40px); padding: 0 10px; }
.server-header.has-banner .sh-invite { width: 32px; margin-left: auto; flex-shrink: 0; }
.server-header.has-banner .sh-name:hover, .server-header.has-banner .sh-name:focus-visible,
.server-header.has-banner .sh-invite:hover { background: rgba(0, 0, 0, 0.42); }

/* ---- drag to reorder channels / categories */
.cat[draggable="true"], .ch-item[draggable="true"] { user-select: none; }
.dragging { opacity: 0.45; }
.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.drop-into { background: var(--accent-soft); border-radius: 6px; }

/* ---- discord-style permission list */
.perm-list { display: flex; flex-direction: column; }
.perm-group { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 22px 0 6px; }
.perm-group:first-child { margin-top: 6px; }
.perm-group h3 { margin: 0; color: var(--strong); font-size: 16px; font-weight: 700; }
.perm-clear { border: 0; background: none; padding: 0; color: var(--link); font-size: 14px; font-weight: 500; cursor: pointer; }
.perm-clear:hover { text-decoration: underline; }
.perm-clear:disabled { opacity: 0.5; cursor: default; text-decoration: none; }
.ro-editor .toggle-row.st-toggle.perm-row { margin: 0; padding: 16px 0; border-bottom: 1px solid var(--sep); align-items: flex-start; }
.toggle-row.st-toggle.perm-row > span.toggle-ui:last-child { margin-top: 2px; }
.perm-row small strong { color: var(--text); font-size: 13px; font-weight: 700; }

/* ---- voice channel stage + chat */
.app.voice-stage .main { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
.app.voice-stage.stage-chat .main { grid-template-columns: minmax(0, 1fr) 380px; }
.app.voice-stage .chat-header { grid-column: 1 / -1; }
.app.voice-stage .friends-view { display: none !important; }
.app.voice-stage .chat-body { display: none; }
.app.voice-stage.stage-chat .chat-body { display: flex; grid-row: 2; grid-column: 2; min-width: 0; border-left: 1px solid var(--sep); background: var(--bg-chat); }
.app.voice-stage .drop-hint { grid-column: 1 / -1; }
.call.stage {
  grid-row: 2; grid-column: 1; min-height: 0; height: 100%; justify-content: center; gap: 22px; padding: 24px; border-bottom: 0; overflow-y: auto;
  background: radial-gradient(90% 60% at 50% 108%, #5b67f0 0%, rgba(91, 103, 240, 0) 70%), linear-gradient(180deg, #121433 0%, #1c1e58 55%, #2b3090 100%);
}
.stage-tiles { max-height: none; gap: 28px; }
.stage-tiles .call-tile { cursor: pointer; width: 110px; }
.stage-tiles .call-name { display: flex; align-items: center; justify-content: center; gap: 2px; color: #fff; max-width: 110px; }
.stage-empty { text-align: center; color: #fff; }
.stage-empty h2 { margin: 0 0 4px; font-size: 26px; font-weight: 800; }
.stage-empty p { margin: 0; color: rgba(255, 255, 255, 0.75); font-size: 14px; }
.stage-join { height: 36px; padding: 0 18px; border: 0; border-radius: 8px; background: #fff; color: #111; font-size: 14px; font-weight: 600; cursor: pointer; }
.stage-join:hover { background: #e6e6e6; }
.stage-note { color: rgba(255, 255, 255, 0.75); margin: 0; }
.call.stage .call-e2e { color: rgba(255, 255, 255, 0.6); }
.call-btn.on { background: #fff; color: #111; }
.stage-chat-head { display: none; }
.app.stage-chat .stage-chat-head {
  display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 12px 0 16px; flex-shrink: 0;
  border-bottom: 1px solid var(--sep); color: var(--strong); font-weight: 600;
}
.stage-chat-head > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-chat-head .ico { color: var(--icon); }
.intro-edit {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; margin-top: 12px; padding: 0 12px; border: 0; border-radius: 6px;
  background: var(--bg-hover); color: var(--strong); font-size: 13px; font-weight: 600; cursor: pointer;
}
.intro-edit:hover { background: var(--bg-active); }
@media (max-width: 1100px) { .app.voice-stage.stage-chat .main { grid-template-columns: minmax(0, 1fr) 320px; } }
@media (max-width: 760px) {
  .app.voice-stage.stage-chat .main { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 40% minmax(0, 1fr); }
  .app.voice-stage.stage-chat .chat-body { grid-row: 3; grid-column: 1; border-left: 0; border-top: 1px solid var(--sep); }
}

/* ---- group chat honeycomb */
.members.honey { padding: 0 10px 20px; }
.hc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 48px; margin: 0 -2px 6px; }
.hc-title {
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 6px; border: 0; border-radius: 6px; background: none;
  color: var(--strong); font-size: 16px; font-weight: 700; cursor: pointer;
}
.hc-head.list .hc-title { cursor: default; }
.hc-title:hover { background: var(--bg-hover); }
.hc-head.list .hc-title:hover { background: none; }
.hc-title .ico { color: var(--icon); }
.hc-chev { transition: transform 0.15s ease; }
.hc-chev.up { transform: rotate(180deg); }
.hc-toggle { color: var(--icon); }
.hc-grid { display: flex; flex-direction: column; align-items: center; padding: 4px 0 8px; }
.hc-row { display: flex; justify-content: center; gap: 6px; }
.hc-row + .hc-row { margin-top: -6px; }
.hc-cell {
  position: relative; width: 48px; height: 48px; border: 0; padding: 0; border-radius: 50%; background: none; cursor: pointer;
  display: grid; place-items: center; flex-shrink: 0;
}
.hc-cell .avatar.hc-av { width: 48px; height: 48px; font-size: 16px; }
.hc-cell:hover .avatar { box-shadow: 0 0 0 2px var(--accent); }
.hc-cell.off .avatar { opacity: 0.45; }
.hc-cell .sdot.hc-dot {
  position: absolute; right: -2px; bottom: -2px; width: 16px; height: 16px; border: 3px solid var(--bg-side); box-sizing: content-box;
  --dot-cut: var(--bg-side);
}
.hc-cell .sdot.hc-dot.idle::after { width: 9px; height: 9px; top: -2px; left: -2px; }
.hc-cell .sdot.hc-dot.dnd::after { left: 3px; right: 3px; top: 7px; height: 2px; }
.hc-crown { position: absolute; top: -12px; right: -8px; transform: rotate(18deg); filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5)); }
.hc-crown .crown { margin: 0; display: block; }
.hc-cell.add { background: var(--bg-hover); color: var(--icon); }
.hc-cell.add:hover { background: var(--bg-active); color: var(--strong); }
.hc-cell.empty { background: var(--bg-hover); cursor: default; opacity: 0.7; }
.act { margin-top: 18px; }
.act-head { display: flex; align-items: center; gap: 6px; margin: 0 4px 8px; color: var(--strong); }
.act-head strong { font-size: 16px; }
.act-head span { color: var(--muted); font-size: 12px; }
.act-head .ico { color: var(--icon); }
.act-row {
  width: 100%; display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px; border: 0; border-radius: 6px;
  background: none; color: var(--text); font-size: 13px; text-align: left; cursor: pointer;
}
.act-row:hover { background: var(--bg-hover); }
.act-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.act-text strong { color: var(--strong); font-weight: 600; }
.act-time { color: var(--muted); font-size: 12px; font-weight: 600; flex-shrink: 0; }
.act-row.skeleton { cursor: default; }
.act-row.skeleton:hover { background: none; }
.sk-av { width: 24px; height: 24px; border-radius: 50%; background: var(--bg-hover); flex-shrink: 0; }
.sk-line { flex: 1; height: 10px; border-radius: 5px; background: var(--bg-hover); }
.sk-time { width: 30px; height: 10px; border-radius: 5px; background: var(--bg-hover); }

/* ---- Create Channel window */
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.cc-modal { width: min(480px, 100%); }
.cc-modal .modal-title, .cc-modal .modal-sub { text-align: left; margin-left: 0; }
.cc-modal .modal-sub { font-size: 14px; }
.cc-label { margin: 18px 0 8px; color: var(--strong); font-size: 15px; font-weight: 600; }
.cc-label:first-child { margin-top: 4px; }
.cc-types { display: flex; flex-direction: column; gap: 2px; }
.cc-type {
  display: flex; align-items: flex-start; gap: 12px; padding: 8px 10px; margin: 0 -10px; border: 0; border-radius: 8px;
  background: none; color: var(--text); text-align: left; cursor: pointer;
}
.cc-type:hover { background: var(--bg-hover); }
.cc-type .radio { margin-top: 2px; }
.cc-type.on .radio { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--bg-modal), inset 0 0 0 10px var(--accent); }
.cc-type-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cc-type-text strong { display: flex; align-items: center; gap: 6px; color: var(--strong); font-size: 15px; font-weight: 600; }
.cc-type-text small { color: var(--muted); font-size: 13px; }
.cc-name-box {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 10px 0 12px; border-radius: 8px;
  background: var(--bg-deep); border: 1px solid var(--border); cursor: text;
}
.cc-name-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cc-prefix { color: var(--icon); display: flex; }
.cc-name { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text); font: 15px var(--font); }
.cc-name::placeholder { color: var(--muted); }
.cc-emoji { width: 28px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--icon); display: grid; place-items: center; cursor: pointer; }
.cc-emoji:hover { color: var(--strong); background: var(--bg-hover); }
.cc-private { margin-top: 20px; }
.cc-private strong { display: flex; align-items: center; gap: 4px; }
.cc-modal .modal-actions { background: none; padding-top: 8px; }
.cc-modal .modal-actions .btn { flex: 1; height: 40px; }

/* ---- Delete server: type the name to confirm */
.del-modal { width: min(480px, 100%); }
.del-modal .modal-title { text-align: left; margin-left: 0; }
.del-modal .modal-text { color: var(--muted); }
.del-modal .modal-text strong { color: var(--strong); }
.field-label.del-label { margin-top: 20px; text-transform: none; letter-spacing: 0; color: var(--strong); font-size: 15px; font-weight: 600; }
.del-modal .field-error { min-height: 18px; margin-top: 6px; color: var(--red); font-size: 13px; }
.del-modal .modal-actions { background: none; padding-top: 4px; }
.del-modal .modal-actions .btn { flex: 1; height: 40px; }

/* ---- settings sidebar: arrow that folds Account's sub-pages */
.st-nav-fold {
  width: 22px; height: 22px; margin-right: -4px; border-radius: 4px; flex-shrink: 0;
  display: grid; place-items: center; color: var(--muted); cursor: pointer;
}
.st-nav-fold:hover { background: var(--bg-active); color: var(--strong); }
.st-nav-fold .ico { transform: rotate(-90deg); transition: transform 0.15s ease; }
.st-nav-fold.open .ico { transform: none; }

/* ---- right-click menu (Discord-style) */
.ctx-menu {
  position: fixed; z-index: 280; min-width: 220px; max-width: 280px; padding: 6px 8px; border-radius: 8px;
  background: var(--bg-float); box-shadow: 0 8px 24px var(--shadow), 0 0 0 1px var(--border); animation: pop 0.08s ease;
}
.ctx-item {
  width: 100%; min-height: 32px; display: flex; align-items: center; gap: 8px; padding: 6px 8px; margin: 2px 0;
  border: 0; border-radius: 4px; background: none; color: var(--text); font-size: 14px; font-weight: 500; text-align: left; cursor: pointer;
}
.ctx-item:hover:not(:disabled), .ctx-item:focus-visible { background: var(--bg-active); color: var(--strong); }
.ctx-item:disabled { color: var(--faint); cursor: default; }
.ctx-item.danger { color: var(--red); }
.ctx-item.danger:hover:not(:disabled) { background: var(--red); color: #fff; }
.ctx-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ctx-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-text small { color: var(--muted); font-size: 12px; font-weight: 400; }
.ctx-item:hover:not(:disabled) .ctx-text small { color: inherit; opacity: 0.8; }
.ctx-ico, .ctx-chev { flex-shrink: 0; color: var(--icon); }
.ctx-item:hover:not(:disabled) .ctx-ico, .ctx-item:hover:not(:disabled) .ctx-chev { color: inherit; }
.ctx-sep { height: 1px; margin: 4px 4px; background: var(--sep); }
.dm-name { display: flex; align-items: center; gap: 4px; min-width: 0; }
.dm-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-pin { color: var(--muted); flex-shrink: 0; }
.ctx-check { flex: none; width: 20px; height: 20px; margin-left: auto; border-radius: 5px; box-shadow: inset 0 0 0 2px var(--muted); display: grid; place-items: center; color: #fff; }
.ctx-check.on { background: var(--accent); box-shadow: none; }
.ctx-check svg { stroke-width: 3; }
.ch-item.muted { opacity: 0.45; }
.ch-item.muted:hover, .ch-item.muted.active { opacity: 1; }
.dm-item.muted { opacity: 0.5; }
.dm-item.muted:hover, .dm-item.muted.active { opacity: 1; }
.group-av.has-img, .rail-group.has-img { overflow: hidden; background: var(--rail-item); }
.group-av.has-img img, .rail-group.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }

/* ---- notes on profiles, ignored messages */
.po-note-hint { color: var(--muted); font-weight: 500; }
.po-note {
  width: 100%; min-height: 28px; padding: 4px 6px; margin-left: -6px; border: 0; border-radius: 4px; outline: 0; resize: none; overflow: hidden;
  background: none; color: var(--text); font: 13px/1.4 var(--font);
}
.po-note::placeholder { color: var(--muted); font-style: italic; }
.po-note:hover, .po-note:focus { background: var(--popout-card); }
.msg.ignored-msg { display: flex; align-items: center; gap: 8px; min-height: 32px; margin-top: 8px; color: var(--muted); font-size: 13px; }
.msg.ignored-msg .ico { color: var(--faint); }

/* ---- files waiting in the message box */
.composer.has-tray { flex-wrap: wrap; }
.attach-tray {
  flex: 0 0 100%; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; padding: 18px 10px 12px 16px;
  border-bottom: 1px solid var(--sep);
}
.att-card {
  position: relative; width: 200px; padding: 8px; border-radius: 8px; background: var(--bg-side);
  display: flex; flex-direction: column; gap: 8px;
}
.att-thumb { position: relative; height: 170px; border-radius: 4px; overflow: hidden; display: grid; place-items: center; background: var(--bg-deep); }
.att-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.att-file { color: var(--icon); display: grid; place-items: center; }
.att-card.spoiler .att-thumb img { filter: blur(24px); transform: scale(1.1); }
.att-name { color: var(--text); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-tools {
  position: absolute; top: -10px; right: -10px; display: flex; padding: 2px; border-radius: 6px;
  background: var(--bg-float); box-shadow: 0 0 0 1px var(--border), 0 2px 8px var(--shadow);
}
.icon-btn.att-tool { width: 32px; height: 32px; }
.icon-btn.att-tool.danger { color: var(--red); }
.icon-btn.att-tool.danger:hover { background: rgba(242, 63, 67, 0.12); color: var(--red); }
.att-meta { flex: 0 0 100%; color: var(--muted); font-size: 12px; margin-top: -6px; }
.att-modal { width: min(480px, 100%); }
.att-modal-img { display: grid; place-items: center; max-height: 220px; overflow: hidden; border-radius: 8px; background: var(--bg-deep); margin-bottom: 4px; }
.att-modal-img img { max-width: 100%; max-height: 220px; object-fit: contain; }
.att-spoiler { margin-top: 18px; }
.spoiler-tag {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 6px 12px; border-radius: 16px;
  background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 13px; font-weight: 800; letter-spacing: 0.06em; pointer-events: none;
}
/* Sent messages: several images in a grid, spoilers blurred until clicked. */
.attach-grid { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 4px; }
.attach-grid.multi { flex-direction: row; flex-wrap: wrap; max-width: 560px; }
.attach-img-wrap { position: relative; overflow: hidden; }
.attach-img-wrap.spoiler .attach-img { filter: blur(36px); transform: scale(1.1); }
.attach-img-wrap.spoiler { cursor: pointer; }

/* ---- red count badges: numbers exactly centred (equal-width digits; nudge for the font's baseline) */
.rail-badge.count, .mention-count, .nav-count, .fr-count, .st-nav-badge { font-variant-numeric: tabular-nums; }
.rail-badge.count { padding-bottom: 1px; }

/* ---- editing messages */
.msg-edited { color: var(--faint); font-size: 11px; user-select: none; white-space: nowrap; }
.edit-wrap { margin: 4px 0 2px; }
.edit-box { padding: 10px 14px; border-radius: 8px; background: var(--bg-input); }
.edit-input {
  display: block; width: 100%; min-height: 22px; max-height: 300px; border: 0; outline: 0; padding: 0; resize: none;
  background: none; color: var(--text); font: var(--chat-font, 15px)/1.375 var(--font);
}
.edit-hint { margin-top: 4px; color: var(--muted); font-size: 12px; }
.edit-hint .auth-link { font-size: 12px; }

/* ---- unread DMs / group chats under the Home button */
.rail-item.rail-chat { background: none; padding: 0; }
.rail-item.rail-chat:hover { background: none; }
.rail-chat .avatar.rail-av, .rail-chat .rail-group {
  width: 48px; height: 48px; border-radius: 50%; font-size: 16px; transition: border-radius 0.15s ease;
}
.rail-chat:hover .avatar.rail-av, .rail-chat:hover .rail-group { border-radius: 16px; }
.rail-chat .avatar.rail-av.has-img img { border-radius: inherit; }
.rail-group { display: grid; place-items: center; color: #fff; }

/* ---- role picker ("+ Add role") and removable role chips */
.role-picker {
  position: fixed; z-index: 260; width: 260px; padding: 8px; border-radius: 10px;
  background: var(--bg-float); box-shadow: 0 8px 24px var(--shadow), 0 0 0 1px var(--border); animation: pop 0.1s ease;
}
.rp-input {
  width: 100%; height: 36px; padding: 0 10px; border: 2px solid var(--accent); border-radius: 8px; outline: 0;
  background: var(--bg-deep); color: var(--text); font: 15px var(--font);
}
.rp-input::placeholder { color: var(--muted); }
.rp-list { max-height: 240px; overflow-y: auto; margin-top: 6px; display: flex; flex-direction: column; }
.rp-row {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border: 0; border-radius: 6px;
  background: none; color: var(--text); font-size: 15px; text-align: left; cursor: pointer;
}
.rp-row:hover, .rp-row:focus-visible { background: var(--bg-hover); color: var(--strong); }
.rp-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-empty { padding: 10px; color: var(--muted); font-size: 13px; }
.rp-head { padding: 8px 10px 4px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.rp-sub { color: var(--faint); font-size: 12px; }
.rp-row .avatar { flex: none; }

/* ---------------------------------------------------------------- channel permissions */
.cp-private { margin-bottom: 26px; border-radius: 10px; background: var(--bg-side); overflow: hidden; }
.cp-private-top { display: flex; align-items: flex-start; gap: 12px; padding: 16px; }
.cp-private-top > svg { margin-top: 2px; color: var(--icon); flex: none; }
.cp-private-top > .st-toggle { flex: 1; }
.cp-access:not(:empty) { padding: 4px 16px 14px; border-top: 1px solid var(--sep); background: rgba(0, 0, 0, 0.12); }
.cp-access-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.cp-access-head strong { color: var(--strong); font-size: 15px; }
.cp-access-head .btn { height: 34px; padding: 0 16px; }
.cp-group-label { padding: 12px 0 4px; border-top: 1px solid var(--sep); color: var(--text); font-size: 14px; font-weight: 700; }
.cp-row { display: flex; align-items: center; gap: 10px; min-height: 38px; color: var(--text); font-size: 15px; }
.cp-row .ro-dot { width: 18px; height: 18px; }
.cp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-tag { color: var(--muted); font-size: 13px; }
.cp-x { width: 20px; height: 20px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--chip-hover); color: var(--muted); cursor: pointer; flex: none; }
.cp-x:hover { background: var(--red); color: #fff; }
.cp-none { margin: 4px 0 6px; font-size: 13px; }
.cp-adv-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 18px 0 14px; border: 0; border-top: 1px solid var(--sep); background: none; color: var(--strong); font: inherit; font-size: 20px; font-weight: 700; cursor: pointer; text-align: left; }
.cp-adv-chev { transition: transform .15s ease; }
.cp-adv-head.closed .cp-adv-chev { transform: rotate(-90deg); }
.cp-adv { display: grid; grid-template-columns: 210px 1fr; gap: 24px; align-items: start; }
.cp-adv[hidden] { display: none; }
.cp-targets { position: sticky; top: 0; display: flex; flex-direction: column; gap: 2px; padding-right: 14px; border-right: 1px solid var(--sep); }
.cp-targets-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.cp-add { width: 24px; height: 24px; border: 0; border-radius: 50%; display: grid; place-items: center; background: none; color: var(--muted); cursor: pointer; }
.cp-add:hover { color: var(--strong); background: var(--bg-hover); }
.cp-target { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 6px 10px; border: 0; border-radius: 6px; background: none; color: var(--muted); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.cp-target:hover { background: var(--bg-hover); color: var(--text); }
.cp-target.on { background: var(--bg-active); color: var(--strong); }
.cp-target .ro-dot { width: 12px; height: 12px; flex: none; }
.cp-target-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-perms-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; color: var(--muted); font-size: 14px; }
.cp-perms-head strong { color: var(--strong); }
.cp-group-title { margin: 18px 0 6px; color: var(--strong); font-size: 18px; font-weight: 700; }
.cp-perm { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--sep); }
.cp-perm-text strong { display: block; color: var(--strong); font-size: 15px; font-weight: 600; }
.cp-perm-text p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.cp-tri { flex: none; display: flex; border-radius: 6px; box-shadow: 0 0 0 1px var(--chip-border); overflow: hidden; }
.cp-tri-btn { width: 32px; height: 28px; border: 0; display: grid; place-items: center; background: transparent; cursor: pointer; }
.cp-tri-btn + .cp-tri-btn { box-shadow: -1px 0 0 var(--chip-border); }
.cp-tri-btn:disabled { cursor: default; }
.cp-tri-btn.deny { color: var(--red); }
.cp-tri-btn.allow { color: var(--green); }
.cp-tri-btn.inherit { color: var(--text); }
.cp-slash { font-size: 15px; font-weight: 700; line-height: 1; }
.cp-tri-btn:hover:not(:disabled):not(.on) { background: var(--bg-hover); }
.cp-tri-btn.deny.on { background: var(--red); color: #fff; }
.cp-tri-btn.inherit.on { background: var(--chip-hover); color: var(--strong); }
.cp-tri-btn.allow.on { background: var(--green); color: #fff; }
.cp-tri-btn svg { stroke-width: 2.6; }
.cp-foot { margin-top: 16px; font-size: 13px; }
.role-dot-x {
  width: 12px; height: 12px; border: 0; padding: 0; border-radius: 50%; flex-shrink: 0; background: var(--rc);
  display: grid; place-items: center; color: transparent; cursor: pointer;
}
.role-chip.removable:hover .role-dot-x { color: #fff; background: var(--bg-active); }
.role-dot-x .ico { stroke-width: 3; }
.po-add-role {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 6px; margin-left: -6px;
  border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer;
}
.po-add-role:hover { color: var(--strong); background: var(--bg-hover); }

/* ---- profile bar floating under the server list + channel list (new Discord layout) */
@media (min-width: 761px) {
  .app { position: relative; --dock-h: 56px; }
  .side-dock {
    position: absolute; left: 8px; bottom: 8px; width: calc(72px + 240px - 16px); z-index: 6;
    border-radius: 10px; overflow: hidden; background: var(--bg-panel);
    box-shadow: 0 0 0 1px var(--border), 0 4px 16px rgba(0, 0, 0, 0.3);
  }
  .side-dock .user-panel { height: 56px; padding: 0 8px 0 6px; background: none; }
  .side-dock .voice-panel { background: none; }
  /* Leave room so the last servers / channels can scroll above the panel. */
  .rail { padding-bottom: calc(var(--dock-h) + 20px); }
  .sidebar .side-scroll { padding-bottom: calc(var(--dock-h) + 20px); }
}
.side-dock .voice-panel.hidden { display: none; }

/* ------------------------------------------------------------ smaller screens */

@media (max-width: 1100px) {
  .app, .app.hide-members { grid-template-columns: 72px 240px minmax(0, 1fr); }
  .members { display: none; }
}

@media (max-width: 760px) {
  .app, .app.hide-members { grid-template-columns: minmax(0, 1fr); }
  .rail, .sidebar { position: fixed; top: 0; bottom: 0; z-index: 60; transform: translateX(-320px); transition: transform 0.2s ease; }
  .desktop .rail, .desktop .sidebar { top: 30px; }
  .rail { left: 0; width: 72px; }
  .sidebar { left: 72px; width: min(260px, calc(100vw - 72px)); border-radius: 0; }
  .app.nav-open .rail, .app.nav-open .sidebar { transform: none; }
  .main { grid-column: 1; }
  .mobile-only { display: grid; }
  .e2e, .hd-divider, .hd-search { display: none; }
  .msg { padding-right: 16px; }
}
