/* Grey is the default. Black and white override these on html[data-theme]. */
:root {
  color-scheme: dark;
  --bg: #313338;
  --sidebar: #2b2d31;
  --sidebar-2: #232428;
  --hover: #35373c;
  --active: #404249;
  --text: #f2f3f5;
  --muted: #949ba4;
  --soft: #b5bac1;
  --accent: #5865f2;
  --accent-2: #4752c4;
  --danger: #da373c;
  --danger-text: #ffb4b4;
  --ok: #23a559;
  --line: #1e1f22;
  --input: #1e1f22;
  --panel: #111214;
  --border: #3f4147;
  --scroll: #1a1b1e;
  --scroll-hover: #0e0f11;
  --link: #8ab4ff;
  --badge: #c9cdfb;
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-strong: rgba(255, 255, 255, 0.12);
  --wash: rgba(255, 255, 255, 0.06);
  --log-warn: #f0d090;
  --log-connect: #9eb0ff;
  --log-status: #8be0ad;
  --rule: rgba(0, 0, 0, 0.28);
  --inset: rgba(0, 0, 0, 0.18);
  --dock: rgba(30, 31, 34, 0.94);
  --radius: 8px;
  --ww-text-scale: 1;
  --ww-emoji-scale: 1;
  --ww-custom-primary: #313338;
  --ww-custom-secondary: #5865f2;
  --ww-custom-text: #f2f3f5;
  --ww-custom-muted: #c7ccd1;
  font-family: "gg sans", "Segoe UI", system-ui, sans-serif;
}
html[data-theme="black"] {
  color-scheme: dark;
  --bg: #000000;
  --sidebar: #0c0c0c;
  --sidebar-2: #070707;
  --hover: #171717;
  --active: #242424;
  --text: #f4f4f4;
  --muted: #9a9a9a;
  --soft: #cfcfcf;
  --line: #1a1a1a;
  --input: #101010;
  --panel: #070707;
  --border: #2a2a2a;
  --scroll: #333333;
  --scroll-hover: #4a4a4a;
  --link: #9eb0ff;
  --badge: #c9cdfb;
  --hairline: rgba(255, 255, 255, 0.1);
  --hairline-strong: rgba(255, 255, 255, 0.16);
  --wash: rgba(255, 255, 255, 0.06);
  --rule: rgba(255, 255, 255, 0.1);
  --inset: rgba(255, 255, 255, 0.04);
  --dock: rgba(0, 0, 0, 0.92);
}
html[data-theme="white"] {
  color-scheme: light;
  --bg: #ffffff;
  --sidebar: #f2f3f5;
  --sidebar-2: #e6e8ec;
  --hover: #e3e5e8;
  --active: #d7dae0;
  --text: #1e1f22;
  --muted: #5c6169;
  --soft: #3f4248;
  --line: #e1e3e8;
  --input: #ffffff;
  --panel: #ffffff;
  --border: #d4d7dc;
  --scroll: #c5c8ce;
  --scroll-hover: #a9adb6;
  --link: #1355c7;
  --badge: #3c45b5;
  --danger-text: #c4314b;
  --log-warn: #8a5a00;
  --log-connect: #1355c7;
  --log-status: #157a45;
  --hairline: rgba(0, 0, 0, 0.08);
  --hairline-strong: rgba(0, 0, 0, 0.14);
  --wash: rgba(0, 0, 0, 0.05);
  --rule: rgba(0, 0, 0, 0.1);
  --inset: rgba(0, 0, 0, 0.04);
  --dock: rgba(255, 255, 255, 0.94);
}
html[data-theme="custom"] {
  --ww-custom-grad: linear-gradient(180deg, var(--ww-custom-primary), var(--ww-custom-secondary));
  --bg: linear-gradient(var(--ww-custom-veil, rgba(0, 0, 0, 0.42)), var(--ww-custom-veil, rgba(0, 0, 0, 0.42))), var(--ww-custom-grad);
  --sidebar: linear-gradient(var(--ww-custom-veil, rgba(0, 0, 0, 0.42)), var(--ww-custom-veil, rgba(0, 0, 0, 0.42))), var(--ww-custom-grad);
  --sidebar-2: linear-gradient(var(--ww-custom-veil-deep, rgba(0, 0, 0, 0.72)), var(--ww-custom-veil-deep, rgba(0, 0, 0, 0.72))), var(--ww-custom-grad);
  --panel: linear-gradient(var(--ww-custom-veil-deep, rgba(0, 0, 0, 0.72)), var(--ww-custom-veil-deep, rgba(0, 0, 0, 0.72))), var(--ww-custom-grad);
  --input: linear-gradient(var(--ww-custom-veil-deep, rgba(0, 0, 0, 0.72)), var(--ww-custom-veil-deep, rgba(0, 0, 0, 0.72))), var(--ww-custom-grad);
  --inset: linear-gradient(var(--ww-custom-veil-deep, rgba(0, 0, 0, 0.72)), var(--ww-custom-veil-deep, rgba(0, 0, 0, 0.72))), var(--ww-custom-grad);
  --dock: linear-gradient(var(--ww-custom-veil-deep, rgba(0, 0, 0, 0.72)), var(--ww-custom-veil-deep, rgba(0, 0, 0, 0.72))), var(--ww-custom-grad);
  --text: var(--ww-custom-text);
  --muted: var(--ww-custom-muted);
  --soft: var(--ww-custom-text);
  --border: var(--ww-custom-outline, var(--ww-custom-secondary));
  --line: var(--ww-custom-outline, var(--ww-custom-secondary));
  --accent: var(--ww-custom-secondary);
  --accent-2: var(--ww-custom-secondary);
  --active: var(--ww-custom-secondary);
  --hover: var(--ww-custom-secondary);
  --hairline: var(--ww-custom-outline, var(--ww-custom-secondary));
  --hairline-strong: var(--ww-custom-outline, var(--ww-custom-secondary));
  --link: var(--ww-custom-secondary);
  --badge: var(--ww-custom-secondary);
}


* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; background: var(--bg); color: var(--text); }

/* Thin dark scrollbars (Firefox + Chromium/WebKit) instead of stock OS bars. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll) transparent;
}
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: var(--scroll);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-hover);
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-corner {
  background: transparent;
}

/* Do not rely on the hidden attribute alone — .login-panel sets display:grid and can win. */
.view-hidden { display: none !important; }
button, input, textarea { font: inherit; }
/* Global input padding plus border-box collapses a range hit target so the thumb will not move. */
input[type="range"] {
  box-sizing: content-box;
  width: 100%;
  height: 1.25rem;
  margin: 0.15rem 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  accent-color: var(--accent);
  cursor: pointer;
}
button {
  border: 0;
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
button:hover { background: var(--accent-2); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
label,
summary,
select,
input[type="checkbox"],
input[type="radio"] {
  cursor: pointer;
}
input[type="checkbox"]:disabled,
input[type="radio"]:disabled,
select:disabled {
  cursor: default;
}
button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
}
button.ghost:hover { color: var(--text); background: var(--hover); }
button.danger { background: var(--danger); }
button.danger:hover { filter: brightness(1.05); }
button.small { padding: 0.4rem 0.65rem; font-size: 0.8rem; }
input {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text);
  padding: 0.7rem 0.8rem;
}
.error {
  color: #fff;
  background: #da373c;
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  font-weight: 600;
  line-height: 1.35;
}
.sub, .hint { color: var(--muted); margin: 0; }
.hint { font-size: 0.9rem; }
#login-form { display: grid; gap: 0.85rem; }
#login-main-fields,
#login-verify-wrap { display: grid; gap: 0.85rem; }
#login-main-fields[hidden],
#login-main-fields.view-hidden,
#login-verify-wrap[hidden],
#login-verify-wrap.view-hidden { display: none !important; }
.login-verify-copy {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.45;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
}
.auth-secondary-btn {
  appearance: none;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
}
.auth-secondary-btn:hover { background: var(--hover); }
.auth-secondary-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  color: #8ea1ff;
  font-weight: 700;
  text-decoration: none;
  padding: 0.2rem 0;
}
.auth-secondary-link:hover { text-decoration: underline; }
.auth-tab:disabled {
  opacity: 0.55;
  cursor: default;
}

.login-panel {
  position: relative;
  isolation: isolate;
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--bg);
  overflow: hidden;
}
.login-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(11, 11, 15, 0.62), rgba(11, 11, 15, 0.82)),
    url("assets/login-bg.jpg?v=247") center / cover no-repeat;
  opacity: 0.55;
  pointer-events: none;
}
.login-card {
  width: min(400px, 100%);
  background: rgba(30, 31, 34, 0.94);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.5rem;
  display: grid;
  gap: 0.85rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
html[data-theme="white"] .login-card {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(0, 0, 0, 0.08);
}
html[data-theme="black"] .login-card {
  background: rgba(12, 12, 12, 0.94);
  border-color: rgba(255, 255, 255, 0.1);
}
.login-card #login-form input {
  background: var(--input);
  border: 1px solid var(--border);
  color: var(--text);
}
.login-card #login-form input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.22);
}
html[data-theme="white"] .login-card #login-form input {
  background: #ffffff;
  border-color: var(--border);
  color: var(--text);
}
#login-status[hidden],
#login-status:empty {
  display: none !important;
}
html[data-theme="black"] .login-panel::before {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.88)),
    url("assets/login-bg.jpg?v=247") center / cover no-repeat;
}
.login-logo {
  display: block;
  width: min(220px, 70%);
  height: auto;
  margin: 0.15rem auto 0.1rem;
  object-fit: contain;
}
.login-card .sub {
  text-align: center;
}
.install-app-btn {
  appearance: none;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
}
.install-app-btn:hover { background: var(--hover); }
.install-app-btn[hidden],
.install-app-btn.view-hidden { display: none !important; }
.login-card label { display: grid; gap: 0.35rem; font-size: 0.85rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.2rem;
  border-radius: 10px;
  background: var(--inset);
}
.auth-tab {
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}
.auth-tab.active {
  background: #5865f2;
  color: #fff;
  box-shadow: 0 2px 10px rgba(88, 101, 242, 0.35);
}
.auth-optional {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  opacity: 0.75;
}
.login-card label.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.4;
  cursor: pointer;
}
.login-card label.auth-check input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0.18rem 0 0;
  padding: 0;
  flex: 0 0 auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  accent-color: var(--accent);
  cursor: pointer;
}
.login-card label.auth-check > span {
  flex: 1 1 auto;
  min-width: 0;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
  color: var(--text);
}
.login-card label.auth-check a {
  color: #8ea1ff;
  text-decoration: underline;
}

.shell {
  height: 100%;
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
}
.sidebar,
.main,
.members-rail {
  grid-row: 1;
}
.sidebar { grid-column: 1; }
.main { grid-column: 2; }
.shell.members-open {
  grid-template-columns: 260px 1fr 300px;
}

.sidebar {
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
}
.side-head {
  padding: 0;
  font-size: 1rem;
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 5;
  overflow: visible;
}
.community-banner {
  position: relative;
  width: 100%;
  height: 88px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--sidebar) 0%, var(--input) 55%, #5865f2 160%);
  border-bottom: 1px solid var(--rule);
}
.community-banner.has-image {
  background: var(--input);
}
.community-banner-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.community-switcher {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  position: relative;
  padding: 0.55rem 0.65rem;
}
.community-btn {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  background: transparent;
  border: 0;
  color: var(--text, #f2f3f5);
  font: inherit;
  font-weight: 700;
  padding: 0.4rem 0.45rem;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
}
.community-btn:hover,
.community-btn[aria-expanded="true"] {
  background: var(--wash);
}
.community-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.community-chevron {
  opacity: 0.7;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}
.community-chevron svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}
.community-browse-btn,
.community-gear {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted, var(--soft));
  cursor: pointer;
  padding: 0;
}
/* display:inline-flex above beats the UA [hidden] rule — keep gear invisible when gated. */
.community-gear[hidden],
.community-gear.view-hidden {
  display: none !important;
}
.community-browse-btn svg,
.community-gear svg {
  width: 1.05rem;
  height: 1.05rem;
}
.community-browse-btn:hover,
.community-gear:hover {
  background: var(--wash);
  color: var(--text, #f2f3f5);
}
.community-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  background: var(--input);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  padding: 0.35rem;
  z-index: 40;
  max-height: min(50vh, 22rem);
  overflow: auto;
}
.community-menu-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.community-menu-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 0.5rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
}
.community-menu-item:hover,
.community-menu-item.active {
  background: rgba(88, 101, 242, 0.28);
}
.community-menu-check {
  width: 0.9rem;
  color: var(--soft);
  flex-shrink: 0;
}
.community-menu-item.active .community-menu-check {
  color: #fff;
}
.community-add-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  margin-top: 0.25rem;
  border: 0;
  border-top: 1px solid var(--hairline);
  background: transparent;
  color: var(--soft);
  text-align: left;
  padding: 0.55rem;
  border-radius: 0 0 6px 6px;
  cursor: pointer;
  font: inherit;
}
.community-add-btn:hover {
  background: var(--wash);
}
.community-add-icon {
  display: inline-flex;
  width: 1.35rem;
  height: 1.35rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--hairline-strong);
  font-weight: 700;
}
.community-menu-item.is-den {
  margin-top: 0.2rem;
  border-top: 1px solid var(--hairline);
  border-radius: 0 0 6px 6px;
}
.community-menu-count {
  margin-left: auto;
  min-width: 1.2rem;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: rgba(88, 101, 242, 0.45);
  color: #fff;
  font-size: 0.72rem;
  text-align: center;
}
.channel-board[hidden],
.channel-board.view-hidden,
.den-panel[hidden],
.den-panel.view-hidden,
.den-form[hidden],
.den-form.view-hidden,
.den-empty[hidden],
.den-empty.view-hidden,
.den-actions button[hidden],
.den-actions button.view-hidden,
#den-error[hidden],
#den-error.view-hidden {
  display: none !important;
}
.den-panel {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.den-note,
.den-empty {
  margin: 0 0.5rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}
.den-toolbar {
  display: flex;
  gap: 0.35rem;
  margin: 0 0.35rem;
}
.den-toolbar button,
.den-modal-form button,
.den-link-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 6px;
  background: var(--wash);
  color: inherit;
  font: inherit;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
}
.den-ico {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  display: block;
}
.den-toolbar button:hover,
.den-modal-form button:hover,
.den-link-row button:hover {
  background: rgba(88, 101, 242, 0.28);
}
.den-modal-form button.den-delete {
  background: var(--danger);
  color: #fff;
}
.den-modal-form button.den-delete:hover {
  background: var(--danger);
  filter: brightness(1.05);
}
#den-invite-user-row[hidden],
#den-invite-user-row.view-hidden,
#den-reset-link[hidden],
#den-reset-link.view-hidden,
#den-create-error[hidden],
#den-create-error.view-hidden,
#den-edit-error[hidden],
#den-edit-error.view-hidden,
#den-invite-error[hidden],
#den-invite-error.view-hidden,
.den-invite-suggest[hidden],
.den-invite-suggest.view-hidden {
  display: none !important;
}
.den-modal {
  width: min(28rem, calc(100vw - 2rem));
}
.den-modal-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.den-modal-form input,
.den-link-row input {
  width: 100%;
  min-width: 0;
  background: var(--input, #1e1f22);
  color: inherit;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 0.5rem 0.6rem;
  font: inherit;
}
.den-invite-suggest {
  list-style: none;
  margin: 0;
  padding: 0.2rem;
  max-height: 9.5rem;
  overflow: auto;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: var(--panel, #111214);
}
.den-invite-suggest button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  width: 100%;
  text-align: left;
  background: transparent;
  border-radius: 4px;
  padding: 0.28rem 0.4rem;
}
.den-invite-suggest button.is-active,
.den-invite-suggest button:hover {
  background: #5865f2;
  color: #fff;
}
.den-link-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.den-link-row {
  display: flex;
  gap: 0.35rem;
}
.den-link-row input {
  flex: 1;
}
.den-list .voice-channel {
  position: relative;
}
.den-list .voice-channel > button.channel-btn {
  padding-right: 2.15rem;
}
.den-list .voice-channel.den-can-edit > button.channel-btn {
  padding-right: 3.85rem;
}
.den-channel-tools {
  position: absolute;
  top: 0.28rem;
  right: 0.15rem;
  display: flex;
  gap: 0.1rem;
  z-index: 1;
}
.den-channel-tool {
  width: 1.55rem;
  height: 1.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.den-channel-tool:hover {
  background: rgba(88, 101, 242, 0.28);
  color: var(--text);
}
.den-channel-tool svg {
  width: 0.95rem;
  height: 0.95rem;
  display: block;
}
.den-invite-people {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 12rem;
  overflow: auto;
}
.den-invite-person {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
  background: var(--wash);
  font-size: 0.86rem;
}
.den-invite-person span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.den-invite-person button {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex: 0 0 auto;
  padding: 0.2rem 0.45rem;
}
.den-form {
  display: flex;
  gap: 0.35rem;
  margin: 0 0.35rem;
}
.den-form input {
  flex: 1;
  min-width: 0;
  background: var(--input, #1e1f22);
  color: inherit;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 0.4rem 0.5rem;
  font: inherit;
}
.den-form button,
.den-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 6px;
  background: var(--wash);
  color: inherit;
  font: inherit;
  padding: 0.4rem 0.65rem;
  cursor: pointer;
}
.den-form button:hover,
.den-actions button:hover {
  background: rgba(88, 101, 242, 0.28);
}
.den-people {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0 0.35rem;
}
.den-person {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  background: var(--wash);
  font-size: 0.78rem;
}
.den-person button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0 0.1rem;
  font: inherit;
  line-height: 1;
}
.den-actions {
  display: flex;
  gap: 0.35rem;
  margin: 0 0.35rem 0.25rem;
}
#den-error {
  margin: 0 0.5rem;
}
.side-section {
  padding: 0.75rem 0.5rem 1rem;
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.cat {
  margin: 0 0 0.35rem 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.cat.text-cat {
  margin-top: 1rem;
}

.voice-list,
.text-list,
.channel-list,
.members-list,
.private-call-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cat-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: calc(100% - 0.35rem);
  margin: 0.85rem 0.15rem 0.2rem;
  padding: 0.12rem 0.35rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}
.channel-board .cat-toggle:first-child { margin-top: 0.1rem; }
.cat-toggle:hover { color: var(--text); }
.cat-chevron {
  display: inline-block;
  width: 0.7rem;
  font-size: 0.65rem;
  line-height: 1;
}
.cat-toggle.is-collapsed .cat-chevron { transform: rotate(-90deg); }
.private-call-section {
  margin-top: 0.15rem;
}
.members-rail {
  display: none;
  grid-column: 3;
  background: var(--sidebar);
  border-left: 1px solid var(--line);
  min-width: 0;
  min-height: 0;
  flex-direction: column;
}
.shell.members-open .members-rail {
  display: flex;
}
.members-rail-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.85rem 0.85rem 0.55rem;
  border-bottom: 1px solid var(--rule);
}
.members-rail-title {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.members-count {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}
.members-rail-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.15rem;
}
.members-filter-btn,
.members-rail-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  padding: 0;
}
.members-filter-btn svg,
.members-rail-close svg {
  width: 0.95rem;
  height: 0.95rem;
  display: block;
}
.members-filter-btn:hover,
.members-rail-close:hover {
  background: var(--wash);
  color: var(--text);
}
.members-filter-btn.is-open,
.members-filter-btn.is-active {
  color: #fff;
  background: rgba(88, 101, 242, 0.28);
}
.members-filter-panel {
  display: grid;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem 0.7rem;
  border-bottom: 1px solid var(--rule);
  background: var(--inset);
}
.members-filter-search {
  display: grid;
  gap: 0.3rem;
}
.members-filter-label {
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.members-filter-search input {
  width: 100%;
  box-sizing: border-box;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text);
  padding: 0.45rem 0.55rem;
  font-size: 0.85rem;
}
.members-filter-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.members-filter-check input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  accent-color: var(--accent);
  cursor: pointer;
}
.members-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.45rem 0.4rem 0.75rem;
  list-style: none;
  margin: 0;
}
.members-empty {
  padding: 0.75rem 0.65rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}
.member-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0.42rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
}
.member-row:hover {
  background: var(--hover);
}
.member-row.is-self {
  opacity: 0.85;
}
.member-row.is-offline {
  color: var(--muted);
}
.member-row.is-offline .member-name {
  opacity: 0.78;
}
.member-avatar-wrap {
  position: relative;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
}
.member-avatar-wrap .avatar.sm {
  width: 36px;
  height: 36px;
  font-size: 0.95rem;
}
.member-status-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 3px solid var(--sidebar);
  background: #80848e;
  box-sizing: border-box;
}
.member-status-dot.online {
  background: var(--ok);
}
.member-status-dot.offline {
  background: #80848e;
}
.member-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
}
.member-row .member-name {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.92rem;
}
.member-flags {
  display: inline-flex;
  gap: 0.25rem;
  margin-top: 0.1rem;
}
.member-flag {
  display: inline-block;
  padding: 0 0.32rem;
  border-radius: 0.25rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.45;
}
.member-flag.is-minor {
  background: #f0b232;
  color: #1e1f22;
}
.member-flag.is-muted {
  background: #da373c;
  color: #fff;
}
.member-flag.is-dev {
  background: #da373c;
  color: #fff;
  letter-spacing: 0.04em;
}
.member-flag.is-bot {
  background: #5865f2;
  color: #fff;
  letter-spacing: 0.04em;
}
.member-flag.is-suspect {
  background: #e67e22;
  color: #1e1f22;
}
.member-menu-section {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 0.25rem;
  padding-top: 0.25rem;
}
.member-menu-label {
  padding: 0.2rem 0.75rem 0.15rem;
  color: var(--muted, #b5bac1);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.suspect-resolve {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 16, 20, 0.92);
}
.suspect-resolve-card {
  width: min(28rem, 100%);
  padding: 1.4rem 1.5rem 1.3rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #1e1f22;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  text-align: center;
}
.suspect-resolve-card h2 {
  margin: 0 0 0.55rem;
  font-size: 1.25rem;
}
.suspect-resolve-card p {
  margin: 0 0 1rem;
  color: var(--muted, #b5bac1);
  line-height: 1.45;
}
.member-status-line {
  max-width: 100%;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.member-row.is-offline .member-status-line {
  color: #fff;
  opacity: 1;
}
.member-status-line:empty {
  display: none;
}
html[data-theme="white"] .member-status-line,
html[data-theme="white"] .member-row.is-offline .member-status-line {
  color: #1e1f22;
}
.members-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem 0.15rem;
}
.members-tab {
  width: auto;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 0.38rem 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
}
.members-tab:hover {
  background: var(--hover);
  color: var(--text);
}
.members-tab.is-current {
  background: var(--active);
  color: var(--text);
}
.chat-msg .who[data-profile],
.chat-msg .chat-avatar[data-profile],
.chat-mention[data-profile],
.occupant-name[data-profile],
.occupants li .avatar[data-profile],
.member-name[data-profile],
.member-avatar-wrap[data-profile] {
  cursor: pointer;
}
/* #186: keyboard path to the profile card (separate from the DM row button). */
.members-list .member-item {
  position: relative;
}
.member-profile-btn {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  /* Invisible means unclickable: no stray hits on the row's right edge. */
  pointer-events: none;
}
.member-item:hover .member-profile-btn,
.member-item:focus-within .member-profile-btn,
.member-profile-btn:focus-visible {
  opacity: 1;
  pointer-events: auto;
}
/* Touch / no-hover pointers never get :hover, so the button is always shown. */
@media (hover: none), (pointer: coarse) {
  .member-profile-btn {
    opacity: 1;
    pointer-events: auto;
  }
}
.member-profile-btn:hover {
  color: var(--text);
  background: var(--hover);
}
.member-profile-btn:focus-visible,
.chat-msg .who[data-profile][role="button"]:focus-visible,
.occupant-name[data-profile][role="button"]:focus-visible {
  outline: 2px solid var(--accent, #3fa9f5);
  outline-offset: 2px;
  border-radius: 4px;
}
.mini-profile {
  position: fixed;
  z-index: 80;
  width: 300px;
  max-width: calc(100vw - 16px);
  background: var(--panel);
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  color: var(--text);
}
.mini-profile-banner {
  height: 60px;
  background: var(--wash);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.mini-profile-avatar-ring {
  width: 80px;
  height: 80px;
  margin: -40px 0 0 12px;
  border-radius: 50%;
  background: var(--panel);
  padding: 3px;
  box-sizing: border-box;
  display: grid;
  place-items: center;
}
.mini-profile-avatar-ring .avatar {
  width: 74px;
  height: 74px;
  font-size: 1.65rem;
}
.mini-profile-body {
  padding: 0.15rem 0.9rem 0.85rem;
}
.mini-profile-name {
  color: hsl(var(--who-h, 190), 72%, 64%);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.2;
  word-break: break-word;
}
html[data-theme="white"] .mini-profile-name {
  color: hsl(var(--who-h, 190), 68%, 32%);
}
.mini-profile-status {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0.2rem 0 0.65rem;
}
.mini-profile-note {
  margin: 0 0 0.55rem;
  color: var(--danger-text, #ff8e8e);
  font-size: 0.78rem;
}
.mini-profile-note[hidden],
.mini-profile-actions button[hidden] {
  display: none !important;
}
.mini-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.mini-profile-actions button {
  width: auto;
  flex: 1 1 calc(50% - 0.4rem);
  padding: 0.45rem 0.55rem;
  font-size: 0.82rem;
}
.mini-profile-break {
  flex-basis: 100%;
  width: 0;
  height: 0;
}
/* In-app WaterWolf profile card (#186). --pc-accent / --pc-accent-2 are set
   from validated website accents (hex/rgb) or the member's name hue. */
.profile-card {
  --pc-accent: hsl(190, 70%, 55%);
  --pc-accent-2: var(--pc-accent);
  position: fixed;
  z-index: 82;
  width: 340px;
  max-width: calc(100vw - 16px);
  max-height: min(600px, calc(100vh - 16px));
  display: flex;
  flex-direction: column;
  background: var(--panel);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--pc-accent) 16%, transparent), transparent 50%),
    var(--panel);
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  color: var(--text);
}
.profile-card[hidden],
.profile-card [hidden] {
  display: none !important;
}
.profile-card-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  /* Fixed neutral scrim: readable on any banner, never tinted by an accent. */
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.profile-card-close:hover {
  background: rgba(0, 0, 0, 0.75);
}
.profile-card-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.6);
}
.profile-card-scroll {
  overflow-y: auto;
  min-height: 0;
  flex: 1 1 auto;
}
.profile-card-banner {
  height: 120px;
  background-color: var(--pc-accent);
  background-image: linear-gradient(135deg, var(--pc-accent), var(--pc-accent-2));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.profile-card-avatar-ring {
  width: 96px;
  height: 96px;
  margin: -54px auto 0;
  border-radius: 50%;
  background: var(--panel);
  padding: 3px;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 2px var(--pc-accent);
  position: relative;
}
.profile-card-avatar-ring .avatar {
  width: 90px;
  height: 90px;
  font-size: 2rem;
}
.profile-card-body {
  padding: 0.4rem 1rem 1rem;
  text-align: center;
}
.profile-card-name {
  color: hsl(var(--who-h, 190), 72%, 64%);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.2;
  word-break: break-word;
}
html[data-theme="white"] .profile-card-name {
  color: hsl(var(--who-h, 190), 68%, 32%);
}
.profile-card-handle,
.profile-card-role {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.15rem;
  word-break: break-word;
}
.profile-card-role {
  letter-spacing: 0.04em;
}
.profile-card-pills {
  margin: 0.45rem 0 0.2rem;
}
.profile-card-status {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--wash);
  border: 1px solid var(--hairline-strong);
  background: color-mix(in srgb, var(--pc-accent) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--pc-accent) 45%, transparent);
}
.profile-card-status.is-error {
  color: var(--muted);
  background: var(--wash);
  border: 1px dashed var(--hairline-strong);
}
.profile-card-hero {
  margin-top: 0.7rem;
}
.profile-card-mood {
  color: var(--pc-accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.profile-card-headline {
  font-weight: 700;
  font-size: 1.05rem;
  margin-top: 0.15rem;
}
.profile-card-tagline {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}
.profile-card-mood,
.profile-card-headline,
.profile-card-tagline,
.profile-card-bio,
.profile-card-facts dd {
  word-break: break-word;
}
.profile-card-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
}
.profile-card-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  background: var(--wash);
  font-size: 0.78rem;
  color: var(--muted);
}
.profile-card-stat strong {
  color: var(--text);
  font-size: 0.92rem;
}
.profile-card-section {
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: var(--wash);
  text-align: left;
}
.profile-card-section h3 {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.profile-card-bio {
  margin: 0;
  font-size: 0.86rem;
  white-space: pre-line;
  user-select: text;
}
.profile-card-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.75rem;
  margin: 0;
  font-size: 0.82rem;
}
.profile-card-facts dt {
  color: var(--muted);
}
.profile-card-facts dd {
  margin: 0;
}
.profile-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.profile-card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  padding: 0.15rem 0.4rem;
  border-radius: 8px;
  background: var(--wash);
  background: color-mix(in srgb, var(--pc-accent) 14%, transparent);
  font-size: 0.75rem;
}
.profile-card-badge img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.profile-card-notice {
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.profile-card-notice-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 0.55rem;
}
.profile-card-notice-actions:not(:has(> :not([hidden]))) {
  margin-top: 0;
}
.profile-card-note {
  margin: 0.55rem 0 0;
  color: var(--danger-text, #ff8e8e);
  font-size: 0.78rem;
}
.profile-card-notice:empty,
.profile-card-note:empty {
  margin: 0;
}
/* Roles the member holds in the community the card was opened from. */
.profile-card-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.profile-card-rolechip {
  --role-color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  border: 1px solid var(--hairline-strong);
  background: var(--wash);
  background: color-mix(in srgb, var(--role-color) 14%, transparent);
  border-color: color-mix(in srgb, var(--role-color) 40%, transparent);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
}
.profile-card-rolechip > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-card-rolechip-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--role-color);
}
.profile-card-rolechip.is-owner {
  --role-color: #f0b232;
}

/* Card buttons reuse the app's .primary-btn / .ghost-btn; this pins one size
   and adds the card-only primary accent, danger and link variants. */
.profile-card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--hairline-strong);
  background: var(--panel);
}
.profile-card-footer > button,
.profile-card-notice-actions > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-width: 0;
  border-radius: 8px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-card-footer > button {
  flex: 1 1 0;
  min-height: 40px;
  padding: 0 12px;
  font-size: 0.875rem;
}
.profile-card-notice-actions > button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.8rem;
}
.profile-card button.primary-btn {
  /* Hairline edge so an accent close to the panel colour still reads as a button. */
  border: 1px solid var(--hairline-strong, rgba(255, 255, 255, 0.16));
  background: var(--accent, #5865f2);
  background: var(--pc-primary, var(--accent, #5865f2));
  color: #fff;
  color: var(--pc-primary-fg, #fff);
}
.profile-card button.primary-btn:hover:not(:disabled) {
  /* Background is unchanged on hover: the text contrast validated in
     profileCardPrimaryColors() must hold in every state. */
  background: var(--pc-primary, var(--accent, #5865f2));
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.16);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc-primary, var(--accent, #5865f2)) 40%, transparent);
}
.profile-card button.ghost-btn {
  border: 1px solid var(--hairline-strong);
  background: var(--wash);
  color: var(--text);
}
.profile-card button.ghost-btn:hover:not(:disabled) {
  background: var(--hover);
  border-color: var(--border);
}
.profile-card button.ghost-btn.is-danger {
  color: var(--danger-text, #ffb4b4);
  background: transparent;
  border-color: rgba(218, 55, 60, 0.5);
}
.profile-card button.ghost-btn.is-danger:hover:not(:disabled) {
  background: rgba(218, 55, 60, 0.14);
  border-color: var(--danger, #da373c);
}
/* Tertiary: compact link-style, full row, never wraps. */
.profile-card-footer > button.profile-card-link {
  flex: 1 1 100%;
  min-height: 36px;
  margin-top: -2px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--link, #8ab4ff);
  font-size: 0.8rem;
  font-weight: 600;
}
.profile-card-footer > button.profile-card-link:hover:not(:disabled) {
  background: var(--wash);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.profile-card-footer > button > span,
.profile-card-notice-actions > button > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-card-ext {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  opacity: 0.85;
}
.profile-card-footer > button:focus-visible,
.profile-card-notice-actions > button:focus-visible {
  outline: 2px solid var(--link, #8ab4ff);
  outline-offset: 2px;
}
.profile-card-footer > button:disabled,
.profile-card-notice-actions > button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: none;
}
.profile-card-footer > button[aria-busy="true"] {
  opacity: 0.85;
  cursor: progress;
}
.member-menu .danger-item,
.chat-menu .danger-item {
  color: #ff8e8e;
}
.voice-channel,
.text-channel {
  border-radius: 6px;
  margin-bottom: 0.15rem;
}
.voice-channel > button.channel-btn,
.text-channel > button.channel-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  padding: 0.45rem 0.55rem;
  text-align: left;
  border-radius: 6px;
}
.voice-channel > button.channel-btn:hover,
.text-channel > button.channel-btn:hover {
  background: var(--hover);
  color: var(--text);
}
.voice-channel.active > button.channel-btn,
.voice-channel.joined > button.channel-btn,
.voice-channel.selected > button.channel-btn,
.text-channel.selected > button.channel-btn {
  background: var(--active);
  color: var(--text);
}
.channel-icon {
  width: 1.1rem;
  text-align: center;
  opacity: 0.9;
}
.channel-icon.text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
}
.channel-icon.text svg {
  width: 1rem;
  height: 1rem;
  display: block;
}
.channel-title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.channel-call-timer {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.channel-mute-icon,
.channel-mute-toggle {
  flex: 0 0 auto;
  width: 0.95rem;
  height: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.channel-mute-toggle {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
  line-height: 0;
}
.channel-mute-toggle:hover,
.channel-mute-toggle:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}
.channel-mute-toggle.is-hover-only {
  opacity: 0;
}
.voice-channel:hover > button.channel-btn .channel-mute-toggle.is-hover-only,
.text-channel:hover > button.channel-btn .channel-mute-toggle.is-hover-only,
.voice-channel:focus-within > button.channel-btn .channel-mute-toggle.is-hover-only,
.text-channel:focus-within > button.channel-btn .channel-mute-toggle.is-hover-only,
.channel-mute-toggle.is-hover-only:focus-visible {
  opacity: 1;
}
.channel-mute-icon svg,
.channel-mute-toggle svg {
  width: 100%;
  height: 100%;
  display: block;
}
.voice-channel.is-muted > button.channel-btn,
.text-channel.is-muted > button.channel-btn {
  color: var(--muted);
}
.channel-badge {
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--badge);
  background: rgba(88, 101, 242, 0.22);
  border: 1px solid rgba(88, 101, 242, 0.35);
  border-radius: 999px;
  padding: 0.12rem 0.4rem;
  line-height: 1.2;
}
.text-channel.bridged > button.channel-btn {
  gap: 0.4rem;
}
.text-channel.unread > button.channel-btn,
.text-channel.unread > button.channel-btn:hover {
  color: #fff;
  font-weight: 700;
}
.text-channel.unread .channel-icon.text {
  opacity: 1;
  color: #fff;
}
.text-channel.unread .channel-title {
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.55);
}
html[data-theme="white"] .text-channel.unread > button.channel-btn,
html[data-theme="white"] .text-channel.unread > button.channel-btn:hover,
html[data-theme="white"] .text-channel.unread .channel-icon.text {
  color: var(--text);
}
html[data-theme="white"] .text-channel.unread .channel-title {
  text-shadow: none;
}
.channel-unread {
  flex: 0 0 auto;
  min-width: 1.15rem;
  height: 1.15rem;
  margin-left: 0.35rem;
  padding: 0 0.38rem;
  border-radius: 999px;
  background: #ed4245;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.15rem;
  text-align: center;
  text-shadow: none;
}
.occupants {
  list-style: none;
  margin: 0;
  padding: 0.15rem 0 0.35rem 1.85rem;
}
.occupants li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.28rem 0.4rem;
  border-radius: 4px;
  color: var(--text);
  font-size: 0.92rem;
  transition: background-color 0.12s ease, box-shadow 0.12s ease;
}
.occupants li:hover { background: var(--hover); }
.occupants li.can-drag { cursor: grab; }
.occupants li.can-drag:active { cursor: grabbing; }
.voice-channel.call-drop {
  outline: 2px solid #23a559;
  background: rgba(35, 165, 89, 0.16);
}
.occupants li.speaking {
  background: rgba(35, 165, 89, 0.28);
  box-shadow: inset 0 0 0 1px rgba(35, 165, 89, 0.55);
}
.occupants li .avatar,
.occupants li .avatar.sm {
  width: 36px;
  height: 36px;
  font-size: 0.95rem;
}
.occupant-id {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  flex: 1 1 auto;
  min-width: 0;
}
.occupants li .occupant-name {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff !important;
  font-family: inherit !important;
  font-style: normal !important;
  font-weight: inherit;
  letter-spacing: normal;
}
html[data-theme="white"] .occupants li .occupant-name {
  color: #1e1f22 !important;
}
.occupant-client {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 0.95rem;
  height: 0.95rem;
  color: rgba(255, 255, 255, 0.82);
}
html[data-theme="white"] .occupant-client {
  color: #1e1f22;
}
.occupant-client svg {
  width: 0.95rem;
  height: 0.95rem;
  display: block;
}
.occupant-flag {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 0.95rem;
  height: 0.95rem;
  color: #da373c;
}
.occupant-flag svg {
  width: 0.95rem;
  height: 0.95rem;
  display: block;
}
.occupant-live {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 0.05rem 0.32rem;
  border-radius: 4px;
  background: #da373c;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
}
.avatar {
  position: relative;
  width: 24px;
  height: 24px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex: 0 0 auto;
  align-self: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.avatar.sm { width: 22px; height: 22px; font-size: 0.65rem; }
.avatar.has-photo {
  background: transparent;
  padding: 0;
}
.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 50%;
}

.user-bar {
  margin-top: auto;
  background: var(--sidebar-2);
  padding: 0.55rem 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.user-chip { display: flex; align-items: center; gap: 0.55rem; min-width: 0; flex: 1 1 auto; }
.user-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  flex: 0 0 auto;
}
button.ghost.user-settings-btn {
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
}
button.ghost.user-settings-btn svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}
button.ghost.user-settings-btn:hover,
button.ghost.user-settings-btn[aria-expanded="true"] {
  color: var(--text);
  background: var(--hover);
}
.me-avatar-wrap {
  position: relative;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
}
.me-avatar-wrap .avatar {
  width: 36px;
  height: 36px;
  font-size: 0.95rem;
}
.me-avatar-wrap .member-status-dot {
  border-color: var(--sidebar-2);
}
.me-name { font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-status { font-size: 0.72rem; color: var(--ok); }
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--ok);
}
.status-dot.online { background: var(--ok); }
.status-dot.idle { background: #f0b232; }
.status-dot.dnd { background: #ed4245; }

.main {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
}
.main-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--rule);
}
.setup-banner[hidden] {
  display: none !important;
}
.setup-banner {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(88, 101, 242, 0.45);
  border-radius: 10px;
  background: rgba(88, 101, 242, 0.14);
}
.setup-banner p {
  margin: 0;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.35;
}
.setup-banner-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.4rem;
}
.setup-banner-actions button {
  padding: 0.4rem 0.7rem;
  font-size: 0.82rem;
}
body.dm-popout .setup-banner {
  display: none !important;
}
.main-head h1 {
  margin: 0;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.main-head h1::before {
  content: "🔊";
  font-size: 0.95rem;
}
.main-head.is-text h1::before {
  content: "";
  width: 0.95rem;
  height: 0.95rem;
  background: currentColor;
  opacity: 0.9;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 4h16a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H9l-4 4.2V15H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zm2 3.2v1.6h12V7.2H6zm0 3.4v1.6h8v-1.6H6z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 4h16a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H9l-4 4.2V15H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zm2 3.2v1.6h12V7.2H6zm0 3.4v1.6h8v-1.6H6z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.main-head-right {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}
.voice-status { color: var(--muted); font-size: 0.85rem; }
.call-debug {
  position: relative;
  z-index: 30;
}
.call-debug-btn {
  position: relative;
}
.call-debug-btn[aria-expanded="true"] {
  color: #fff;
  background: rgba(88, 101, 242, 0.28);
}
.call-debug-panel {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  width: min(20rem, calc(100vw - 1.5rem));
  padding: 0.6rem 0.7rem 0.65rem;
  background: var(--panel);
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}
.call-debug-panel.is-bad { border-color: #a51d2f; }
.call-debug-panel.is-good { border-color: #2d6a4f; }
.call-debug-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}
.call-debug-graph {
  display: block;
  width: 100%;
  height: 4.6rem;
  margin-top: 0.45rem;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 6px;
}
.call-debug-graph[hidden],
.call-debug-net[hidden] { display: none !important; }
.call-debug-net {
  margin: 0.35rem 0 0.45rem;
  color: var(--soft);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}
.call-debug-list {
  display: grid;
  grid-template-columns: 5.4rem 1fr;
  gap: 0.18rem 0.45rem;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
}
.call-debug-list dt {
  margin: 0;
  color: var(--muted);
}
.call-debug-list dd {
  margin: 0;
  color: var(--soft);
  word-break: break-word;
}
.call-debug-note {
  margin: 0.5rem 0 0;
  color: var(--danger-text);
  font-size: 0.75rem;
  line-height: 1.35;
}
.usage-pop .call-debug-panel {
  position: static;
  top: auto;
  right: auto;
  width: auto;
  padding: 0.55rem 0.75rem 0.85rem;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.usage-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.5rem 0.65rem 0.15rem;
}
.usage-tab {
  width: auto;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 0.38rem 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
}
.usage-tab:hover {
  background: var(--hover);
  color: var(--text);
}
.usage-tab.is-current {
  background: var(--active);
  color: var(--text);
}
.usage-panel[hidden],
.usage-panel.view-hidden { display: none !important; }
.members-toggle {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}
.members-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
}
.members-toggle:hover,
.members-toggle[aria-pressed="true"] {
  background: var(--wash);
  color: var(--text);
}
.members-toggle[aria-pressed="true"] {
  color: #fff;
  background: rgba(88, 101, 242, 0.28);
}

.stage {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
}
.stage.text-focus .empty-stage,
.stage.text-focus .call-layout {
  display: none !important;
}
.stage.text-focus .chat-panel {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  margin-top: 0;
}
.empty-stage {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 1rem;
}
.stage-error {
  color: #fff;
  background: #da373c;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-weight: 650;
  max-width: 36rem;
}
.call-layout {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 0;
}
/* Tiles are placed to fill this box, above the channel chat. */
.voice-grid {
  position: relative;
  flex: 1 1 0;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: 0;
}
.sync-stage {
  min-width: 0;
  flex-direction: column;
  margin: 0;
  background: #000;
  color: #fff;
  border: 3px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
}
.sync-stage[hidden] { display: none !important; }
.call-layout.sync-on .voice-grid > .sync-stage {
  display: flex;
  position: absolute;
  z-index: 1;
  flex: none;
  min-height: 0;
  max-height: none;
}
.voice-grid.has-focus > .sync-stage { display: none !important; }
.sync-stage-bar {
  position: absolute;
  left: 0.55rem;
  bottom: 0.55rem;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  max-width: calc(100% - 3.6rem);
  margin: 0;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  pointer-events: none;
}
.sync-stage-title { flex: 0 0 auto; }
.sync-stage-host {
  flex: 1 1 auto;
  min-width: 0;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.sync-sheet-btn {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  z-index: 7;
  width: 2.15rem;
  height: 2.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  cursor: pointer;
}
.sync-sheet-btn[hidden] { display: none !important; }
.sync-sheet-btn svg { width: 1.05rem; height: 1.05rem; }
.sync-sheet-btn:hover { background: rgba(20, 20, 20, 0.88); }
.sync-sheet-btn[aria-expanded="true"] {
  background: var(--accent, #5865f2);
  border-color: transparent;
}
.sync-volume-btn,
.sync-close-btn {
  z-index: 8;
}
.sync-stage > .sync-watch-btn,
.dm-call-grid .sync-stage > .sync-watch-btn {
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 6;
}
.sync-volume-note {
  margin: 0.45rem 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.3;
}
.sync-volume-note[hidden] { display: none !important; }
.sync-stage-controls {
  position: absolute;
  left: 0.45rem;
  right: 0.45rem;
  bottom: 3.15rem;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  max-height: min(70%, 18rem);
  overflow: auto;
  padding: 0.65rem 0.7rem 0.7rem;
  background: var(--panel);
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  box-shadow: 0 -14px 28px rgba(0, 0, 0, 0.45);
  transform: translateY(calc(100% + 3.6rem));
  transition: transform 0.2s ease;
  pointer-events: none;
}
.sync-stage-controls.is-open {
  transform: translateY(0);
  pointer-events: auto;
}
.sync-stage-controls[hidden] { display: none !important; }
.sync-stage-controls [hidden] { display: none !important; }
.sync-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.sync-controls-row select { flex: 1 1 8rem; }
.sync-controls-actions { justify-content: flex-start; }
.sync-share {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.1rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
}
.sync-share-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sync-share-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}
.sync-share-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 700;
}
.sync-share-list li span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sync-share-list button {
  flex: 0 0 auto;
  color: var(--danger-text);
  border-color: var(--danger);
}
.sync-kind-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sync-stage-controls select,
.sync-stage-controls input,
.sync-stage-controls button {
  height: 2rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--input);
  color: var(--text);
}
.sync-stage-controls select,
.sync-stage-controls button {
  padding: 0 0.6rem;
  font-weight: 700;
}
.sync-stage-controls input {
  width: 100%;
  min-width: 0;
  padding: 0 0.55rem;
}
.sync-stage-controls button:hover { background: var(--sidebar); }
#sync-play {
  background: var(--accent, #5865f2);
  border-color: transparent;
  color: #fff;
}
#sync-stop {
  color: var(--danger-text);
  border-color: var(--danger);
}
.sync-stage-note {
  position: absolute;
  left: 0.55rem;
  right: 5.6rem;
  top: 0.55rem;
  z-index: 5;
  margin: 0;
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.72);
  color: #ffb4b6;
  font-size: 0.78rem;
  font-weight: 650;
}
.sync-stage-note[hidden] { display: none !important; }
.sync-stage-note.is-hint { color: rgba(255, 255, 255, 0.82); }
.sync-mount {
  position: absolute;
  inset: 0;
  min-height: 0;
  background: #000;
}
.sync-mount iframe,
.sync-mount video,
.sync-mount .sync-player,
.sync-file-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}
.sync-mount video::-webkit-media-controls,
.sync-mount video::-webkit-media-controls-enclosure,
.sync-mount video::-webkit-media-controls-panel {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.sync-file-bar {
  position: absolute;
  left: 0.55rem;
  right: 3.4rem;
  bottom: 2.75rem;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.5rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
}
.sync-file-bar button {
  width: auto;
  height: 2rem;
  margin: 0;
  padding: 0 0.7rem;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 700;
}
.sync-file-bar button:hover { background: rgba(255, 255, 255, 0.24); }
.sync-file-volume {
  flex: 1 1 auto;
  width: auto;
  min-width: 4.5rem;
  height: 1.25rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.sync-file-volume-val {
  flex: 0 0 auto;
  min-width: 2.4rem;
  font-size: 0.75rem;
  font-weight: 800;
}
.sync-unlock {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  height: 2.4rem;
  padding: 0 0.9rem;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.sync-unlock[hidden] { display: none !important; }
.voice-grid > .tile {
  min-height: 0;
  min-width: 0;
  max-width: none;
  z-index: 1;
}
.layout-menu {
  position: relative;
  z-index: 30;
}
.bookmarks-menu {
  position: relative;
  z-index: 30;
}
.bookmarks-menu .bookmarks-pop {
  top: calc(100% + 0.4rem);
  right: 0;
  bottom: auto;
  left: auto;
}
.bookmarks-menu .members-toggle[aria-expanded="true"] {
  color: #fff;
  background: rgba(88, 101, 242, 0.28);
}
.layout-menu-btn[aria-expanded="true"] {
  color: #fff;
  background: rgba(88, 101, 242, 0.28);
}
.matrix-bar {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 31;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.18rem;
  min-width: 11.5rem;
  padding: 0.4rem;
  background: var(--panel);
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}
.matrix-bar[hidden] { display: none !important; }
.matrix-bar-label {
  padding: 0.15rem 0.4rem 0.05rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.matrix-bar-label.matrix-bar-split {
  margin-top: 0.28rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
}
.matrix-bar button {
  min-width: 0;
  height: 1.85rem;
  padding: 0 0.55rem;
  border-radius: 6px;
  background: transparent;
  color: var(--soft);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: left;
}
.matrix-bar button:hover { background: var(--hover); color: var(--text); }
.matrix-bar button[aria-pressed="true"],
.matrix-bar button[aria-pressed="true"]:hover {
  background: var(--accent);
  color: #fff;
}
.matrix-bar button.chat-place-btn {
  font-weight: 700;
  letter-spacing: 0;
}
.matrix-slots {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.matrix-slot {
  position: absolute;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  pointer-events: auto;
}
.matrix-slot.is-drop {
  background: rgba(88, 101, 242, 0.2);
  box-shadow: inset 0 0 0 2px #5865f2;
}
.voice-grid.is-static > .tile { cursor: grab; }
.voice-grid > .tile.is-matrix-drag {
  cursor: grabbing;
  opacity: 0.94;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5);
}
.voice-grid > .tile.is-drop {
  box-shadow: inset 0 0 0 2px #5865f2;
}
.voice-grid > .tile.is-voice-dock .tile-avatar {
  width: min(74cqw, 70cqh, 64px);
}
.voice-grid > .tile.is-voice-dock .label {
  left: 0.22rem;
  right: 0.22rem;
  bottom: 0.22rem;
  max-width: none;
  padding: 0.05rem 0.28rem;
  font-size: 0.62rem;
}
.voice-grid > .tile.is-voice-dock .tile-volume {
  top: 0.16rem;
  right: 0.16rem;
  width: 1.15rem;
  height: 1.15rem;
  font-size: 0.68rem;
}
.voice-grid.has-focus {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr);
  align-content: stretch;
}
.voice-grid.has-focus .tile.is-dimmed {
  display: none;
}
.voice-grid.has-focus .tile.is-focused {
  position: relative;
  left: auto;
  top: auto;
  width: 100%;
  max-width: none;
  min-height: 0;
  height: 100%;
  aspect-ratio: auto;
  border-color: #5865f2;
  box-shadow: 0 0 0 1px rgba(88, 101, 242, 0.45);
}
.chat-panel {
  flex: 0 0 auto;
  height: var(--call-chat-h, 240px);
  min-height: 0;
  max-height: none;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--rule);
  background: var(--sidebar);
  border-radius: 10px;
  margin-top: 0.55rem;
  overflow: hidden;
  position: relative;
  z-index: 2;
}
.chat-split {
  flex: 0 0 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: ns-resize;
  touch-action: none;
  user-select: none;
  background: transparent;
  border-bottom: 1px solid var(--rule);
}
.chat-split span {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: var(--muted);
  pointer-events: none;
}
.chat-split:hover,
.chat-split.is-dragging {
  background: rgba(88, 101, 242, 0.16);
}
.chat-split:hover span,
.chat-split.is-dragging span {
  background: var(--text);
}
.stage.text-focus .chat-split {
  display: none !important;
}
.chat-channel-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 2.2rem;
  padding: 0.28rem 0.55rem;
  border-bottom: 1px solid var(--rule);
  order: 0;
}
.chat-channel-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text);
}
.chat-channel-modes {
  display: flex;
  flex: 0 0 auto;
  gap: 0.28rem;
}
.chat-mode-btn {
  padding: 0.28rem 0.62rem;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  background: transparent;
  color: var(--muted);
}
.chat-mode-btn:hover {
  background: var(--hover);
  color: var(--text);
}
.chat-mode-btn.is-on,
.chat-mode-btn.is-on:hover {
  background: var(--accent);
  color: #fff;
}
.chat-mode-btn.is-on:hover {
  background: var(--accent-2);
}
.chat-channel-gallery {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-channel-gallery[hidden] {
  display: none !important;
}
.chat-channel-gallery-status,
.chat-channel-gallery-empty {
  margin: 0.35rem 0.75rem 0.15rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.chat-channel-gallery-status[hidden],
.chat-channel-gallery-empty[hidden] {
  display: none !important;
}
.chat-channel-gallery-grid {
  flex: 1 1 auto;
}
.chat-panel.gallery-mode .chat-log,
.chat-panel.gallery-mode .chat-jump,
.chat-panel.gallery-mode .chat-pin,
.chat-panel.gallery-mode .chat-typing {
  display: none !important;
}
.stage.chat-place-right:not(.text-focus),
.stage.chat-place-left:not(.text-focus) {
  flex-direction: row;
  align-items: stretch;
}
.stage.chat-place-right:not(.text-focus) .call-layout,
.stage.chat-place-right:not(.text-focus) .empty-stage,
.stage.chat-place-left:not(.text-focus) .call-layout,
.stage.chat-place-left:not(.text-focus) .empty-stage {
  flex: 1 1 0;
  min-width: 280px;
  min-height: 0;
}
.stage.chat-place-right:not(.text-focus) .chat-panel,
.stage.chat-place-left:not(.text-focus) .chat-panel {
  flex: 0 0 var(--call-chat-w, 40%);
  width: var(--call-chat-w, 40%);
  max-width: calc(100% - 280px);
  height: auto;
  min-width: 220px;
  max-height: none;
  margin-top: 0;
  border-top: 0;
}
.stage.chat-place-right:not(.text-focus) .chat-panel {
  margin-left: 0.55rem;
  border-left: 1px solid var(--rule);
}
.stage.chat-place-left:not(.text-focus) .chat-panel {
  order: -1;
  margin-right: 0.55rem;
  border-right: 1px solid var(--rule);
}
.stage.chat-place-right:not(.text-focus) .chat-split,
.stage.chat-place-left:not(.text-focus) .chat-split {
  display: flex;
  position: absolute;
  top: 0;
  bottom: 0;
  width: 14px;
  height: auto;
  margin: 0;
  border: 0;
  cursor: ew-resize;
  z-index: 6;
  background: transparent;
}
.stage.chat-place-right:not(.text-focus) .chat-split {
  left: -7px;
  right: auto;
}
.stage.chat-place-left:not(.text-focus) .chat-split {
  right: -7px;
  left: auto;
}
.stage.chat-place-right:not(.text-focus) .chat-split span,
.stage.chat-place-left:not(.text-focus) .chat-split span {
  width: 4px;
  height: 42px;
}
.stage.chat-place-right:not(.text-focus) .chat-split:hover,
.stage.chat-place-right:not(.text-focus) .chat-split.is-dragging,
.stage.chat-place-left:not(.text-focus) .chat-split:hover,
.stage.chat-place-left:not(.text-focus) .chat-split.is-dragging {
  background: rgba(88, 101, 242, 0.16);
}
.stage.chat-place-top:not(.text-focus) .chat-panel {
  order: 1;
  margin-top: 0;
  margin-bottom: 0.55rem;
  border-top: 0;
  border-bottom: 1px solid var(--rule);
}
.stage.chat-place-top:not(.text-focus) .call-layout,
.stage.chat-place-top:not(.text-focus) .empty-stage {
  order: 2;
}
.stage.chat-place-top:not(.text-focus) .chat-split {
  order: 5;
  border-bottom: 0;
  border-top: 1px solid var(--rule);
}
@media (max-width: 860px) {
  .stage.chat-place-right:not(.text-focus),
  .stage.chat-place-left:not(.text-focus) {
    flex-direction: column;
  }
  .stage.chat-place-right:not(.text-focus) .call-layout,
  .stage.chat-place-right:not(.text-focus) .empty-stage,
  .stage.chat-place-left:not(.text-focus) .call-layout,
  .stage.chat-place-left:not(.text-focus) .empty-stage {
    flex: 3 1 0;
    max-height: 60%;
    order: 0;
  }
  .stage.chat-place-right:not(.text-focus) .chat-panel,
  .stage.chat-place-left:not(.text-focus) .chat-panel {
    flex: 2 1 0;
    width: auto;
    max-width: none;
    min-width: 0;
    order: 0;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0.45rem;
    border-left: 0;
    border-right: 0;
    border-top: 1px solid var(--rule);
  }
  .stage.chat-place-right:not(.text-focus) .chat-split,
  .stage.chat-place-left:not(.text-focus) .chat-split {
    display: none;
  }
}
.stage.chat-collapsed:not(.text-focus) .chat-panel {
  display: none !important;
}
body.chat-split-drag,
body.chat-split-drag * {
  cursor: ns-resize !important;
  user-select: none !important;
}
body.chat-split-drag-side,
body.chat-split-drag-side * {
  cursor: ew-resize !important;
  user-select: none !important;
}
.stage.text-focus .chat-panel {
  border-top: 0;
  height: auto;
}
.chat-log {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}
.chat-pin {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  margin: 0;
  padding: 0.28rem 0.45rem;
  border-bottom: 1px solid var(--rule);
  background: var(--inset);
}
.chat-pin[hidden] { display: none !important; }
.chat-pin-jump {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  width: auto;
  margin: 0;
  padding: 0.2rem 0.35rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.chat-pin-jump:hover { background: var(--hover); }
.chat-pin-kicker {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.chat-pin-name {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}
.chat-pin-snippet {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 600;
}
.chat-pin-clear {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}
.chat-pin-clear:hover { background: var(--hover); color: var(--text); }
.chat-pin-clear[hidden] { display: none !important; }
.chat-msg.is-pinned { box-shadow: inset 3px 0 0 var(--accent); }
.chat-msg.is-follow {
  padding-top: 0.04rem;
  padding-bottom: 0.04rem;
}
.chat-msg:has(+ .chat-msg.is-follow) {
  padding-bottom: 0.02rem;
}
.has-chat-wallpaper #chat-log,
.has-chat-wallpaper .dm-log,
.has-chat-wallpaper .dm-bookmarks {
  background-image:
    linear-gradient(rgba(12, 16, 22, 0.72), rgba(12, 16, 22, 0.72)),
    var(--chat-wallpaper);
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}
html[data-theme="white"].has-chat-wallpaper #chat-log,
html[data-theme="white"].has-chat-wallpaper .dm-log,
html[data-theme="white"].has-chat-wallpaper .dm-bookmarks {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.78)),
    var(--chat-wallpaper);
}
.chat-msg {
  font-size: calc(0.94rem * var(--ww-text-scale));
  line-height: 1.375;
  word-break: break-word;
}
.chat-msg .who {
  color: hsl(var(--who-h, 190), 72%, 64%);
  font-weight: 700;
  font-size: calc(1rem * var(--ww-text-scale));
  margin-right: 0;
  line-height: 1.2;
  white-space: nowrap;
}
html[data-theme="white"] .chat-msg .who {
  color: hsl(var(--who-h, 190), 68%, 32%);
}
.chat-msg .when {
  color: var(--muted);
  font-size: calc(0.72rem * var(--ww-text-scale));
  font-weight: 500;
  margin-left: 0.15rem;
  line-height: 1.2;
  white-space: nowrap;
}
.chat-day-sep {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.85rem 0.35rem 0.55rem;
  color: var(--muted);
  font-size: calc(0.72rem * var(--ww-text-scale));
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  user-select: none;
  pointer-events: none;
}
.chat-day-sep::before,
.chat-day-sep::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}
html[data-theme="white"] .chat-day-sep::before,
html[data-theme="white"] .chat-day-sep::after {
  background: rgba(0, 0, 0, 0.12);
}
.chat-day-sep-label {
  flex: 0 0 auto;
  white-space: nowrap;
}
.chat-receipts {
  color: var(--muted);
  font-size: calc(0.72rem * var(--ww-text-scale));
  font-weight: 500;
  line-height: 1.25;
  margin-top: 0.05rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}
.chat-msg.is-mine .chat-receipts {
  color: var(--accent);
  opacity: 0.9;
}
.chat-msg .chat-avatar {
  width: 40px;
  height: 40px;
  font-size: 1rem;
  margin-top: 0.05rem;
  grid-column: 1;
  grid-row: 1;
  align-self: start;
}
.chat-main {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
}
.chat-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.28rem 0.4rem;
  min-width: 0;
  max-width: 100%;
}
.chat-discord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 0.95rem;
  height: 0.95rem;
  color: #5865f2;
}
.chat-discord svg {
  display: block;
  width: 0.95rem;
  height: 0.95rem;
}
.chat-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  height: 1.15rem;
  padding: 0 0.38rem;
  border-radius: 4px;
  background: #5865f2;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.chat-tag[hidden] { display: none !important; }
.chat-dev {
  display: inline-flex;
  align-items: center;
  height: 1.15rem;
  padding: 0 0.38rem;
  border-radius: 4px;
  background: #da373c;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.chat-tag-icon {
  font-size: 0.74rem;
  line-height: 1;
}
.chat-msg .body {
  color: var(--text);
  display: block;
  flex: none;
  min-width: 0;
  max-width: 100%;
  line-height: 1.375;
}
.chat-msg .chat-media {
  margin-top: 0.35rem;
  display: grid;
  gap: 0.35rem;
}
.chat-msg .chat-image {
  display: block;
  max-width: min(100%, 420px);
  max-height: min(280px, 40vh);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  background: transparent;
  cursor: zoom-in;
}
.chat-msg .chat-discord-image {
  display: block;
  margin: 0.35rem 0;
  max-width: min(100%, 420px);
}
.chat-msg .chat-expired-link {
  color: var(--muted);
  font-weight: 650;
}
.chat-msg .chat-file {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: var(--input);
  color: var(--link);
  text-decoration: none;
  font-weight: 600;
  border: 1px solid var(--hairline);
}
.chat-msg .chat-file:hover { background: var(--sidebar-2); color: var(--text); }
.chat-msg .chat-file .chat-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-msg .chat-file .chat-file-meta {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.78rem;
  white-space: nowrap;
}
.chat-upload-status {
  margin: 0;
  padding: 0.35rem 0.75rem 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.chat-upload-status.is-error { color: var(--danger-text); }
.chat-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.55rem 0.65rem 0.65rem;
  border-top: 1px solid var(--rule);
  align-items: stretch;
}
.chat-compose {
  display: flex;
  gap: 0.45rem;
  align-items: flex-end;
}
.chat-form input[type="text"],
.chat-compose input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
}
.chat-compose textarea {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  min-height: 2.55rem;
  max-height: 9.5rem;
  resize: none;
  overflow: hidden;
  line-height: 1.35;
  padding: 0.55rem 0.75rem;
  font-size: calc(0.95rem * var(--ww-text-scale));
}
.chat-compose button {
  flex: 0 0 auto;
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  padding: 0.55rem 0.9rem;
}
.chat-compose button.chat-attach {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
  min-height: 2.55rem;
  padding: 0 0.85rem;
  border: 1px solid var(--hairline-strong);
  color: var(--text);
  line-height: 1;
}
.chat-reply {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.35rem 0.55rem;
  border-left: 3px solid #00e5ff;
  border-radius: 6px;
  background: var(--wash);
}
.chat-reply[hidden] {
  display: none !important;
}
.chat-reply-copy {
  flex: 1 1 auto;
  min-width: 0;
}
.chat-reply-label {
  display: block;
  color: #00e5ff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
}
.chat-reply-snippet {
  display: block;
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-reply-cancel {
  flex: 0 0 auto;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 6px;
  padding: 0.25rem 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
}
.chat-reply-cancel:hover,
.dm-form .chat-reply-cancel:hover {
  background: var(--hover);
  color: var(--text);
}
.chat-msg {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  column-gap: 0.7rem;
  align-items: start;
  border-radius: 4px;
  padding: 0.2rem 0.5rem 0.15rem;
}
.chat-msg.is-deleted,
.chat-msg.is-private-cmd {
  display: block;
}
.chat-msg.is-private-cmd {
  cursor: default;
}
.chat-msg.is-private-cmd:hover {
  background: transparent;
}
.private-cmd-line {
  font-weight: 650;
  word-break: break-word;
}
.private-cmd-note {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.12rem;
}
.chat-msg .chat-media,
.chat-msg .chat-edit-box,
.chat-msg .paw-buttons,
.chat-msg .chat-reactions {
  flex: none;
  width: auto;
  max-width: 100%;
  margin-left: 0;
}
.paw-slash {
  position: fixed;
  z-index: 70;
  max-height: min(320px, 46vh);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
  padding: 0.35rem;
}
.paw-slash[hidden] {
  display: none !important;
}
.paw-slash-item {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--text);
  border: 0;
  border-radius: 6px;
  padding: 0.42rem 0.55rem;
  cursor: pointer;
}
.paw-slash-item.active,
.paw-slash-item:hover {
  background: #5865f2;
  color: #fff;
}
.paw-slash-name {
  flex: 0 0 auto;
  min-width: 6.2rem;
  font-weight: 700;
}
.paw-slash-desc {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}
.paw-slash-item.active .paw-slash-desc,
.paw-slash-item:hover .paw-slash-desc {
  color: rgba(255, 255, 255, 0.88);
}
.paw-slash-hint {
  margin: 0;
  padding: 0.45rem 0.6rem;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
}
.paw-slash-private {
  margin: 0;
  padding: 0.35rem 0.6rem 0.4rem;
  border-bottom: 1px solid var(--hairline-strong);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.35;
}
.chat-paw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem 0;
}
.chat-paw-actions[hidden],
.paw-buttons[hidden] {
  display: none !important;
}
.chat-paw-actions button,
.paw-btn {
  flex: 0 0 auto;
  border: 0;
  border-radius: 4px;
  background: #5865f2;
  color: #fff;
  padding: 0.28rem 0.62rem;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}
.chat-paw-actions button:hover,
.paw-btn:hover {
  background: #4752c4;
}
.chat-msg .paw-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.28rem;
}
.chat-msg:hover {
  background: var(--wash);
}
.chat-msg {
  cursor: context-menu;
}
.chat-msg.is-jump {
  background: rgba(0, 229, 255, 0.2);
}
button.chat-reply-chip {
  flex: none;
  max-width: 100%;
  width: auto;
  min-width: 0;
  display: block;
  margin: 0 0 0.12rem;
  padding: 0.16rem 0.5rem;
  border: 0;
  border-left: 3px solid #00e5ff;
  border-radius: 4px;
  background: var(--wash);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
button.chat-reply-chip:hover {
  background: var(--hover);
  color: var(--text);
}
button.chat-reply-chip strong {
  color: #00e5ff;
  font-weight: 700;
  margin-right: 0.3rem;
}
button.chat-reply-chip[hidden] {
  display: none !important;
}
.chat-msg .edited-tag {
  color: var(--muted);
  font-size: 0.72rem;
  margin-left: 0.35rem;
  font-weight: 500;
}
.chat-msg.is-deleted {
  opacity: 0.7;
  font-style: italic;
  color: var(--muted);
}
.chat-msg .chat-edit-box {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.35rem;
  align-items: stretch;
  width: 100%;
}
.chat-msg .chat-edit-box textarea {
  display: block;
  width: 100%;
  min-height: 2.6rem;
  max-height: 12rem;
  resize: none;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 0.45rem 0.55rem;
  line-height: 1.35;
  font: inherit;
}
.chat-edit-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 0.4rem;
}
.chat-msg .chat-edit-box .chat-edit-actions button {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
}
.chat-edit-mature {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  align-self: flex-start;
  gap: 0.45rem;
  width: auto;
  max-width: 100%;
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  color: var(--text);
}
.chat-edit-mature input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  accent-color: var(--accent, #5865f2);
  flex: 0 0 auto;
}
.chat-poll {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.35rem;
  max-width: 28rem;
}
.chat-suspect-notice {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.35rem;
  max-width: 28rem;
  padding: 0.7rem 0.75rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(230, 126, 34, 0.55);
  background: rgba(230, 126, 34, 0.12);
}
.chat-suspect-notice-title { font-weight: 700; }
.chat-suspect-notice-copy {
  color: var(--muted);
  line-height: 1.4;
}
.chat-suspect-notice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.2rem;
}
.chat-suspect-notice-status {
  color: var(--muted);
  font-size: 0.85rem;
}
.chat-poll-q { font-weight: 700; }
.chat-poll-opt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  background: var(--input);
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
}
.chat-poll-opt.is-mine { border-color: var(--accent); }
.chat-poll-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.chat-poll-total { color: var(--muted); font-size: 0.75rem; }
.poll-card { width: min(440px, 100%); }
.poll-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.7rem;
}
.poll-field span { font-size: 0.78rem; color: var(--muted); font-weight: 650; }
.poll-options {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.45rem;
  max-height: 16rem;
  overflow: auto;
}
.poll-error { color: var(--danger-text); margin-top: 0.55rem; }
.chat-menu {
  position: fixed;
  z-index: 140;
  min-width: 168px;
  background: var(--panel);
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  padding: 0.3rem;
  display: grid;
  gap: 0.15rem;
}
.chat-menu button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--text);
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  font-weight: 600;
}
.chat-menu button:hover {
  background: var(--hover);
}
.chat-menu button.danger-item {
  color: var(--danger-text);
}
.chat-menu button.danger-item:hover {
  background: rgba(218, 55, 60, 0.18);
}
.chat-menu button:disabled {
  opacity: 0.4;
}
.chat-menu button[hidden] {
  display: none !important;
}
.tile {
  position: relative;
  background: var(--input);
  border-radius: 14px;
  overflow: hidden;
  min-height: 160px;
  border: 3px solid var(--border);
  display: grid;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.tile.speaking {
  background: rgba(35, 165, 89, 0.28);
  border-color: #23a559;
  box-shadow: 0 0 0 1px rgba(35, 165, 89, 0.45), 0 0 18px rgba(35, 165, 89, 0.35);
}
/* Streaming shows the screen in-tile; green border is speaking-only. */
.tile.streaming {
  border-color: var(--border);
  box-shadow: none;
}
.tile.speaking.streaming {
  background: rgba(35, 165, 89, 0.28);
  border-color: #23a559;
  box-shadow: 0 0 0 2px #23a559, 0 0 22px rgba(35, 165, 89, 0.5);
}
.tile-media {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding-bottom: 1.35rem;
  background: var(--panel);
  container-type: size;
}
.tile-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}
.tile-bg[hidden],
.tile-bg.view-hidden,
.tile:not(.show-wave) .tile-bg {
  display: none !important;
}
.tile-avatar {
  position: relative;
  width: min(46cqw, 68cqh, 140px);
  aspect-ratio: 1 / 1;
  flex: 0 0 auto;
  align-self: center;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  z-index: 1;
}
.dm-call-grid .tile-avatar {
  width: min(42cqw, 62cqh, 96px);
}
.tile-wave {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 200%;
  height: 200%;
  transform: translate(-50%, -50%);
  z-index: 0;
  display: block;
  pointer-events: none;
  background: transparent;
}
.tile-wave[hidden],
.tile-wave.view-hidden,
.tile:not(.show-wave) .tile-wave {
  display: none !important;
}
.tile-avatar .tile-logo,
.tile-avatar .tile-logo.avatar-photo {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  border: 3px solid var(--hairline-strong);
  background: var(--input);
  user-select: none;
  pointer-events: none;
  opacity: 0.95;
  box-sizing: border-box;
}
.tile-avatar .tile-logo:not(.avatar-photo) {
  object-fit: contain;
  padding: 12%;
}
.tile-camera,
.tile-screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.tile-screen {
  object-fit: contain;
  transform-origin: center center;
  transform: translate(var(--stream-pan-x, 0px), var(--stream-pan-y, 0px)) scale(var(--stream-zoom, 1));
}
.voice-grid.has-focus .tile.is-focused .tile-camera,
.voice-grid.has-focus .tile.is-focused .tile-screen {
  object-fit: contain;
}
.tile.has-both .tile-pip {
  z-index: 3;
  inset: auto 0.5rem 0.5rem auto;
  width: 28%;
  min-width: 92px;
  max-width: 210px;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  object-fit: cover;
  cursor: context-menu;
  background: #000;
}
.voice-grid.has-focus .tile.is-focused.has-both .tile-pip {
  object-fit: cover;
}
.tile.has-both.is-swapped .tile-pip,
.voice-grid.has-focus .tile.is-focused.has-both.is-swapped .tile-pip {
  object-fit: contain;
}
.tile.has-both:not(.is-pip-min) .label {
  max-width: calc(100% - 38%);
}
.tile.has-both.is-pip-min .label {
  max-width: calc(100% - 7.5rem);
}
.tile-pip-restore {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  z-index: 4;
  padding: 0.28rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}
.tile-pip-restore[hidden],
.tile-pip-restore.view-hidden {
  display: none !important;
}
.tile .label {
  position: absolute;
  left: 0.55rem;
  bottom: 0.55rem;
  z-index: 2;
  background: rgba(0, 0, 0, 0.7);
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.voice-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  align-items: center;
  padding: 0.75rem 1rem 1rem;
  background: var(--inset);
  border-top: 1px solid var(--rule);
  position: relative;
}
.voice-bar[hidden] {
  display: none !important;
}
.voice-bar button.icon-btn {
  min-width: 2.75rem;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  display: inline-grid;
  place-items: center;
  background: var(--input);
  border: 1px solid var(--border);
  color: var(--text);
  line-height: 1;
}
.voice-bar button.icon-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}
.voice-bar button.icon-btn:hover { background: var(--sidebar); }
.voice-device-group {
  display: inline-flex;
  align-items: stretch;
  flex: 0 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
}
.voice-device-group > .icon-btn,
.voice-device-group > .dm-call-ctrl {
  border-radius: 0;
}
.voice-device-group > :first-child {
  border-top-left-radius: var(--radius);
  border-bottom-left-radius: var(--radius);
}
.voice-device-group > :last-child {
  border-top-right-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}
.voice-device-group > .icon-btn + .icon-btn,
.voice-device-group > .dm-call-ctrl + .dm-call-ctrl {
  border-left-width: 0;
}
.voice-bar button.icon-btn.voice-device-caret,
.dm-call-bar button.dm-call-ctrl.voice-device-caret {
  min-width: 1.35rem;
  width: 1.35rem;
  padding: 0;
}
.voice-bar button.icon-btn.voice-device-caret svg,
.dm-call-bar button.dm-call-ctrl.voice-device-caret svg {
  width: 0.85rem;
  height: 0.85rem;
}
.voice-bar button.icon-btn.voice-device-caret[aria-expanded="true"],
.dm-call-bar button.dm-call-ctrl.voice-device-caret[aria-expanded="true"] {
  background: var(--active);
  border-color: var(--accent);
}
.voice-device-menu {
  min-width: 220px;
  max-width: min(340px, calc(100vw - 16px));
  max-height: min(320px, calc(100vh - 24px));
  overflow: auto;
  z-index: 120;
}
.audio-profile-menu {
  min-width: 240px;
  max-width: min(360px, calc(100vw - 16px));
  max-height: min(360px, calc(100vh - 24px));
  overflow: auto;
  z-index: 121;
}
.audio-profile-menu .voice-device-heading {
  padding: 0.4rem 0.7rem 0.2rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  user-select: none;
}
.audio-profile-menu button.is-selected {
  background: rgba(88, 101, 242, 0.22);
  color: var(--accent-strong, var(--accent));
}
.audio-profile-menu button.is-selected:hover {
  background: rgba(88, 101, 242, 0.3);
}
.audio-profile-menu .audio-profile-actions {
  display: grid;
  gap: 0.15rem;
  margin-top: 0.2rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--hairline-strong);
}
.audio-profile-menu .audio-profile-save-form {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.2rem;
  padding: 0.45rem 0.35rem 0.2rem;
  border-top: 1px solid var(--hairline-strong);
}
.audio-profile-menu .audio-profile-save-form label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}
.audio-profile-menu .audio-profile-save-form input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--input);
  color: var(--text);
  padding: 0.45rem 0.55rem;
  font: inherit;
}
.audio-profile-menu .audio-profile-save-actions {
  display: flex;
  gap: 0.35rem;
  justify-content: flex-end;
}
.audio-profile-menu .audio-profile-save-actions button {
  width: auto;
  min-width: 4.5rem;
  padding: 0.4rem 0.7rem;
}
.audio-profile-menu .audio-profile-save-actions .primary-btn,
.audio-profile-menu .audio-profile-save-actions button.primary-btn {
  background: var(--accent);
  color: #fff;
  border: 0;
}
.audio-profile-menu .audio-profile-error {
  color: var(--danger-text);
  font-size: 0.78rem;
  padding: 0 0.15rem;
}
.audio-profile-menu .voice-device-empty {
  padding: 0.55rem 0.7rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.voice-bar button.icon-btn.audio-profile-btn[aria-expanded="true"] {
  background: var(--active);
  border-color: var(--accent);
}
.audio-profiles-manager {
  display: grid;
  gap: 0.85rem;
}
.audio-profiles-manager .audio-profiles-create-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.audio-profiles-manager .audio-profiles-create-row input {
  flex: 1 1 12rem;
  min-width: 10rem;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input);
  color: var(--text);
  padding: 0.5rem 0.65rem;
  font: inherit;
}
.audio-profiles-manager .audio-profiles-create-row .primary-btn,
.audio-profiles-manager .primary-btn {
  width: auto;
  min-width: 9rem;
  padding: 0.5rem 0.85rem;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}
.audio-profiles-manager .primary-btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.audio-profiles-list {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.audio-profile-card {
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  background: var(--panel-2, var(--panel));
  display: grid;
  gap: 0.45rem;
}
.audio-profile-card.is-active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(88, 101, 242, 0.35);
}
.audio-profile-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.audio-profile-card-name {
  font-size: 0.98rem;
}
.audio-profile-card-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-strong, var(--accent));
  background: rgba(88, 101, 242, 0.18);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}
.audio-profile-device-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 0.7rem;
}
.audio-profile-device-field {
  display: grid;
  gap: 0.28rem;
  min-width: 0;
}
.audio-profile-device-field > span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted, #b5bac1);
}
.audio-profile-device-select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input);
  color: var(--text);
  padding: 0.45rem 0.55rem;
  font: inherit;
}
.audio-profile-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.audio-profile-card-actions button {
  width: auto;
  min-width: 0;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}
.audio-profile-card-actions button.audio-profile-save-btn,
.audio-profile-card-actions button.primary-btn {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  font-weight: 700;
}
.audio-profile-card-actions button:hover:not(:disabled) {
  border-color: var(--accent);
}
.audio-profile-card-actions button.audio-profile-save-btn:hover:not(:disabled),
.audio-profile-card-actions button.primary-btn:hover:not(:disabled) {
  filter: brightness(1.05);
}
.audio-profile-card-actions button:disabled {
  opacity: 0.55;
  cursor: default;
}
.audio-profile-card-actions button.danger-item {
  color: var(--danger-text, #ff6b7a);
  border-color: rgba(255, 107, 122, 0.45);
}
@media (max-width: 640px) {
  .audio-profiles-manager .audio-profiles-create-row .primary-btn {
    width: 100%;
  }
  .audio-profile-device-grid {
    grid-template-columns: 1fr;
  }
  .audio-profile-card-actions button {
    flex: 1 1 calc(50% - 0.35rem);
  }
}
.voice-device-menu .voice-device-heading {
  padding: 0.4rem 0.7rem 0.2rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  user-select: none;
}
.voice-device-menu button.is-selected {
  background: rgba(88, 101, 242, 0.22);
  color: var(--accent-strong, var(--accent));
}
.voice-device-menu button.is-selected:hover {
  background: rgba(88, 101, 242, 0.3);
}
.voice-device-menu .voice-device-empty {
  padding: 0.55rem 0.7rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.dm-call-bar .voice-device-group {
  border-radius: 8px;
}
.dm-call-bar .voice-device-group > :first-child {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}
.dm-call-bar .voice-device-group > :last-child {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}
.tile-unwatch {
  position: absolute;
  top: 0.45rem;
  right: 2.55rem;
  z-index: 4;
  display: inline-grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: #da373c;
  color: #fff;
  line-height: 1;
  cursor: pointer;
}
.tile-unwatch svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}
.tile-unwatch:hover { background: #c23035; }
.tile-unwatch[hidden],
.tile-unwatch.view-hidden { display: none !important; }
.tile-watch {
  position: absolute;
  left: 50%;
  top: calc(50% + min(23%, 70px) + 0.4rem);
  transform: translateX(-50%);
  z-index: 5;
  width: auto;
  max-width: calc(100% - 1rem);
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}
.tile-watch:hover { background: rgba(20, 20, 20, 0.92); }
.tile-watch[hidden],
.tile-watch.view-hidden { display: none !important; }
.dm-call-grid .tile-watch {
  top: calc(50% + min(21%, 48px) + 0.28rem);
  font-size: 0.68rem;
  padding: 0.26rem 0.5rem;
}
.call-hangup-slot {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
}
.call-clock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 2.75rem;
  min-height: 2.75rem;
  padding: 0 0.7rem;
  background: #000;
  color: #ff2424;
  border-radius: var(--radius);
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
}
.dm-call-bar .call-hangup-slot { gap: 0.4rem; }
.dm-call-bar .call-clock {
  height: 2.4rem;
  min-height: 2.4rem;
  padding: 0 0.5rem;
  border-radius: 8px;
  font-size: 0.72rem;
}
@media (max-width: 900px) {
  .call-clock {
    padding: 0 0.45rem;
    font-size: 0.72rem;
  }
  .dm-call-bar .call-clock { font-size: 0.66rem; }
}
.voice-bar button.icon-btn.danger {
  background: var(--danger);
  border-color: transparent;
  color: #fff;
}
.voice-bar button.icon-btn.danger:hover { filter: brightness(1.05); }
.voice-bar button.icon-btn.on {
  background: rgba(35, 165, 89, 0.22);
  border-color: var(--ok);
  color: #6dffb0;
}
.voice-bar button.icon-btn.muted,
.voice-bar button.icon-btn[aria-pressed="true"].is-mute {
  background: rgba(218, 55, 60, 0.18);
  border-color: var(--danger);
  color: var(--danger-text);
}
.voice-bar button.icon-btn[aria-expanded="true"] {
  background: var(--active);
  border-color: var(--accent);
}
.voice-bar button.icon-btn.ptt-live {
  box-shadow: 0 0 0 2px rgba(35, 165, 89, 0.55);
}
.voice-bar button.icon-btn.vrc-mute-link,
.voice-bar button.icon-btn.sync-btn {
  width: auto;
  min-width: 2.75rem;
  padding: 0 0.45rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.voice-bar button.icon-btn.vrc-mute-link.waiting {
  color: #faa61a;
  border-color: #c6902a;
}
.voice-bar button.icon-btn.is-chat-hidden {
  background: #faa61a;
  border-color: #faa61a;
  color: #1e1f22;
}
.voice-bar button.icon-btn.is-chat-hidden:hover {
  background: #ffc14d;
  color: #1e1f22;
}
@keyframes ww-deafen-pulse {
  0%, 100% {
    background-color: #da373c;
    box-shadow: 0 0 0 0 rgba(218, 55, 60, 0.7);
  }
  50% {
    background-color: #ff5c61;
    box-shadow: 0 0 0 7px rgba(218, 55, 60, 0);
  }
}
.voice-bar button.icon-btn.is-deafen,
button.dm-call-ctrl.is-deafen {
  background: #da373c;
  border-color: transparent;
  color: #fff;
  animation: ww-deafen-pulse 1.1s ease-in-out infinite;
}
.voice-bar button.icon-btn.is-deafen:hover,
button.dm-call-ctrl.is-deafen:hover {
  color: #fff;
  filter: none;
}
@media (prefers-reduced-motion: reduce) {
  .voice-bar button.icon-btn.is-deafen,
  button.dm-call-ctrl.is-deafen {
    animation: none;
    background: #da373c;
    color: #fff;
  }
}
.uv-meter {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  height: 2.75rem;
  padding: 0.3rem 0.4rem;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.uv-col {
  position: relative;
  width: 0.55rem;
  height: 100%;
}
.uv-bar {
  position: absolute;
  inset: 0;
  background: var(--panel);
  border-radius: 3px;
  overflow: hidden;
}
.uv-bar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  margin-top: -0.5px;
  background: rgba(255, 255, 255, 0.35);
  z-index: 1;
  pointer-events: none;
}
.uv-fill {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  bottom: auto;
  height: 0%;
  transform: translateY(-50%);
  border-radius: 3px;
  transition: height 0.05s linear;
}
.uv-fill.local {
  background: linear-gradient(to top, var(--uv-c1, #1fd6ff), var(--uv-c2, #ff45c2) 50%, var(--uv-c1, #1fd6ff));
}
.uv-fill.remote { background: linear-gradient(to top, #8ea1ff, #3c4ebd 50%, #8ea1ff); }
.uv-threshold {
  position: absolute;
  inset: 0;
  height: auto;
  background: none;
  pointer-events: none;
  z-index: 2;
}
.uv-threshold::before,
.uv-threshold::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  height: 2px;
  margin-top: -1px;
  background: #fff;
  opacity: 0.85;
  border-radius: 1px;
}
.uv-threshold::before { top: calc(50% - var(--uv-span, 6%)); }
.uv-threshold::after { top: calc(50% + var(--uv-span, 6%)); }
.voice-settings-wrap {
  position: relative;
}
.settings-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 90;
}
.audio-settings {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(56rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 1.15rem 1.25rem 0;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  z-index: 100;
  text-align: left;
}
.call-settings {
  width: min(72rem, calc(100vw - 1.5rem));
  height: min(52rem, calc(100vh - 1.5rem));
  max-height: calc(100vh - 1.5rem);
}
.settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.95rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--hairline);
}
.community-admin-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
}
.admin-inline-save {
  padding: 0.28rem 0.7rem;
  border-radius: 6px;
  font-size: 0.78rem;
}
.settings-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}
.settings-mode-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.2;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
}
.settings-mode-tab:hover {
  color: var(--text);
  background: var(--wash);
}
.settings-mode-tab[aria-selected="true"] {
  color: var(--text);
  background: var(--inset);
}
.settings-mode-sub {
  margin: -0.25rem 0 0.85rem;
}
.settings-mode-pane {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.settings-mode-pane[hidden],
.settings-mode-pane.view-hidden {
  display: none !important;
}
.settings-community-only.is-mode-hidden {
  display: none !important;
}
.settings-head h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
  text-transform: none;
}
.settings-sub {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.settings-sub.settings-mode-sub {
  margin: -0.25rem 0 0.85rem;
}
.settings-close {
  min-width: 2.25rem;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 8px;
  background: var(--sidebar);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
}
.settings-close svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
  margin: 0 auto;
}
.settings-close:hover {
  background: var(--hover);
}
.settings-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  overflow: auto;
  padding-bottom: 0.85rem;
  flex: 1 1 auto;
  min-height: 0;
}
.settings-with-nav {
  grid-template-columns: 13.5rem minmax(0, 1fr);
  align-items: stretch;
  gap: 0.75rem;
}
.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-self: stretch;
  min-height: 0;
  padding: 0.45rem 0.4rem 0.4rem;
  background: var(--inset);
  border: 1px solid var(--hairline);
  border-radius: 10px;
}
.settings-nav-groups {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  overflow: auto;
  flex: 1 1 auto;
  padding-right: 0.1rem;
}
.settings-nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}
.settings-nav-group + .settings-nav-group {
  margin-top: 0.7rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--hairline);
}
.settings-nav-label {
  margin: 0 0.45rem 0.2rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.settings-nav-group.is-current .settings-nav-label {
  color: var(--text);
}
.settings-nav-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  padding: 0.48rem 0.7rem;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: inset 3px 0 0 transparent;
}
.settings-nav-btn:hover {
  background: var(--hover);
  color: var(--text);
}
.settings-nav-btn.active {
  background: var(--active);
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--accent);
}
.settings-nav-gap {
  flex: 1 1 auto;
  min-height: 0.35rem;
}
.settings-logout {
  flex: 0 0 auto;
  color: var(--danger-text, #ed4245);
}
.settings-foot .settings-logout {
  width: auto;
  margin-right: auto;
  align-self: center;
}
.settings-logout:hover {
  color: #fff;
  background: var(--danger, #da373c);
}
.perm-list {
  display: grid;
  gap: 0.7rem;
}
.perm-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.perm-list .perm-card-top h5 {
  margin: 0;
}
.perm-chip {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--wash);
}
.perm-chip[data-state="ready"] {
  color: #8be0ad;
  background: rgba(35, 165, 89, 0.16);
}
.perm-chip[data-state="blocked"] {
  color: #fff;
  background: #da373c;
}
.perm-chip[data-state="needed"],
.perm-chip[data-state="busy"] {
  color: #f0d090;
  background: rgba(240, 178, 50, 0.16);
}
.perm-detail {
  margin: 0.35rem 0 0;
  font-size: 0.84rem;
  line-height: 1.35;
  color: var(--text);
}
.perm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-top: 0.55rem;
}
.perm-page-actions {
  margin-top: 0.75rem;
}
.perm-actions button {
  width: auto;
  padding: 0.45rem 0.8rem;
}
.perm-actions button[hidden] {
  display: none !important;
}
.perm-actions:not(:has(button:not([hidden]))) {
  display: none;
}
.dev-log-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1.1rem;
}
.dev-log-bar h4 {
  margin: 0;
}
.dev-log-actions {
  display: flex;
  gap: 0.35rem;
}
.dev-log {
  margin: 0.45rem 0 0;
  padding: 0.45rem 0.55rem;
  list-style: none;
  max-height: 22rem;
  overflow: auto;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--sidebar);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.45;
}
.dev-log:empty {
  display: none;
}
.dev-log li {
  display: grid;
  grid-template-columns: 4.6rem 4.4rem minmax(0, 1fr);
  gap: 0.45rem;
  padding: 0.12rem 0;
}
.dev-log-time {
  color: var(--muted);
}
.dev-log-level {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.dev-log-msg {
  white-space: pre-wrap;
  word-break: break-word;
}
.dev-log li[data-level="error"] .dev-log-level {
  color: var(--danger-text);
}
.dev-log li[data-level="warn"] .dev-log-level {
  color: var(--log-warn);
}
.dev-log li[data-level="connect"] .dev-log-level {
  color: var(--log-connect);
}
.dev-log li[data-level="status"] .dev-log-level {
  color: var(--log-status);
}
.dev-log li[data-level="info"] .dev-log-level {
  color: var(--muted);
}
#dev-log-empty {
  margin-top: 0.45rem;
}
.dev-card {
  margin-top: 1.25rem;
  padding: 0.9rem;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--sidebar);
}
.dev-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.dev-card-head h4 {
  margin: 0;
  font-size: 1rem;
}
.dev-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.dev-card h5 {
  margin: 0.9rem 0 0.35rem;
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
}
.dev-recipe-grid {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.dev-recipe-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  font-size: 0.8rem;
}
.dev-recipe-label {
  font-weight: 600;
  color: var(--text);
  min-width: 10rem;
  flex-shrink: 0;
}
.dev-recipe-val {
  flex-grow: 1;
  min-width: 0;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.75rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dev-recipe-row code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
.dev-pushers-table-wrap {
  margin-top: 0.45rem;
  overflow-x: auto;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: var(--bg);
}
.dev-pushers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  text-align: left;
}
.dev-pushers-table th,
.dev-pushers-table td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
}
.dev-pushers-table th {
  background: var(--sidebar);
  color: var(--muted);
  font-weight: 600;
}
.dev-pushers-table tr:last-child td {
  border-bottom: none;
}
.dev-push-health-row {
  margin-top: 0.75rem;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--hairline);
  font-size: 0.8rem;
}
.dev-push-health-badge {
  font-weight: 600;
}
.dev-push-health-badge.ok {
  color: var(--online);
}
.dev-push-health-badge.err {
  color: var(--danger-text);
}
.mode-btn.danger-btn {
  color: var(--danger-text);
  border-color: var(--danger);
}
.mode-btn.danger-btn:hover:not(:disabled) {
  background: rgba(218, 55, 60, 0.16);
  color: var(--danger-text);
}
.mode-btn.danger-btn:disabled {
  opacity: 0.55;
}
.settings-pages {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}
.settings-pages > .settings-section {
  min-height: 100%;
  box-sizing: border-box;
}
.settings-section[hidden] {
  display: none !important;
}
.settings-pages > .settings-section-webcam:not([hidden]) {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.settings-section-links .trusted-links {
  max-height: min(32rem, 58vh);
}
.settings-avatar-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.settings-avatar-preview {
  width: 96px;
  height: 96px;
  font-size: 2rem;
}
.settings-avatar-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 0.55rem;
}
.settings-avatar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.settings-avatar-actions .primary-btn[disabled],
.settings-avatar-actions .mode-btn[disabled] {
  opacity: 0.45;
  cursor: default;
}
.settings-banner-block {
  margin-top: 1rem;
  display: grid;
  gap: 0.55rem;
}
.settings-banner-block h4 {
  margin-bottom: 0;
}
.settings-banner-preview {
  position: relative;
  width: 100%;
  height: 92px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
}
.settings-banner-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.settings-banner-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.82rem;
}
#vrc-settings-status,
#avatar-settings-status {
  color: var(--text);
}
.trusted-links {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
  max-height: 9.5rem;
  overflow: auto;
}
.trusted-links li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.trusted-links .trusted-link-url {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--link);
  font-size: 0.82rem;
}
.trusted-links .trusted-link-remove {
  flex: 0 0 auto;
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
}
.link-trust-backdrop {
  z-index: 110;
}
.link-trust {
  width: min(28rem, calc(100vw - 1.25rem));
  height: auto;
  max-height: calc(100vh - 2rem);
  z-index: 120;
}
.link-trust-url {
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.8rem;
  border-radius: 8px;
  background: var(--panel);
  color: var(--link);
  word-break: break-all;
  font-size: 0.88rem;
  line-height: 1.35;
}
.chat-msg .chat-link {
  color: var(--link);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}
.chat-msg .chat-link:hover {
  color: var(--text);
}
.chat-mention {
  color: var(--badge);
  font-weight: 700;
  background: rgba(88, 101, 242, 0.18);
  border-radius: 4px;
  padding: 0 0.12rem;
}
button.chat-mention {
  display: inline;
  width: auto;
  margin: 0;
  border: 0;
  font: inherit;
  font-weight: 700;
  line-height: inherit;
  cursor: pointer;
  vertical-align: baseline;
}
button.chat-mention:hover {
  background: rgba(88, 101, 242, 0.4);
  color: var(--text);
}
.chat-channel {
  color: var(--badge);
  font-weight: 700;
  background: rgba(88, 101, 242, 0.18);
  border-radius: 4px;
  padding: 0 0.12rem;
}
button.chat-channel {
  display: inline;
  width: auto;
  margin: 0;
  border: 0;
  font: inherit;
  font-weight: 700;
  line-height: inherit;
  cursor: pointer;
  vertical-align: baseline;
}
button.chat-channel:hover {
  background: rgba(88, 101, 242, 0.4);
  color: var(--text);
}
.chat-msg .md-line { display: block; }
.chat-msg .md-gap { height: 0.45rem; }
.chat-msg .md-bold,
.inbox-body .md-bold { font-weight: 700; }
.chat-msg .md-em,
.inbox-body .md-em { font-style: italic; }
.chat-msg .md-u,
.inbox-body .md-u { text-decoration: underline; text-underline-offset: 2px; }
.chat-msg .md-s,
.inbox-body .md-s { text-decoration: line-through; }
.chat-msg .md-u.md-s,
.chat-msg .md-s .md-u,
.chat-msg .md-u .md-s,
.inbox-body .md-u.md-s,
.inbox-body .md-s .md-u,
.inbox-body .md-u .md-s { text-decoration: underline line-through; }
.chat-msg .md-inline,
.inbox-body .md-inline {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.86em;
  background: var(--wash);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 0.05rem 0.28rem;
  white-space: pre-wrap;
}
.chat-msg .md-code {
  display: block;
  margin: 0.2rem 0;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  background: var(--wash);
  border: 1px solid var(--hairline);
  overflow-x: auto;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.84rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: normal;
}
.chat-msg .md-code code {
  font-family: inherit;
  white-space: pre-wrap;
  word-break: normal;
}
.chat-msg .md-code-lang {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.chat-msg .md-quote {
  display: block;
  margin: 0.12rem 0;
  padding: 0.05rem 0 0.05rem 0.65rem;
  border: 0;
  border-left: 4px solid var(--hairline-strong, #4e5058);
  color: inherit;
}
.chat-msg .md-h { display: block; font-weight: 700; line-height: 1.25; margin: 0.12rem 0; }
.chat-msg .md-h1 { font-size: 1.35rem; }
.chat-msg .md-h2 { font-size: 1.15rem; }
.chat-msg .md-h3 { font-size: 1.02rem; }
.chat-msg .md-sub {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}
.chat-msg .md-li {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
}
.chat-msg .md-bullet {
  flex: 0 0 auto;
  min-width: 1rem;
  color: var(--muted);
}
.chat-msg .md-li-body { min-width: 0; }
.chat-msg .md-timestamp {
  position: relative;
  display: inline-block;
  vertical-align: baseline;
  max-width: 100%;
}
.chat-msg .md-timestamp-chip {
  display: inline;
  color: var(--badge);
  font-weight: 600;
  background: rgba(88, 101, 242, 0.16);
  border-radius: 4px;
  padding: 0 0.22rem;
  cursor: pointer;
  white-space: nowrap;
}
.chat-msg .md-timestamp:hover .md-timestamp-chip,
.chat-msg .md-timestamp:focus-within .md-timestamp-chip,
.chat-msg .md-timestamp.is-open .md-timestamp-chip {
  background: rgba(88, 101, 242, 0.34);
  color: var(--text);
}
.chat-msg .md-timestamp-pop {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.35rem);
  z-index: 80;
  display: none;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 15.5rem;
  max-width: min(22rem, 78vw);
  padding: 0.45rem;
  border-radius: 8px;
  border: 1px solid var(--hairline-strong, #4e5058);
  background: var(--surface, #1e1f22);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
  color: var(--text);
  white-space: normal;
}
.chat-msg .md-timestamp:hover .md-timestamp-pop,
.chat-msg .md-timestamp:focus-within .md-timestamp-pop,
.chat-msg .md-timestamp.is-open .md-timestamp-pop {
  display: flex;
}
.chat-msg .md-timestamp-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.7rem;
  width: 100%;
  margin: 0;
  padding: 0.28rem 0.4rem;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.chat-msg .md-timestamp-row:hover,
.chat-msg .md-timestamp-row.is-current {
  background: rgba(88, 101, 242, 0.18);
}
.chat-msg .md-timestamp-row-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.chat-msg .md-timestamp-row-value {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
  font-size: 0.82rem;
  line-height: 1.25;
  word-break: break-word;
}
.chat-msg .md-timestamp-actions {
  display: flex;
  margin-top: 0.15rem;
  padding-top: 0.28rem;
  border-top: 1px solid var(--hairline);
}
.chat-msg .md-timestamp-copy {
  width: 100%;
  margin: 0;
  padding: 0.35rem 0.45rem;
  border: 0;
  border-radius: 5px;
  background: rgba(88, 101, 242, 0.28);
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.chat-msg .md-timestamp-copy:hover {
  background: rgba(88, 101, 242, 0.45);
}
html[data-theme="white"] .chat-msg .md-timestamp-pop {
  background: #fff;
  box-shadow: 0 10px 24px rgba(20, 22, 28, 0.18);
}
.chat-msg .md-spoiler,
.inbox-body .md-spoiler {
  border-radius: 3px;
  cursor: pointer;
  padding: 0 0.12rem;
}
.chat-msg .md-spoiler:not(.is-revealed),
.chat-msg .md-spoiler:not(.is-revealed) *,
.inbox-body .md-spoiler:not(.is-revealed),
.inbox-body .md-spoiler:not(.is-revealed) * {
  color: transparent !important;
  background: transparent !important;
  text-decoration: none !important;
  border-color: transparent !important;
}
.chat-msg .md-spoiler:not(.is-revealed),
.inbox-body .md-spoiler:not(.is-revealed) {
  background: #4a4d52 !important;
}
html[data-theme="white"] .chat-msg .md-spoiler:not(.is-revealed),
html[data-theme="white"] .inbox-body .md-spoiler:not(.is-revealed) {
  background: #c5c8ce !important;
}
body.spoilers-open .chat-msg .md-spoiler:not(.is-revealed),
body.spoilers-open .chat-msg .md-spoiler:not(.is-revealed) *,
body.spoilers-open .inbox-body .md-spoiler:not(.is-revealed),
body.spoilers-open .inbox-body .md-spoiler:not(.is-revealed) * {
  color: inherit !important;
  background: transparent !important;
  text-decoration: inherit !important;
  border-color: inherit !important;
}
body.spoilers-open .chat-msg .md-spoiler:not(.is-revealed),
body.spoilers-open .inbox-body .md-spoiler:not(.is-revealed) {
  background: transparent !important;
  cursor: text;
}
.chat-msg .vrc-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.28rem;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  background: var(--scroll);
  border: 1px solid rgba(0, 210, 255, 0.28);
}
.vrc-link-mark {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #7ee7ff;
  background: rgba(0, 180, 220, 0.16);
  border-radius: 999px;
  padding: 0.12rem 0.42rem;
}
.vrc-link-id {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.78rem;
}
.vrc-link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-left: auto;
}
.vrc-link-btn {
  border: 0;
  border-radius: 4px;
  background: #1f6f86;
  color: #fff;
  padding: 0.28rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}
.vrc-link-btn.vrc-link-join {
  background: #0e8f6e;
}
.vrc-link-btn.vrc-link-page {
  background: #3a3f4b;
}
.mention-menu .emoji-short-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.mention-menu .emoji-short-glyph {
  width: 1.4rem;
  font-size: 1.15rem;
  line-height: 1;
  text-align: center;
}
.mention-menu .emoji-short-item .ww-emoji {
  width: 1.25rem;
  height: 1.25rem;
  object-fit: contain;
}
.vrc-link-btn:hover {
  filter: brightness(1.08);
}
.settings-webcam-layout {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1 1 auto;
  min-height: 0;
}
.settings-webcam-controls {
  min-width: 0;
  order: 2;
}
.settings-webcam-preview-wrap {
  position: relative;
  order: 1;
  width: 100%;
  flex: 1 1 auto;
  min-height: 18rem;
  height: clamp(18rem, 36vh, 26rem);
  aspect-ratio: auto;
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
}
.settings-webcam-preview {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--panel);
  transform: none;
}
.settings-webcam-preview.is-mirror {
  transform: scaleX(-1);
}
.settings-webcam-preview.is-live {
  position: relative;
  z-index: 1;
}
.settings-webcam-preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  z-index: 0;
}
.settings-webcam-preview-empty.is-hidden {
  display: none;
}
.settings-mic-test {
  margin-top: 0.75rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--hairline);
}
.settings-mic-test-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.settings-mic-test-label {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}
.settings-mic-test-meter {
  flex: 1 1 auto;
  height: 0.7rem;
  border-radius: 999px;
  background: var(--sidebar);
  border: 1px solid var(--border);
  overflow: hidden;
}
.settings-mic-test-level {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3ba55d, #faa61a 70%, #ed4245);
  transition: width 60ms linear;
}
.settings-mic-test-val {
  flex: 0 0 2.5rem;
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}
.settings-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin: 0 -1.25rem 0;
  padding: 0.85rem 1.25rem 1.05rem;
  border-top: 1px solid var(--hairline);
  background: var(--scroll);
  border-radius: 0 0 14px 14px;
  flex: 0 0 auto;
}
.settings-save-status {
  margin: 0;
  min-height: 1.1rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.settings-save-status.is-error {
  color: #ed4245;
}
.settings-save-status.is-ok {
  color: #3ba55d;
}
.settings-foot-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: auto;
}
.settings-foot-actions .primary-btn[disabled] {
  opacity: 1;
  background: var(--inset);
  color: var(--muted);
  box-shadow: none;
  cursor: default;
  filter: none;
}
.settings-foot-actions .primary-btn[disabled]:hover {
  filter: none;
}
.settings-foot-actions .primary-btn.is-lit {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent, #5865f2) 50%, transparent), 0 0 16px color-mix(in srgb, var(--accent, #5865f2) 42%, transparent);
}
.sound-area {
  margin: 0 0 0.7rem;
  padding: 0.7rem 0.75rem 0.15rem;
  background: var(--sidebar);
  border: 1px solid var(--hairline);
  border-radius: 8px;
}
.sound-area:last-child {
  margin-bottom: 0;
}
.sound-area h5 {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}
.krispy-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.krispy-logo {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 5px;
  object-fit: cover;
  flex: 0 0 auto;
}
#krispy-controls.is-off {
  opacity: 0.45;
}
.sound-area > .audio-hint:last-child,
.sound-area > .settings-mic-test {
  margin: 0 0 0.6rem;
}
.settings-section {
  margin: 0;
  padding: 0.8rem 0.9rem 0.9rem;
  background: var(--inset);
  border: 1px solid var(--hairline);
  border-radius: 10px;
}
.settings-section h4 {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 0.75rem;
}
.settings-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.settings-grid .audio-field {
  margin-bottom: 0;
}
.audio-check.compact {
  margin: 0.15rem 0 0;
  min-height: 2.2rem;
}
@media (max-width: 900px) {
  .settings-body,
  .settings-body-grouped,
  .settings-with-nav {
    grid-template-columns: 1fr;
  }
  .settings-with-nav {
    grid-template-rows: minmax(14rem, 46vh) minmax(0, 1fr);
    height: 100%;
    overflow: hidden;
  }
  .settings-nav,
  .community-admin-nav.settings-nav,
  .community-admin-nav {
    flex-direction: column;
    flex-wrap: nowrap;
    max-height: none;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }
  .settings-pages,
  .community-admin-pages {
    min-height: 0;
    overflow: auto;
  }
  .settings-nav-btn,
  .settings-nav:not(.community-admin-nav) .settings-nav-btn,
  .community-admin-nav .settings-nav-btn {
    width: 100%;
    flex: 0 0 auto;
    text-align: left;
  }
  .settings-nav-gap {
    flex: 1 1 100%;
    height: 0;
    min-height: 0;
  }
  .trusted-links .trusted-link-url {
    white-space: normal;
    word-break: break-all;
  }
  .settings-webcam-layout {
    grid-template-columns: 1fr;
  }
  .settings-webcam-preview-wrap {
    min-height: 14rem;
    height: clamp(14rem, 32vh, 20rem);
  }
  .settings-grid-3 {
    grid-template-columns: 1fr;
  }
  .audio-settings {
    width: min(36rem, calc(100vw - 1.25rem));
  }
  .call-settings {
    top: 0;
    left: 0;
    transform: none;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  .settings-nav,
  .community-admin-nav {
    max-height: none;
  }
  .settings-foot {
    flex-wrap: wrap;
  }
}
@media (max-width: 640px) {
  .settings-grid,
  .notify-sound-grid {
    grid-template-columns: 1fr;
  }
}
.audio-settings h3 {
  margin: 0 0 0.7rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}
.audio-field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  font-size: 0.86rem;
  color: var(--text);
}
.tile.local.mirror-cam .tile-camera {
  transform: scaleX(-1);
}
.audio-field span {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--muted);
}
.audio-field em {
  font-style: normal;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.audio-field em.is-boost {
  color: #f0b232;
}
.audio-field select,
.audio-field input[type="range"] {
  width: 100%;
}
.audio-field select {
  background: var(--sidebar);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
}
.theme-select-menu {
  position: fixed;
  z-index: 260;
  margin: 0;
  padding: 0.3rem;
  max-height: min(16rem, 50vh);
  overflow: auto;
  background: #1e1f22;
  color: var(--text, #f2f3f5);
  border: 1px solid var(--border, #3f4147);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.theme-select-menu.is-light {
  background: #ffffff;
  color: #1e1f22;
  border-color: #d4d7dc;
}
html[data-theme="custom"] .theme-select-menu {
  background: #141518;
  color: var(--ww-custom-text, #f2f3f5);
  border-color: var(--ww-custom-outline, var(--border));
}
html[data-theme="custom"] .theme-select-menu.is-light {
  background: #f4f5f7;
  color: #1e1f22;
}
.theme-select-label {
  padding: 0.45rem 0.55rem 0.15rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #949ba4);
}
.theme-select-option {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.4rem 0.55rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  white-space: normal;
  word-break: break-word;
}
.theme-select-option:hover,
.theme-select-option.is-selected {
  background: var(--accent, #5865f2);
  color: #fff;
}
.theme-select-option:disabled {
  opacity: 0.45;
  cursor: default;
}
.audio-field input[type="range"] {
  accent-color: var(--accent);
}
.audio-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}
.audio-mode-toggle .mode-btn {
  min-width: 0;
  padding: 0.5rem 0.45rem;
  font-size: 0.78rem;
  background: var(--sidebar);
  border: 1px solid var(--border);
  color: var(--muted);
}
.audio-mode-toggle .mode-btn:hover {
  background: var(--hover);
  color: var(--text);
}
.audio-mode-toggle .mode-btn.active {
  background: rgba(88, 101, 242, 0.25);
  border-color: var(--accent);
  color: var(--text);
}
.phone-route,
.phone-route-settings {
  display: none;
}
body.mobile-audio .phone-route,
body.mobile-audio .phone-route-settings {
  display: grid;
}
.voice-bar .phone-route {
  width: min(100%, 12.5rem);
  flex: 0 0 auto;
  align-self: center;
}
.phone-route-settings {
  gap: 0.45rem;
  margin-top: 0.7rem;
}
.phone-route-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
}
.phone-route-note[hidden] { display: none !important; }
#cam-flip-btn,
.phone-cam-flip { display: none; }
body.mobile-audio #cam-flip-btn {
  display: inline-grid;
  width: auto;
  min-width: 2.75rem;
  padding: 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 800;
}
body.mobile-audio .phone-cam-flip { display: grid; gap: 0.35rem; }
.phone-cam-flip .mode-btn { width: auto; justify-self: start; }
#cam-flip-note[hidden] { display: none !important; }
.ptt-key-btn {
  width: 100%;
  min-width: 0;
  background: var(--sidebar);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.03em;
}
.ptt-key-btn.listening {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(88, 101, 242, 0.45);
}
.audio-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.15rem 0 0.45rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.audio-check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}
.audio-hint {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--muted);
}
.settings-info h5 {
  margin: 1rem 0 0.35rem;
  font-size: 0.92rem;
}
.settings-info p,
.settings-info li {
  margin: 0 0 0.75rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text);
}
.settings-info ul {
  margin: 0 0 0.75rem;
  padding-left: 1.15rem;
}
.settings-info li {
  margin-bottom: 0.4rem;
}
.settings-info p:last-child {
  margin-bottom: 0;
}
.update-bar {
  position: fixed;
  top: auto;
  left: auto;
  right: 0.85rem;
  bottom: 3.6rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 0.35rem;
  min-height: 0;
  max-width: min(18rem, calc(100vw - 1.5rem));
  padding: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: right;
  box-shadow: none;
  pointer-events: none;
}
.update-bar > * { pointer-events: auto; }
.update-bar-text {
  margin: 0;
  padding: 0 0.35rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
.update-bar-btn {
  background: #2d7d46 !important;
  color: #fff !important;
  font-weight: 800;
  font-size: 0.86rem;
  padding: 0.55rem 1rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
}
.update-bar-btn:hover {
  background: #3ba55d !important;
}
.update-bar-btn:disabled {
  opacity: 0.72;
  cursor: default;
}
.update-bar.is-required .update-bar-btn {
  background: #248046 !important;
}
body.has-update-bar {
  padding-top: 0 !important;
}

/* Desktop installer update: full-width top red bar (single CTA). */
.update-bar.is-desktop-update {
  top: 0;
  left: 0;
  right: 0;
  bottom: auto;
  max-width: none;
  width: 100%;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1rem;
  padding: 0.65rem 1rem;
  background: #b42318;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
  z-index: 400;
}
.update-bar.is-desktop-update .update-bar-text {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  text-shadow: none;
  padding: 0;
  max-width: 40rem;
  text-align: center;
}
.update-bar.is-desktop-update .update-bar-btn {
  background: #fff !important;
  color: #b42318 !important;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.update-bar.is-desktop-update .update-bar-btn:hover {
  background: #ffe8e6 !important;
}
.update-bar.is-desktop-update .update-bar-manual {
  display: none !important;
}
body.has-desktop-update-bar {
  /* padding-top set in JS from bar height */
}

.update-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin: 0.75rem 0;
}
.update-actions .primary-btn:disabled {
  opacity: 0.65;
  cursor: default;
}
.update-actions a.ghost-btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.update-bar-manual {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.45rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  background: transparent;
  border-radius: 6px;
}
.update-bar-manual:hover {
  color: var(--text);
  text-decoration: underline;
}
.update-bar-manual[hidden],
.update-bar-manual.view-hidden { display: none !important; }
body.dm-popout .update-bar {
  display: none !important;
}
body.dm-popout.has-update-bar {
  padding-top: 0 !important;
}
.update-version-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0 0 0.7rem;
}
.update-version-grid span {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.update-version-grid strong {
  display: block;
  margin-top: 0.15rem;
  font-size: 1.15rem;
  font-weight: 700;
}
.update-status {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.4;
  white-space: pre-line;
}
.update-next {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.65rem 0 0.1rem;
  color: var(--muted);
  font-size: 0.84rem;
}
.update-clock {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
#update-download-meta:empty {
  display: none;
}
.update-progress {
  height: 0.7rem;
  margin: 0.45rem 0;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 999px;
  overflow: hidden;
}
.update-progress > div {
  height: 100%;
  width: 0;
  background: var(--accent);
}
.uv-color-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.75rem;
  margin: 0 0 0.45rem;
}
.appearance-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 0.7rem;
  margin: 0 0 0.7rem;
}
.notify-sound-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  align-items: start;
}
.notify-sound-grid > .sound-area {
  margin: 0;
}
.voice-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  align-items: stretch;
  margin: 0 0 0.7rem;
}
.voice-pair > .sound-area {
  margin: 0;
  min-width: 0;
}
.settings-section-voice .voice-pair .settings-grid {
  grid-template-columns: 1fr;
}
.settings-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  align-items: stretch;
  margin: 0 0 0.7rem;
}
.settings-pair > .sound-area {
  margin: 0;
  min-width: 0;
}
@media (max-width: 640px) {
  .voice-pair,
  .settings-pair {
    grid-template-columns: 1fr;
  }
}
.appearance-pair > .sound-area {
  margin: 0;
  display: grid;
  gap: 0.55rem;
  align-content: start;
}
.appearance-pair .settings-banner-block,
.appearance-pair .settings-avatar-row {
  margin-top: 0;
}
.uv-color-row label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9rem;
}
.uv-color-row input[type="color"] {
  width: 3rem;
  height: 2.2rem;
  padding: 0.15rem;
  cursor: pointer;
}
@font-face {
  font-family: "WW Cinzel";
  src: url("assets/fonts/cinzel-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "WW Vibes";
  src: url("assets/fonts/vibes-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "WW Poster";
  src: url("assets/fonts/poster-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "WW Orbit";
  src: url("assets/fonts/orbit-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "WW Gothic";
  src: url("assets/fonts/gothic-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
[data-name-font="cinzel"] { font-family: "WW Cinzel", "Times New Roman", serif; }
[data-name-font="vibes"] { font-family: "WW Vibes", cursive; }
[data-name-font="poster"] { font-family: "WW Poster", "Times New Roman", serif; }
[data-name-font="orbit"] { font-family: "WW Orbit", sans-serif; }
[data-name-font="gothic"] { font-family: "WW Gothic", "Times New Roman", serif; }
.chat-msg .who[data-name-font="vibes"],
.chat-msg .who[data-name-font="poster"],
.chat-msg .who[data-name-font="gothic"],
.member-name[data-name-font="vibes"],
.member-name[data-name-font="poster"],
.member-name[data-name-font="gothic"],
.me-name[data-name-font="vibes"],
.me-name[data-name-font="poster"],
.me-name[data-name-font="gothic"],
.mini-profile-name[data-name-font="vibes"],
.mini-profile-name[data-name-font="poster"],
.mini-profile-name[data-name-font="gothic"],
.name-color-preview[data-name-font="vibes"],
.name-color-preview[data-name-font="poster"],
.name-color-preview[data-name-font="gothic"],
.name-font-choice[data-name-font="vibes"],
.name-font-choice[data-name-font="poster"],
.name-font-choice[data-name-font="gothic"] {
  font-weight: 400;
}
.chat-msg .who[data-name-font="vibes"],
.chat-msg .who[data-name-font="gothic"],
.name-color-preview[data-name-font="vibes"],
.name-color-preview[data-name-font="gothic"],
.mini-profile-name[data-name-font="vibes"],
.mini-profile-name[data-name-font="gothic"] {
  font-size: 1.2em;
}
.name-color-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 0.2rem 0 0.15rem;
}
.name-font-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.name-font-choice[data-name-font=""] {
  font-family: "gg sans", "Segoe UI", system-ui, sans-serif;
  font-weight: 600;
}
.name-font-choice {
  width: auto;
  padding: 0.32rem 0.6rem;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.2;
}
.name-font-choice:hover {
  background: var(--hover);
  color: var(--text);
}
.name-font-choice[aria-pressed="true"] {
  background: var(--active);
  color: var(--text);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.name-color-row .audio-field {
  width: auto;
  margin: 0;
}
#name-color {
  width: 3rem;
  height: 2.2rem;
  padding: 0.15rem;
  cursor: pointer;
}
.name-color-preview {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
}
.name-color-row button {
  width: auto;
  padding: 0.45rem 0.75rem;
}
#dm-notify-select,
#join-sound-select,
#leave-sound-select,
#my-join-sound-select,
#my-leave-sound-select {
  width: 100%;
  margin-top: 0.35rem;
}
.admin-access-options {
  margin-top: 0.35rem;
}
.admin-access-options .perm-row {
  align-items: flex-start;
}
.community-browse-card-meta .vis-tag {
  opacity: 0.85;
}
.notify-sound-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.45rem;
}
.notify-sound-row .mode-btn {
  min-width: 0;
  padding: 0.45rem 0.75rem;
}

.dm-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
}
.dm-window {
  position: absolute;
  width: min(360px, calc(100vw - 24px));
  height: min(440px, calc(100vh - 24px));
  min-width: 280px;
  min-height: 240px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 10px 10px 0 0;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  pointer-events: auto;
  color: var(--text);
}
.dm-window.is-docked {
  border-radius: 10px 10px 0 0;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.35);
}
.dm-window.is-floating {
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}
.dm-window.is-minimized {
  display: none !important;
}
.dm-window.is-dragging {
  opacity: 0.96;
  cursor: grabbing;
}
.dm-dock-bar {
  position: relative;
  grid-column: 1 / -1;
  grid-row: 2;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0 0.55rem;
  background: var(--dock);
  border-top: 1px solid var(--hairline);
  pointer-events: auto;
  z-index: 4;
}
#usage-btn[hidden],
#usage-btn.view-hidden { display: none !important; }
.usage-hot {
  position: absolute;
  top: 0.12rem;
  right: 0.12rem;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: #e01920;
  box-shadow: 0 0 0 2px var(--dock);
}
.usage-hot[hidden] { display: none !important; }
.usage-pop {
  position: absolute;
  left: 0.45rem;
  bottom: calc(100% + 0.4rem);
  width: min(24rem, calc(100vw - 1.2rem));
  display: flex;
  flex-direction: column;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  z-index: 30;
  overflow: hidden;
}
.usage-pop[hidden],
.usage-pop.view-hidden { display: none !important; }
.usage-note {
  margin: 0;
  padding: 0.45rem 0.75rem 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.usage-graph-wrap {
  height: 7.6rem;
  margin: 0.35rem 0.75rem 0;
  border-radius: 8px;
  overflow: hidden;
  background: color-mix(in srgb, var(--text) 6%, var(--panel));
}
.usage-graph {
  display: block;
  width: 100%;
  height: 100%;
}
.usage-legend {
  display: flex;
  gap: 0.85rem;
  list-style: none;
  margin: 0;
  padding: 0.4rem 0.75rem 0.15rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.usage-legend li::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.32rem;
  border-radius: 2px;
  vertical-align: -1px;
}
.usage-legend li[data-kind="cpu"]::before { background: #4aa3ff; }
.usage-legend li[data-kind="memory"]::before { background: #3dcc7a; }
.usage-legend li[data-kind="gpu"]::before { background: #f0a202; }
.app-usage {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.35rem 0.75rem 0.8rem;
}
.app-usage-meter {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  width: 100%;
}
.app-usage-name {
  flex: 0 0 3.6rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.app-usage-track {
  flex: 1 1 auto;
  width: auto;
  height: 0.5rem;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--text) 16%, transparent);
}
.app-usage-track > div {
  height: 100%;
  width: 0;
  border-radius: inherit;
}
.app-usage-meter[data-kind="cpu"] .app-usage-track > div { background: #4aa3ff; }
.app-usage-meter[data-kind="memory"] .app-usage-track > div { background: #3dcc7a; }
.app-usage-meter[data-kind="gpu"] .app-usage-track > div { background: #f0a202; }
.app-usage-track > div.is-hot { background: #e01920; }
.app-usage-value {
  min-width: 3.6rem;
  font-size: 0.68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--text);
}
.dm-dock-pills {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  gap: 0.4rem;
  overflow-x: auto;
  overflow-y: hidden;
  min-width: 0;
  padding: 0.2rem 0;
  scrollbar-width: thin;
}
.inbox-btn {
  position: relative;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.inbox-btn svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}
.inbox-btn:hover,
.inbox-btn[aria-expanded="true"] {
  background: var(--hover);
  color: var(--text);
}
.inbox-count {
  position: absolute;
  top: -0.2rem;
  right: -0.28rem;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: #ed4245;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.05rem;
  text-align: center;
  box-shadow: 0 0 0 2px var(--dock);
}
.inbox-count[hidden] { display: none !important; }
.inbox-pop {
  position: absolute;
  left: 0.45rem;
  bottom: calc(100% + 0.4rem);
  width: min(32rem, calc(100vw - 1rem));
  max-height: min(34rem, calc(100vh - 6rem));
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  z-index: 30;
  overflow: hidden;
}
.inbox-pop[hidden],
.inbox-pop.view-hidden { display: none !important; }
.inbox-rail {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 0 0 auto;
  padding: 0.45rem;
  background: color-mix(in srgb, var(--text) 4%, var(--sidebar));
  border-right: 1px solid var(--hairline);
}
.inbox-tab {
  width: 2.15rem;
  height: 2.15rem;
  margin: 0;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.inbox-tab svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}
.inbox-tab:hover,
.inbox-tab.is-current {
  background: var(--active);
  color: var(--text);
}
.inbox-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.inbox-gear {
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: grid;
  place-items: center;
}
.inbox-gear svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}
.inbox-panel[hidden],
.inbox-panel.view-hidden { display: none !important; }
.inbox-pop[data-inbox-tab="mentions"] .inbox-foot,
.inbox-pop[data-inbox-tab="calls"] .inbox-foot,
.inbox-pop[data-inbox-tab="calls"] #inbox-clear-all { display: none; }
.inbox-call-row {
  display: grid;
  gap: 0.08rem;
  padding: 0.4rem 0.45rem;
  cursor: default;
}
.inbox-call-row.is-join .inbox-title { color: var(--ok); }
.inbox-call-row.is-leave .inbox-title { color: var(--danger); }
.gallery-pop {
  position: absolute;
  left: 0.45rem;
  bottom: calc(100% + 0.4rem);
  width: min(44rem, calc(100vw - 1rem));
  max-height: min(36rem, calc(100vh - 6rem));
  display: flex;
  flex-direction: column;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  z-index: 30;
  overflow: hidden;
}
.gallery-pop[hidden],
.gallery-pop.view-hidden { display: none !important; }
.dms-pop {
  position: absolute;
  left: 0.45rem;
  bottom: calc(100% + 0.4rem);
  width: min(28rem, calc(100vw - 1rem));
  max-height: min(34rem, calc(100vh - 6rem));
  display: flex;
  flex-direction: column;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  z-index: 30;
  overflow: hidden;
}
.dms-pop[hidden],
.dms-pop.view-hidden { display: none !important; }
.dms-search {
  padding-top: 0.15rem;
}
.dms-list {
  list-style: none;
  margin: 0;
  padding: 0 0.55rem 0.7rem;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  scrollbar-width: thin;
}
.dms-row {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}
.dms-row .dms-item {
  flex: 1 1 auto;
  min-width: 0;
}
.dms-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin: 0 0 0.2rem;
  padding: 0.4rem 0.45rem;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  border: 0;
  cursor: pointer;
}
.dms-item:hover,
.dms-item:focus-visible {
  background: var(--hover);
  outline: none;
}
.dms-item.is-open .dms-item-meta {
  color: var(--ok);
}
.dms-item.is-attention .dms-item-name {
  font-weight: 800;
}
.dms-item .avatar {
  flex: 0 0 auto;
}
.dms-item-body {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 0.05rem;
}
.dms-item-name {
  font-size: 0.88rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dms-item-meta {
  font-size: 0.7rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dms-item-close {
  flex: 0 0 auto;
  width: 1.7rem;
  height: 1.7rem;
  margin: 0;
  padding: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  border: 0;
  cursor: pointer;
}
.dms-item-close:hover {
  background: var(--hover);
  color: var(--text);
}
.dms-section-label {
  margin: 0.35rem 0.2rem 0.25rem;
  padding: 0 0.25rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.gallery-status {
  margin: 0;
  padding: 0.35rem 0.75rem 0.55rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.gallery-status[hidden] { display: none !important; }
.gallery-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.45rem;
  padding: 0 0.7rem 0.75rem;
  scrollbar-width: thin;
}
.gallery-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  min-width: 0;
}
.gallery-thumb-wrap {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: color-mix(in srgb, var(--text) 6%, var(--panel));
  border: 1px solid var(--hairline);
}
.gallery-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}
.gallery-thumb-wrap .chat-mature {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  min-width: 0;
  min-height: 0;
}
.gallery-thumb-wrap .chat-mature:not(.is-open) {
  min-width: 0;
  min-height: 0;
}
.gallery-thumb-wrap .chat-mature img,
.gallery-thumb-wrap .chat-mature .gallery-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-thumb-wrap .chat-mature-cover {
  border-radius: 8px;
  font-size: 0.72rem;
}
.gallery-meta {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
}
.gallery-channel,
.gallery-who {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
  line-height: 1.2;
}
.gallery-channel {
  color: var(--text);
  font-weight: 650;
}
.gallery-who {
  color: var(--muted);
}
.gallery-open-post {
  position: absolute;
  right: 0.3rem;
  bottom: 0.3rem;
  z-index: 2;
  margin: 0;
  padding: 0.18rem 0.4rem;
  border-radius: 6px;
  border: 0;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
}
.gallery-card:hover .gallery-open-post,
.gallery-card:focus-within .gallery-open-post {
  opacity: 1;
  pointer-events: auto;
}
.bookmarks-pop {
  position: absolute;
  left: 0.45rem;
  bottom: calc(100% + 0.4rem);
  width: min(44rem, calc(100vw - 1.2rem));
  height: min(28rem, calc(100vh - 6rem));
  display: flex;
  flex-direction: column;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  z-index: 30;
  overflow: hidden;
}
.bookmarks-pop[hidden],
.bookmarks-pop.view-hidden { display: none !important; }
.bookmarks-search {
  display: block;
  padding: 0 0.7rem 0.55rem;
}
.bookmarks-search input {
  width: 100%;
  padding: 0.45rem 0.6rem;
  font-size: 0.84rem;
}
.bookmarks-body {
  display: grid;
  grid-template-columns: 13.5rem minmax(0, 1fr);
  min-height: 0;
  flex: 1 1 auto;
  border-top: 1px solid var(--hairline);
}
.bookmarks-users {
  list-style: none;
  margin: 0;
  padding: 0.35rem;
  overflow: auto;
  border-right: 1px solid var(--hairline);
}
.bookmarks-user {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.15rem;
  padding: 0.32rem 0.4rem;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: 650;
}
.bookmarks-user:hover,
.bookmarks-user.is-on { background: var(--wash); }
.bookmarks-user .avatar {
  flex: 0 0 auto;
}
.bookmarks-user-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
}
.bookmarks-user-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}
.bookmarks-main {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 0.35rem;
}
.bookmarks-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.bookmarks-list .dm-bookmark-item { width: 100%; }
@media (max-width: 640px) {
  .bookmarks-body {
    grid-template-columns: 1fr;
    grid-template-rows: 8.5rem minmax(0, 1fr);
  }
  .bookmarks-users {
    border-right: 0;
    border-bottom: 1px solid var(--hairline);
  }
}
.inbox-head,
.inbox-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
}
.inbox-head { border-bottom: 1px solid var(--hairline); }
.inbox-foot { border-top: 1px solid var(--hairline); }
.inbox-head h3 {
  margin: 0;
  font-size: 0.92rem;
}
.inbox-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}
.inbox-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.inbox-section + .inbox-section {
  border-top: 1px solid var(--hairline);
  margin-top: 0.15rem;
}
.inbox-section-title {
  margin: 0;
  padding: 0.5rem 0.75rem 0.05rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.inbox-section .inbox-empty {
  padding-top: 0.35rem;
  padding-bottom: 0.55rem;
}
.inbox-action {
  padding: 0.28rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
}
.inbox-empty {
  margin: 0;
  padding: 0.9rem 0.8rem 0.4rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.inbox-empty[hidden] { display: none !important; }
.inbox-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem;
  overflow: visible;
  min-height: 0;
}
.inbox-item {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  border-radius: 8px;
}
.inbox-item + .inbox-item { margin-top: 0.15rem; }
.inbox-item:hover { background: var(--wash); }
.inbox-check {
  display: grid;
  place-items: center;
  width: 1.8rem;
  flex: 0 0 auto;
  cursor: pointer;
}
.inbox-check input {
  width: 0.95rem;
  height: 0.95rem;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.inbox-open {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0.4rem 0.45rem 0.4rem 0;
  display: grid;
  gap: 0.08rem;
  background: transparent;
  color: var(--text);
  text-align: left;
  border-radius: 8px;
}
.inbox-open:hover { background: transparent; }
.inbox-open.inbox-mention { padding-left: 0.45rem; }
.inbox-title {
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inbox-body {
  color: var(--soft);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inbox-when {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
}
.chat-msg.is-inbox-target {
  background: rgba(88, 101, 242, 0.18);
  border-radius: 6px;
}
.dm-dock-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  max-width: 220px;
  height: 32px;
  padding: 0 0.35rem 0 0.45rem;
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  background: var(--sidebar);
  color: var(--text, #f2f3f5);
  cursor: pointer;
}
.dm-dock-pill:hover {
  background: var(--hover);
}
.dm-dock-pill.is-active {
  border-color: rgba(88, 101, 242, 0.55);
  box-shadow: 0 0 0 1px rgba(88, 101, 242, 0.25);
}
.dm-dock-pill.is-minimized {
  opacity: 0.78;
}
.dm-dock-pill-name {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  min-width: 0;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  padding: 0;
}
.dm-dock-pill-btn {
  flex: 0 0 auto;
  width: 1.45rem;
  height: 1.45rem;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted, var(--soft));
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}
.dm-dock-pill-btn:hover {
  background: var(--wash);
  color: #fff;
}
.dm-dock-pill-btn.is-close:hover {
  background: rgba(237, 66, 69, 0.22);
}
.dm-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  touch-action: none;
  z-index: 3;
}
.dm-resize::before {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(255, 255, 255, 0.35);
  border-bottom: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 0 0 2px 0;
}
.dm-resize:hover::before {
  border-color: rgba(255, 255, 255, 0.7);
}
.dm-window.is-top {
  z-index: 2;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
}
.dm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  background: var(--sidebar);
  border-bottom: 1px solid var(--rule);
  cursor: move;
  user-select: none;
}
.dm-head-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.dm-head-user strong {
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dm-head-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 auto;
}
.dm-action-btn {
  border: 1px solid var(--hairline-strong);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.28rem 0.5rem;
  cursor: pointer;
  line-height: 1.2;
}
.dm-action-btn:hover {
  background: var(--hover);
}
.dm-call-btn {
  border-color: rgba(35, 165, 89, 0.45);
  color: #8be0ad;
}
.dm-call-btn:hover {
  background: rgba(35, 165, 89, 0.16);
}
.dm-call-btn.is-hangup {
  border-color: rgba(218, 55, 60, 0.55);
  color: #ffb4b6;
}
.dm-call-btn.is-hangup:hover {
  background: rgba(218, 55, 60, 0.16);
}
.dm-call {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.45rem 0.5rem 0.4rem;
  background: var(--inset);
  border-bottom: 1px solid var(--rule);
  flex: 0 0 auto;
  min-height: 0;
}
.dm-window.in-stream .dm-call,
.dm-window.in-call .dm-call,
body.dm-popout .dm-window.is-popout-host .dm-call {
  flex: 1 1 auto;
  overflow: hidden;
}
.dm-call[hidden],
.dm-call.view-hidden { display: none !important; }
.dm-call-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: minmax(0, 1fr);
  gap: 0.4rem;
  height: 220px;
  min-height: 140px;
}
.dm-window.in-call .dm-call-grid,
.dm-window.in-stream .dm-call-grid,
body.dm-popout .dm-call-grid,
body.dm-popout .dm-window.in-call .dm-call-grid,
body.dm-popout .dm-window.is-popout-host .dm-call-grid {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  max-height: none;
}
.dm-call-grid[hidden] { display: none !important; }
.dm-call.sync-on .sync-stage {
  display: flex;
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  order: 3;
}
.dm-call.sync-on .dm-call-grid,
.dm-window.in-call .dm-call.sync-on .dm-call-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  height: min(280px, 36vh);
  min-height: 140px;
}
body.dm-popout .dm-call.sync-on .dm-call-grid,
body.dm-popout .dm-window.in-call .dm-call.sync-on .dm-call-grid {
  height: min(46vh, 420px);
}
button.dm-call-ctrl.sync-btn {
  width: auto;
  min-width: 2.4rem;
  padding: 0 0.4rem;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}
.dm-call-grid > .tile.local,
.dm-call-grid > .dm-call-wait.is-local,
.dm-duo.is-local { grid-column: 1; grid-row: 1; order: 1; }
.dm-call-grid > .tile:not(.local),
.dm-call-grid > .dm-call-wait.is-remote,
.dm-duo.is-remote { grid-column: 2; grid-row: 1; order: 2; }
.dm-call.sync-on .sync-stage { grid-column: 3; grid-row: 1; }
.dm-call-grid { position: relative; }
.dm-duo {
  position: relative;
  z-index: 3;
  min-width: 0;
  min-height: 0;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  color: #fff;
}
.dm-duo[hidden] { display: none !important; }
.dm-call-grid.duo-focus-local > .dm-duo.is-local,
.dm-call-grid.duo-focus-remote > .dm-duo.is-remote {
  grid-column: 1 / 3;
  z-index: 4;
}
.dm-call-grid.duo-focus-local > .dm-duo.is-remote,
.dm-call-grid.duo-focus-remote > .dm-duo.is-local {
  display: none !important;
}
button.dm-duo-hit {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: transparent;
  cursor: pointer;
  outline: none;
}
button.dm-duo-hit:hover,
button.dm-duo-hit:focus {
  background: transparent;
  color: transparent;
}
.dm-duo-mount,
.dm-duo-player,
.dm-duo-frame,
.dm-duo-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
  object-fit: contain;
}
.dm-duo-mount video::-webkit-media-controls,
.dm-duo-mount video::-webkit-media-controls-enclosure,
.dm-duo-mount video::-webkit-media-controls-panel {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.dm-duo-label {
  position: absolute;
  z-index: 4;
  left: 0.4rem;
  top: 0.35rem;
  max-width: calc(100% - 0.8rem);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}
.dm-duo-note {
  position: absolute;
  z-index: 4;
  left: 0.4rem;
  right: 0.4rem;
  top: 1.8rem;
  margin: 0;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}
.dm-duo-note[hidden] { display: none !important; }
.dm-duo-bar {
  position: absolute;
  z-index: 5;
  left: 0.35rem;
  right: 0.35rem;
  bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.35rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.78);
}
.dm-duo-bar button[hidden],
.dm-duo-bar input[hidden],
.dm-duo-bar .dm-duo-vol[hidden] { display: none !important; }
.dm-duo-bar button,
.dm-duo-pick button,
.dm-duo-add {
  width: auto;
  height: 1.8rem;
  margin: 0;
  padding: 0 0.55rem;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}
.dm-duo-bar button:hover,
.dm-duo-pick button:hover,
.dm-duo-add:hover { background: rgba(255, 255, 255, 0.28); }
.dm-duo-bar input.dm-duo-volume {
  box-sizing: content-box;
  flex: 1 1 auto;
  width: auto;
  min-width: 3rem;
  height: 1.1rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.dm-duo-pick input,
.dm-duo-pick select {
  width: 100%;
  margin: 0;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  font-size: 0.78rem;
}
.dm-duo-vol {
  flex: 0 0 auto;
  min-width: 2rem;
  font-size: 0.72rem;
  font-weight: 800;
}
.dm-duo-pick {
  position: absolute;
  z-index: 6;
  left: 0.4rem;
  right: 0.4rem;
  top: 1.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.45rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.88);
}
.dm-duo-pick[hidden] { display: none !important; }
.dm-duo-pick-row { display: flex; gap: 0.35rem; }
.dm-duo-add {
  position: absolute;
  z-index: 6;
  left: 0.45rem;
  top: 0.4rem;
}
.dm-duo-add[hidden] { display: none !important; }
.dm-call-grid:has(.dm-duo.is-local:not([hidden])) > .dm-call-wait.is-local { display: none !important; }
.dm-call-grid:has(.dm-duo.is-remote:not([hidden])) > .dm-call-wait.is-remote { display: none !important; }
.dm-call-grid:has(.dm-duo.is-local:not([hidden])) > .tile.local,
.dm-call-grid:has(.dm-duo.is-remote:not([hidden])) > .tile:not(.local) {
  position: relative;
  width: 88px;
  height: 64px;
  z-index: 5;
  align-self: end;
  margin-bottom: 2.5rem;
}
.dm-call-grid:has(.dm-duo.is-local:not([hidden])) > .tile.local {
  justify-self: start;
  margin-left: 0.4rem;
}
.dm-call-grid:has(.dm-duo.is-remote:not([hidden])) > .tile:not(.local) {
  justify-self: end;
  margin-right: 0.4rem;
}
.dm-window.in-call .dm-call-grid:has(.dm-duo:not([hidden])),
.dm-window.in-stream .dm-call-grid:has(.dm-duo:not([hidden])),
body.dm-popout .dm-call-grid:has(.dm-duo:not([hidden])) {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  max-height: none;
}
.dm-window.in-stream .dm-duo,
.dm-window.in-call .dm-duo,
body.dm-popout .dm-duo {
  height: 100%;
  min-height: 120px;
}
.dm-duo-park {
  position: fixed;
  left: 0;
  top: 0;
  width: 640px;
  height: 360px;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}
.dm-call-grid .tile {
  min-height: 0;
  height: 100%;
}
.dm-call-wait {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 0;
  height: 100%;
  border-radius: 12px;
  border: 3px solid var(--border);
  background: var(--input);
  color: var(--text);
}
.dm-call-wait.is-hidden { display: none !important; }
.dm-call-wait .avatar {
  width: 56px;
  height: 56px;
  font-size: 1.05rem;
}
.dm-call-wait-name {
  font-size: 0.82rem;
  font-weight: 700;
  max-width: 100%;
  padding: 0 0.4rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dm-call-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
}
.dm-call-bar[hidden] { display: none !important; }
button.dm-call-ctrl {
  width: 2.4rem;
  height: 2.4rem;
  min-width: 2.4rem;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: var(--input);
  border: 1px solid var(--border);
  color: var(--text);
  line-height: 1;
}
button.dm-call-ctrl svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}
button.dm-call-ctrl:hover { background: var(--sidebar); }
button.dm-call-ctrl.danger {
  background: var(--danger);
  border-color: transparent;
  color: #fff;
}
button.dm-call-ctrl.danger:hover { filter: brightness(1.05); }
button.dm-call-ctrl.on {
  background: rgba(35, 165, 89, 0.22);
  border-color: var(--ok);
  color: #6dffb0;
}
button.dm-call-ctrl.muted,
button.dm-call-ctrl.is-mute {
  background: rgba(218, 55, 60, 0.18);
  border-color: var(--danger);
  color: var(--danger-text);
}
.dm-call-ring {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.15rem 0.1rem 0.2rem;
}
.dm-call-ring[hidden],
.dm-call-ring.view-hidden { display: none !important; }
.dm-call-ring-text {
  margin: 0;
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 700;
}
.dm-call-ring-actions {
  display: flex;
  gap: 0.35rem;
  flex: 0 0 auto;
}
button.dm-call-join,
button.dm-call-decline {
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  font-size: 0.78rem;
}
button.dm-call-join {
  background: #23a559;
  color: #fff;
}
button.dm-call-join:hover { filter: brightness(1.05); }
button.dm-call-decline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
button.dm-call-decline:hover { background: var(--hover); }
.dm-head-actions .dm-action-btn,
.dm-head-actions .dm-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.85rem;
  box-sizing: border-box;
}
.dm-close {
  min-width: 1.85rem;
  padding: 0 0.35rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}
.dm-close:hover {
  background: rgba(237, 66, 69, 0.2);
  color: #fff;
}
html:has(body.dm-popout),
body.dm-popout {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}
body.dm-popout #app {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}
body.dm-popout #login,
body.dm-popout .sidebar,
body.dm-popout .main,
body.dm-popout #voice-bar,
body.dm-popout #audio-settings-backdrop,
body.dm-popout #audio-settings,
body.dm-popout #private-call-menu {
  display: none !important;
}
body.dm-popout #shell {
  display: none !important;
}
body.dm-popout .dm-layer {
  inset: 0;
  z-index: 1;
  background: var(--bg);
}
body.dm-popout .dm-dock-bar,
body.dm-popout .dm-resize {
  display: none !important;
}
body.dm-popout .dm-window.is-popout-host {
  position: fixed;
  left: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  border-radius: 0;
  box-shadow: none;
  border: 0;
  overflow: hidden;
}
body.dm-popout .dm-head {
  cursor: default;
}
.dm-chat-pane {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}
.dm-window.in-stream .dm-chat-pane,
.dm-window.in-call .dm-chat-pane {
  flex: 0 0 auto;
  height: var(--dm-chat-h, 240px);
  min-height: 0;
  max-height: none;
}
.dm-chat-split {
  display: none;
}
.dm-window.in-stream .dm-chat-split,
.dm-window.in-call .dm-chat-split {
  display: flex;
}
.dm-log {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}
.dm-log[hidden],
.dm-form[hidden],
.dm-bookmarks[hidden] { display: none !important; }
.dm-tabs {
  display: flex;
  background: var(--sidebar);
  border-bottom: 1px solid var(--rule);
}
.dm-tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.38rem 0.5rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
}
.dm-tab.is-on {
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.dm-bookmarks {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.55rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.dm-bookmark-empty {
  margin: 0.35rem 0;
  color: var(--muted);
  font-size: 0.84rem;
}
.dm-bookmark-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.45rem;
  text-align: left;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  color: var(--text);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  cursor: pointer;
  font: inherit;
}
.dm-bookmark-who { font-weight: 700; font-size: 0.82rem; }
.dm-bookmark-when { color: var(--muted); font-size: 0.72rem; }
.dm-bookmark-snip { flex: 1 0 100%; font-size: 0.84rem; color: var(--soft); }
.chat-msg.is-bookmark-hit { outline: 2px solid var(--accent); border-radius: 6px; }
.dm-upload-status {
  padding: 0.25rem 0.75rem 0;
  margin: 0;
  background: var(--sidebar);
}
.dm-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.55rem 0.65rem 0.65rem;
  border-top: 1px solid var(--rule);
  background: var(--sidebar);
  align-items: stretch;
}
.dm-compose {
  display: flex;
  gap: 0.4rem;
  align-items: flex-end;
}
.dm-form input[type="text"],
.dm-compose textarea {
  flex: 1;
  min-width: 0;
  width: auto;
  min-height: 2.55rem;
  max-height: 9.5rem;
  resize: none;
  overflow: hidden;
  font-size: calc(0.95rem * var(--ww-text-scale));
  line-height: 1.35;
  border: 0;
  border-radius: 8px;
  background: var(--hover);
  color: var(--text);
  padding: 0.55rem 0.7rem;
}
.dm-compose button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  font-weight: 600;
  flex: 0 0 auto;
  align-self: flex-end;
  min-height: 2.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dm-form button.dm-attach {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
  min-height: 2.55rem;
  background: transparent;
  border: 1px solid var(--hairline-strong);
  color: var(--text);
  padding: 0 0.85rem;
  line-height: 1;
}
.dm-form button.dm-attach:hover {
  background: var(--hover);
}
.dm-form .chat-reply-cancel {
  background: transparent;
  color: var(--muted);
  border: 0;
  padding: 0.25rem 0.45rem;
  font-size: 0.78rem;
}
.dm-empty {
  color: var(--muted);
  font-size: 0.85rem;
  margin: auto;
  text-align: center;
  padding: 1rem;
}

@media (max-width: 980px) {
  .shell.members-open {
    grid-template-columns: 240px 1fr 260px;
  }
}
.channels-toggle { display: none; }
.phone-scrim {
  position: fixed;
  inset: 0;
  z-index: 70;
  border: 0;
  margin: 0;
  padding: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}
.phone-scrim[hidden],
.phone-scrim.view-hidden { display: none !important; }
@media (max-width: 900px) {
  body:not(.dm-popout) .channels-toggle { display: inline-flex; }
  body:not(.dm-popout) .shell,
  body:not(.dm-popout) .shell.members-open {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }
  body:not(.dm-popout) .main {
    grid-column: 1;
    grid-row: 1;
  }
  body:not(.dm-popout) .dm-dock-bar {
    grid-column: 1;
    grid-row: 2;
  }
  body:not(.dm-popout) .sidebar {
    position: fixed;
    z-index: 80;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(19rem, 88vw);
    max-height: none;
    transform: translateX(-105%);
    transition: transform 0.18s ease;
    box-shadow: 8px 0 28px rgba(0, 0, 0, 0.45);
  }
  body.phone-channels:not(.dm-popout) .sidebar { transform: none; }
  body:not(.dm-popout) .members-rail,
  body:not(.dm-popout) .shell.members-open .members-rail {
    display: flex;
    position: fixed;
    z-index: 80;
    top: 0;
    bottom: 0;
    right: 0;
    left: auto;
    width: min(19rem, 88vw);
    max-height: none;
    grid-column: auto;
    grid-row: auto;
    border-top: 0;
    transform: translateX(105%);
    transition: transform 0.18s ease;
    box-shadow: -8px 0 28px rgba(0, 0, 0, 0.45);
  }
  body.phone-members:not(.dm-popout) .members-rail,
  body.phone-members:not(.dm-popout) .shell.members-open .members-rail {
    transform: none;
  }
  body:not(.dm-popout) .main-head {
    padding: 0.5rem 0.6rem;
    gap: 0.35rem;
  }
  body:not(.dm-popout) .main-head-right { gap: 0.15rem; }
  body:not(.dm-popout) .voice-status {
    max-width: 6.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body:not(.dm-popout) .stage { padding: 0.4rem; }
  body:not(.dm-popout) .voice-bar {
    padding: 0.4rem 0.35rem calc(0.5rem + env(safe-area-inset-bottom));
  }
  body:not(.dm-popout) .user-bar {
    padding-bottom: calc(0.55rem + env(safe-area-inset-bottom));
  }
  body:not(.dm-popout) .chat-compose textarea,
  body:not(.dm-popout) .dm-compose textarea {
    font-size: max(16px, calc(0.95rem * var(--ww-text-scale)));
  }
}
@media (max-width: 800px) {
  body:not(.dm-popout) .dm-window:not(.in-stream):not(.in-call) {
    width: calc(100vw - 16px);
    height: min(52vh, 420px);
  }
  .chat-paw-actions,
  .chat-msg .paw-buttons {
    gap: 0.3rem;
  }
  .chat-paw-actions button,
  .paw-btn {
    padding: 0.34rem 0.55rem;
    font-size: 0.76rem;
  }
  .vrc-link-actions {
    width: 100%;
    margin-left: 0;
  }
  .vrc-link-btn {
    padding: 0.34rem 0.55rem;
    font-size: 0.76rem;
  }
}
body.dm-popout .members-rail,
body.dm-popout .members-toggle,
body.dm-popout .layout-menu,
body.dm-popout .bookmarks-menu,
body.dm-popout .call-debug,
body.dm-popout .chat-paw-actions {
  display: none !important;
}
body.dm-popout .shell,
body.dm-popout .shell.members-open {
  grid-template-columns: 1fr;
}

.community-modal {
  width: min(36rem, calc(100vw - 2rem));
}
.community-admin-modal {
  width: min(52rem, calc(100vw - 2rem));
  height: min(44rem, calc(100vh - 2rem));
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
}
.community-admin-layout {
  flex: 1 1 auto;
  min-height: 0;
}
.community-admin-nav {
  overflow: auto;
}
.community-nav-label {
  margin: 0.7rem 0.45rem 0.15rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.community-nav-label:first-child {
  margin-top: 0.15rem;
}
.community-admin-only[hidden],
.community-admin-only.view-hidden {
  display: none !important;
}
.community-admin-pages .admin-list {
  max-height: min(22rem, 42vh);
}
.community-browse-modal {
  width: min(52rem, calc(100vw - 2rem));
  max-height: min(86vh, 42rem);
  display: flex;
  flex-direction: column;
}
.community-browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.85rem;
  max-height: min(60vh, 28rem);
  overflow: auto;
  padding: 0.15rem;
}
.community-browse-card {
  display: flex;
  flex-direction: column;
  background: var(--wash);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  overflow: hidden;
  min-width: 0;
}
.community-browse-card-banner {
  height: 72px;
  background: linear-gradient(135deg, var(--sidebar) 0%, var(--input) 55%, #5865f2 160%);
  position: relative;
}
.community-browse-card-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.community-browse-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.7rem 0.75rem 0.8rem;
  flex: 1;
}
.community-browse-card-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.community-browse-card-meta {
  margin: 0;
  color: var(--muted, var(--soft));
  font-size: 0.75rem;
}
.community-browse-card .primary-btn,
.community-browse-card .ghost-btn {
  width: 100%;
  margin-top: auto;
}
.community-modal-body {
  display: block !important;
  grid-template-columns: none !important;
  overflow: auto;
}
.community-modal-actions {
  margin-top: 0.85rem;
  display: flex;
  justify-content: flex-end;
}
.community-choice-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.community-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  width: 100%;
  text-align: left;
  border: 1px solid var(--hairline);
  background: var(--wash);
  color: inherit;
  border-radius: 10px;
  padding: 0.85rem 0.9rem;
  cursor: pointer;
}
.community-choice span {
  color: var(--muted, var(--soft));
  font-size: 0.85rem;
}
.community-code-form {
  margin-bottom: 0.9rem;
}
.community-code-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.community-code-row input {
  flex: 1 1 auto;
  min-width: 0;
}
.server-add {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 0 0.9rem;
}
.server-add label {
  font-weight: 700;
}
.server-add-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.server-add-row input {
  flex: 1 1 auto;
  min-width: 0;
}
.server-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.server-row {
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 0.75rem 0.8rem;
  background: var(--wash);
}
.server-row-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}
.server-row-name {
  font-weight: 700;
}
.server-row-status {
  color: var(--muted, var(--soft));
  font-size: 0.8rem;
}
.server-row-actions {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.55rem;
}
.server-report {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.55rem;
}
.server-report textarea {
  width: 100%;
  min-height: 4.2rem;
  resize: vertical;
}
.hotkey-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 0 0.75rem;
}
.hotkey-group {
  margin: 0.55rem 0 0.05rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.hotkey-group:first-child {
  margin-top: 0;
}
.hotkey-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.45rem 0.6rem;
  background: var(--sidebar);
  border: 1px solid var(--hairline);
  border-radius: 8px;
}
.hotkey-row-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.hotkey-row-copy strong {
  font-size: 0.92rem;
}
.hotkey-row-note {
  margin: 0;
  color: #ed4245;
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1.3;
}
.hotkey-keys {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
}
.hotkey-keys.is-empty {
  color: var(--muted);
  font-weight: 600;
}
.hotkey-keys span {
  padding: 0.08rem 0.35rem;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  background: var(--inset);
}
.hotkey-keys .hotkey-plus {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}
.hotkey-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 0 0 auto;
}
.hotkey-row-actions button.ghost,
#hotkey-capture.ghost,
#hotkey-reset.ghost {
  border: 1px solid var(--hairline);
  color: var(--text);
  background: transparent;
  padding: 0.35rem 0.55rem;
  font-size: 0.78rem;
}
.hotkey-row-actions button.ghost:hover,
#hotkey-capture.ghost:hover,
#hotkey-reset.ghost:hover {
  background: var(--hover);
  color: var(--text);
}
.hotkey-row-actions button.is-listening,
#hotkey-capture.is-listening {
  border-color: var(--accent);
  color: var(--text);
}
.hotkey-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0 0 0.35rem;
}
#hotkey-capture:focus-visible {
  outline: 2px solid var(--accent, #5865f2);
  outline-offset: 2px;
}
#hotkey-status.is-error {
  color: var(--danger, #ed4245);
}
.settings-section-hotkeys > #hotkey-reset {
  margin-top: 0.15rem;
}
@media (max-width: 720px) {
  .hotkey-row {
    align-items: flex-start;
    flex-direction: column;
  }
}
.primary-btn {
  border: 0;
  border-radius: 8px;
  background: var(--accent, #5865f2);
  color: #fff;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  font-weight: 600;
}
.primary-btn:hover {
  filter: brightness(1.06);
}
.community-public {
  margin: 0 0 0.35rem;
}
.community-tag-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.7rem 0 0.75rem;
  min-width: 0;
}
.community-tag-row .admin-hint {
  margin: 0;
}
.community-tag-edit {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--hairline);
}
.community-tag-edit[hidden],
.community-tag-edit.view-hidden {
  display: none !important;
}
.community-tag-icon-input {
  flex: 0 0 4.2rem !important;
  width: 4.2rem;
  min-width: 4.2rem !important;
  text-align: center;
}
.community-tag-text-input {
  flex: 0 1 7.5rem !important;
  width: 7.5rem;
  min-width: 6rem !important;
  max-width: 8rem;
  text-transform: uppercase;
}
.admin-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0;
  border-bottom: 1px solid var(--hairline);
}
.admin-tabs[hidden],
.admin-tabs.view-hidden,
#community-admin-tools[hidden],
#community-admin-tools.view-hidden {
  display: none !important;
}
.admin-tab {
  border: 0;
  background: transparent;
  color: var(--muted, var(--soft));
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  border-bottom: 2px solid transparent;
}
.admin-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent, #5865f2);
}
.admin-panels {
  flex: 1;
  min-height: 0;
}
.admin-panel h4 {
  margin: 0 0 0.65rem;
}
.admin-panel h5 {
  margin: 0.85rem 0 0.45rem;
}
.admin-list {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 12rem;
  overflow: auto;
}
.admin-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  background: var(--wash);
}
.admin-list button.ghost-link {
  border: 0;
  background: transparent;
  color: var(--accent, #5865f2);
  cursor: pointer;
  font: inherit;
  padding: 0;
}
#admin-group-list.admin-list {
  max-height: 32rem;
}
.admin-list li.admin-group-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.3rem;
}
.admin-group-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}
.admin-channel-children {
  list-style: none;
  margin: 0;
  padding: 0 0 0.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.admin-list li.admin-channel-row,
.admin-list li.admin-channel-empty {
  justify-content: flex-start;
  background: transparent;
  padding: 0.22rem 0.35rem;
}
.admin-list li.admin-channel-row {
  border: 1px solid var(--hairline-strong);
}
.admin-list li.admin-channel-empty {
  color: var(--muted);
  font-size: 0.78rem;
}
.admin-rename,
.admin-list button.ghost-link.admin-delete {
  margin-left: 0.35rem;
  font-size: 0.72rem;
  flex: 0 0 auto;
}
.admin-list button.ghost-link.admin-delete {
  color: var(--danger-text);
}
.admin-list button.ghost-link.admin-delete:hover {
  color: #fff;
  background: var(--danger);
}
.admin-rename-input {
  flex: 1;
  min-width: 0;
  height: 1.6rem;
  border-radius: 6px;
  border: 1px solid var(--hairline-strong);
  background: var(--input);
  color: var(--text);
  padding: 0 0.4rem;
}
.admin-channel-kind {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.75rem;
  flex: 0 0 auto;
}
.admin-group-row.is-dragging,
.admin-channel-row.is-dragging {
  opacity: 0.45;
}
.admin-group-row.is-drop-before,
.admin-channel-row.is-drop-before {
  box-shadow: inset 0 2px 0 var(--accent, #5865f2);
}
.admin-group-row.is-drop-after,
.admin-channel-row.is-drop-after {
  box-shadow: inset 0 -2px 0 var(--accent, #5865f2);
}
.admin-group-row.is-drop-into {
  box-shadow: inset 0 0 0 2px var(--accent, #5865f2);
}
.cat-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cat-active-call {
  margin-left: 0.35rem;
  flex: 0 0 auto;
  height: 1.05rem;
  padding: 0 0.42rem;
  border-radius: 999px;
  background: #ed4245;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.05rem;
}
.admin-drag-handle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.4rem;
  margin-right: 0.15rem;
  color: var(--muted);
  cursor: grab;
  user-select: none;
}
.admin-drag-handle:active {
  cursor: grabbing;
}
.admin-drag-handle svg {
  width: 0.7rem;
  height: 1rem;
  display: block;
}
.admin-group-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.admin-form-row input,
.admin-form-row select,
.community-modal-body input[type="text"] {
  flex: 1;
  min-width: 8rem;
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  background: var(--input);
  color: inherit;
  padding: 0.55rem 0.7rem;
  font: inherit;
}
.admin-card {
  background: var(--wash);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 0.85rem 0.9rem;
  margin-bottom: 0.85rem;
}
.admin-card-head h4 {
  margin: 0;
}
.admin-card-sub {
  margin: 0.25rem 0 0;
  color: var(--muted, var(--soft));
  font-size: 0.8rem;
}
.admin-banner-preview {
  position: relative;
  margin: 0.75rem 0 0.65rem;
  height: 96px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--sidebar) 0%, var(--input) 60%, #5865f2 150%);
  border: 1px solid var(--hairline);
}
.admin-banner-preview-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.admin-banner-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted, var(--soft));
  font-size: 0.85rem;
}
.admin-banner-actions {
  margin-top: 0.15rem;
}
.admin-hint {
  margin: 0.45rem 0 0;
  color: var(--muted, var(--soft));
  font-size: 0.8rem;
}
.ghost-btn {
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--text, #f2f3f5);
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}
.ghost-btn:hover {
  background: var(--wash);
}
.admin-role-editor {
  margin-top: 0;
}
.admin-role-members-hint {
  margin: 0.55rem 0.75rem 0.35rem;
}
.admin-role-member-list {
  margin: 0 0 0.35rem;
  border-top: 1px solid var(--hairline);
}
.admin-role-member-list li.admin-role-member-row,
.admin-role-member-list li.admin-channel-empty {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
#admin-role-member-add-row,
#channel-perm-role-member-add-row {
  margin: 0.55rem 0.75rem 0.75rem;
}
.channel-perm-role-members {
  margin-top: 0.85rem;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  overflow: hidden;
  background: var(--inset);
}
.channel-perm-role-members .admin-card-head {
  padding: 0.65rem 0.75rem 0.35rem;
}
.channel-perm-role-row.is-selected {
  background: color-mix(in srgb, #5865f2 16%, transparent);
}
.channel-perm-role-row .perm-row-main {
  cursor: pointer;
}
.ww-user-suggest-row {
  align-items: flex-start;
}
.ww-user-suggest-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}
.ww-user-suggest-wrap input {
  width: 100%;
}
/* Inline suggest lists stay hidden; live list is #ww-user-suggest-portal on body. */
.ww-user-suggest-wrap > .ww-user-suggest {
  display: none !important;
}
#ww-user-suggest-portal.ww-user-suggest {
  position: fixed;
  z-index: 4000;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}
#ww-user-suggest-portal.ww-user-suggest[hidden],
#ww-user-suggest-portal.ww-user-suggest.view-hidden {
  display: none !important;
}
.perm-section:has(.ww-user-suggest-wrap),
.channel-perm-role-members {
  overflow: visible;
}
.admin-save-row {
  margin-top: 0.85rem;
  justify-content: flex-end;
}
.perm-section {
  margin-top: 0.85rem;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  overflow: hidden;
  background: var(--inset);
}
.perm-section-label {
  padding: 0.5rem 0.75rem;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted, var(--soft));
  border-bottom: 1px solid var(--hairline);
  background: var(--wash);
}
.perm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  margin: 0;
}
.perm-row:last-child {
  border-bottom: 0;
}
.perm-row-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.perm-row-copy strong {
  font-size: 0.9rem;
  font-weight: 600;
}
.perm-row-copy em {
  font-style: normal;
  color: var(--muted, var(--soft));
  font-size: 0.75rem;
}
.perm-toggle {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  accent-color: var(--accent, #5865f2);
}
.perm-channel-list {
  max-height: 14rem;
  overflow: auto;
}
.perm-row-toggles {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 0 0 auto;
}
.perm-mini {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--muted, var(--soft));
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}
.chat-form.is-locked {
  opacity: 0.72;
}
.perm-channel-list .perm-row.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}
.perm-channel-icon {
  width: 1.25rem;
  text-align: center;
  color: var(--muted, var(--soft));
  flex-shrink: 0;
}
.perm-row-main {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex: 1;
}
.admin-role-list {
  max-height: 18rem;
}
.admin-role-list li.is-selected {
  outline: 1px solid rgba(88, 101, 242, 0.55);
  background: rgba(88, 101, 242, 0.16);
}
.admin-role-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-role-row.is-dragging {
  opacity: 0.45;
}
.admin-role-row.is-drop-before {
  box-shadow: inset 0 2px 0 var(--accent, #5865f2);
}
.admin-role-row.is-drop-after {
  box-shadow: inset 0 -2px 0 var(--accent, #5865f2);
}
.admin-drag-handle.is-spacer {
  cursor: default;
  visibility: hidden;
}
.perm-tri-legend {
  margin: 0;
  padding: 0.45rem 0.75rem 0;
  color: var(--muted, var(--soft));
  font-size: 0.75rem;
}
.perm-channel-list .perm-row {
  cursor: default;
}
.perm-row-toggles {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.perm-tri {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.perm-tri-label {
  color: var(--muted, var(--soft));
  font-size: 0.72rem;
  font-weight: 700;
}
.tri-switch {
  display: inline-flex;
  align-items: stretch;
  height: 1.7rem;
  border-radius: 999px;
  overflow: hidden;
  background: #1e1f22;
  border: 1px solid rgba(0, 0, 0, 0.45);
}
.tri-seg {
  width: 1.85rem;
  border: 0;
  margin: 0;
  background: transparent;
  color: #dbdee1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.tri-seg + .tri-seg {
  box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.45);
}
.tri-seg svg {
  width: 0.95rem;
  height: 0.95rem;
  display: block;
}
.tri-deny.is-on {
  background: #da373c;
  color: #fff;
}
.tri-neutral.is-on {
  background: #4e5058;
  color: #fff;
}
.tri-allow.is-on {
  background: #248046;
  color: #fff;
}
.tri-seg:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

.theme-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  grid-auto-rows: 7.8rem;
  gap: 0.65rem;
  align-content: start;
  margin-top: 0.35rem;
  max-height: calc(7.8rem * 2 + 0.65rem);
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 0.15rem;
}
.theme-choice {
  display: grid;
  gap: 0.35rem;
  justify-items: center;
  align-content: start;
  height: 7.8rem;
  min-height: 0;
  background: var(--input);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 0.55rem 0.4rem 0.45rem;
  font-weight: 700;
}
.theme-choice > span:last-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.theme-choice:hover {
  background: var(--hover);
  color: var(--text);
}
.theme-choice.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.theme-swatch {
  width: 100%;
  height: 4.15rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.18);
}
.theme-swatch-grey { background: linear-gradient(180deg, #2b2d31 0 46%, #313338 46% 100%); }
.theme-swatch-black { background: linear-gradient(180deg, #141414 0 46%, #000000 46% 100%); }
.theme-swatch-white { background: linear-gradient(180deg, #f2f3f5 0 46%, #ffffff 46% 100%); }
.theme-swatch-custom {
  background: var(--ww-custom-grad, linear-gradient(135deg, var(--ww-custom-primary), var(--ww-custom-secondary)));
  box-shadow: inset 0 0 0 3px var(--ww-custom-outline, var(--ww-custom-secondary));
}
.grad-editor {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.55rem;
}
.grad-bar {
  position: relative;
  height: 2.6rem;
  border-radius: 999px;
  border: 2px solid var(--ww-custom-outline, var(--border));
  background: linear-gradient(90deg, var(--ww-custom-primary, #313338), var(--ww-custom-secondary, #5865f2));
  cursor: copy;
  touch-action: none;
  user-select: none;
}
.grad-stop {
  position: absolute;
  top: 50%;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55);
  transform: translate(-50%, -50%);
  cursor: grab;
}
.grad-stop.is-selected {
  box-shadow: 0 0 0 2px var(--text);
  z-index: 2;
}
.grad-stop.is-dragging,
.grad-stop:active {
  cursor: grabbing;
}
.grad-stop-tools {
  display: flex;
  align-items: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.grad-stop-color {
  display: grid;
  gap: 0.2rem;
  font-size: 0.78rem;
  font-weight: 700;
}
.grad-stop-tools input[type="color"] {
  width: 2.8rem;
  height: 2.2rem;
  padding: 0.15rem;
}
.grad-stop-tools button {
  width: auto;
  height: 2.2rem;
  padding: 0 0.75rem;
}
.custom-theme-fields select {
  width: 100%;
  height: 2.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text);
  font-weight: 700;
}
.custom-theme-fields { margin-top: 0.75rem; }
.custom-theme-fields[hidden] { display: none !important; }
.custom-theme-fields .audio-hint { grid-column: 1 / -1; margin: 0; }
.theme-name-field,
.theme-save-row { grid-column: 1 / -1; }
.theme-name-field input {
  width: 100%;
  height: 2.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text);
  font-weight: 700;
  padding: 0.35rem 0.6rem;
}
.theme-save-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}
.theme-save-row button { width: auto; }
.theme-save-row .audio-hint { grid-column: auto; margin: 0; }

button.me-status {
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ok);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
button.me-status:hover { background: transparent; text-decoration: underline; }
button.me-status.is-idle,
button.me-status.is-afk { color: #f0b232; }
button.me-status.is-dnd { color: #ed4245; }
button.me-status.is-offline { color: #80848e; }
.status-menu {
  position: fixed;
  z-index: 85;
  min-width: 12.5rem;
  background: var(--panel);
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  padding: 0.3rem;
  display: grid;
  gap: 0.12rem;
}
.status-menu[hidden],
.status-menu.view-hidden { display: none !important; }
.status-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.48rem 0.65rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 650;
  text-align: left;
}
.status-menu button:hover { background: var(--hover); }
.status-menu button[aria-checked="true"] {
  background: var(--wash);
}
.status-custom {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.15rem;
  padding: 0.45rem 0.55rem 0.5rem;
  border-top: 1px solid var(--hairline);
}
.status-custom-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}
.status-custom input[type="text"] {
  width: 100%;
  margin: 0;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  background: var(--input);
  color: var(--text);
  font-size: 0.85rem;
}
.status-custom-dnd {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
}
.status-custom-dnd input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--accent);
}
.status-custom button {
  justify-content: center;
}
.member-status-dot.idle { background: #f0b232; }
.member-status-dot.dnd { background: #ed4245; }

.chat-panel { position: relative; }
.chat-jump {
  position: absolute;
  left: 50%;
  bottom: 4.6rem;
  transform: translateX(-50%);
  z-index: 4;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.chat-jump[hidden] { display: none !important; }
.chat-typing {
  margin: 0;
  padding: 0.15rem 0.8rem 0;
  min-height: 1.1rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}
.chat-typing[hidden] { display: none !important; }
.chat-compose input[type="file"],
.dm-compose input[type="file"] { display: none !important; }
.chat-plus {
  width: 2.4rem;
  min-width: 2.4rem;
  padding: 0 !important;
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 500;
}
.chat-pending {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.15rem 0.15rem 0;
}
.chat-pending[hidden] { display: none !important; }
.chat-pending-item {
  position: relative;
  width: 92px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--input);
  border: 1px solid var(--hairline);
}
.chat-pending-item.has-mature { width: 168px; }
.chat-pending-item.is-file {
  width: auto;
  min-width: 132px;
  max-width: 220px;
}
.chat-pending-item img,
.chat-pending-item .chat-pending-name {
  display: block;
  width: 100%;
  height: 68px;
  object-fit: cover;
  font-size: 0.68rem;
  padding: 0.35rem;
  color: var(--text);
  word-break: break-word;
}
.chat-pending-item.is-file .chat-pending-name {
  height: auto;
  min-height: 68px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  line-height: 1.25;
}
.chat-pending-item.is-file .chat-pending-kind {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.chat-pending-mature {
  display: flex;
  align-items: flex-start;
  gap: 0.28rem;
  margin: 0;
  padding: 0.28rem 0.35rem 0.4rem;
  color: var(--text);
  font-size: 0.62rem;
  font-weight: 650;
  line-height: 1.25;
  cursor: pointer;
}
.chat-pending-mature input {
  width: 0.85rem;
  height: 0.85rem;
  margin: 0.05rem 0 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
}
.chat-pending-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 1.2rem;
  height: 1.2rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1;
}
.mention-menu { z-index: 72; }
.emoji-pop {
  position: fixed;
  z-index: 86;
  width: min(360px, calc(100vw - 16px));
  max-height: min(420px, 60vh);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.emoji-pop[hidden] { display: none !important; }
.sticker-pop-head select {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  padding: 0.35rem 0.45rem;
}
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  overflow: auto;
  padding: 0.45rem;
  min-height: 88px;
}
.sticker-grid button {
  position: relative;
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 0.25rem;
}
.sticker-grid button:hover { background: var(--hover); }
.sticker-grid img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
.sticker-bar { flex-wrap: wrap; }
.chat-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-width: 420px;
}
.chat-gallery .chat-image {
  width: 132px;
  height: 132px;
  object-fit: cover;
  border-radius: 8px;
}
.chat-gallery .chat-mature {
  width: 132px;
  height: 132px;
  max-width: 132px;
  max-height: 132px;
  border-radius: 8px;
  overflow: hidden;
}
.chat-gallery .chat-mature:not(.is-open) {
  min-width: 0;
  min-height: 0;
}
.chat-gallery .chat-mature .chat-image {
  width: 100%;
  height: 100%;
}
.chat-gallery .chat-mature-cover {
  border-radius: 8px;
  font-size: 0.72rem;
  padding: 0.35rem;
}
/* Rows whose image moved into the grid above. Shown only to keep their reactions. */
.chat-msg.is-image-merged:not(.has-reactions) { display: none; }
.chat-msg.is-image-merged .chat-avatar,
.chat-msg.is-image-merged .chat-head { display: none; }
/* .chat-msg .chat-media is display: grid, which stacked gallery thumbnails in one column. */
.chat-msg .chat-media.chat-gallery {
  display: flex;
  flex-wrap: wrap;
  max-width: min(100%, 420px);
}
.chat-msg .chat-media.chat-gallery .chat-image {
  width: 132px !important;
  height: 132px !important;
  max-width: 132px !important;
  max-height: 132px !important;
  aspect-ratio: 1 / 1 !important;
  object-fit: cover;
}
.chat-sticker {
  width: 160px;
  height: 160px;
  object-fit: contain;
  background: transparent;
}
.chat-sticker-save {
  display: inline-block;
  width: auto;
  margin-top: 0.3rem;
  padding: 0.25rem 0.55rem;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--hairline-strong);
  border-radius: 6px;
  font-size: 0.75rem;
}
.tile-screen-audio {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.emoji-pop-head {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  padding: 0.45rem;
  border-bottom: 1px solid var(--rule);
}
.emoji-tab {
  flex: 0 0 auto;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 6px;
  padding: 0.3rem 0.5rem;
  font-size: 0.78rem;
}
.emoji-tab.is-on { background: var(--hover); color: var(--text); }
.emoji-pop-head input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  padding: 0.35rem 0.5rem;
}
.emoji-cats {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  overflow-x: auto;
  padding: 0.35rem 0.45rem;
  border-bottom: 1px solid var(--rule);
  background: var(--panel);
  position: relative;
  z-index: 1;
}
.emoji-cats[hidden] { display: none !important; }
.emoji-cat {
  flex: 0 0 auto;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  font-size: 0.72rem;
  white-space: nowrap;
}
.emoji-cat.is-on { background: var(--hover); color: var(--text); }
.emoji-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.15rem;
  overflow: auto;
  padding: 0.4rem;
  align-content: start;
}
.emoji-grid button {
  background: transparent;
  color: inherit;
  border: 0;
  border-radius: 6px;
  padding: 0.28rem 0;
  font-size: 1.25rem;
  line-height: 1.2;
}
.emoji-grid button:hover { background: var(--hover); }
.emoji-grid.is-custom { grid-template-columns: repeat(5, 1fr); }
.emoji-grid button.emoji-custom {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  min-width: 0;
  padding: 0.35rem 0.15rem 0.28rem;
  font-size: 0.62rem;
  font-weight: 650;
  line-height: 1.15;
  color: var(--muted);
}
.emoji-grid button.emoji-custom span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.emoji-custom-del {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  background: var(--panel);
  color: var(--text);
  font-size: 0.75rem;
  line-height: 0.95rem;
  text-align: center;
}

.emoji-grid.is-gif-favs {
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 0.45rem;
}
.emoji-gif-fav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  overflow: hidden;
}
.emoji-gif-fav:hover,
.emoji-gif-fav:focus-visible {
  outline: none;
  border-color: rgba(88, 101, 242, 0.55);
  background: rgba(88, 101, 242, 0.12);
}
.emoji-gif-fav img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.emoji-gif-fav-del {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.85rem;
  line-height: 1.15rem;
  text-align: center;
  opacity: 0;
}
.emoji-gif-fav:hover .emoji-gif-fav-del,
.emoji-gif-fav:focus-within .emoji-gif-fav-del {
  opacity: 1;
}

.emoji-custom-bar {
  flex: 0 0 auto;
  display: flex;
  gap: 0.35rem;
  align-items: center;
  padding: 0.4rem 0.45rem 0.5rem;
  border-top: 1px solid var(--rule);
}
.emoji-custom-bar[hidden] { display: none !important; }
.emoji-custom-bar input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  padding: 0.35rem 0.5rem;
}
.ww-emoji {
  width: calc(1.25rem * var(--ww-emoji-scale));
  height: calc(1.25rem * var(--ww-emoji-scale));
  object-fit: contain;
  display: inline-block;
  vertical-align: -0.28rem;
  pointer-events: none;
}
.ww-uchar {
  font-size: calc(1em * var(--ww-emoji-scale) / max(var(--ww-text-scale), 0.01));
  line-height: 1;
}
.chat-react .ww-emoji {
  width: calc(1.1rem * var(--ww-emoji-scale));
  height: calc(1.1rem * var(--ww-emoji-scale));
  vertical-align: -0.22rem;
}
.emoji-grid button.gif-item {
  grid-column: span 2;
  padding: 0;
  height: 72px;
  overflow: hidden;
}
.emoji-grid button.gif-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gif-note {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.7rem 0.8rem 0.9rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.chat-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  margin-top: 0.2rem;
}
.chat-react {
  border: 1px solid var(--hairline-strong);
  background: var(--wash);
  color: var(--text);
  border-radius: 999px;
  padding: 0.08rem 0.4rem;
  font-size: calc(0.78rem * var(--ww-emoji-scale));
  font-weight: 650;
  line-height: 1.3;
}
.chat-react.is-mine { border-color: var(--accent); background: rgba(88, 101, 242, 0.18); }
.chat-react:hover { background: var(--hover); }
/* Standalone ?images=1 popup locks the page; floating overlay does not. */
html:has(body.image-manager-ready:not(.image-manager-overlay)),
body.image-manager-ready:not(.image-manager-overlay) {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}
body.image-manager-ready:not(.image-manager-overlay) #app,
body.image-manager-ready:not(.image-manager-overlay) #dm-layer,
body.image-manager-ready:not(.image-manager-overlay) #update-bar,
body.image-manager-ready:not(.image-manager-overlay) #phone-scrim,
body.image-manager-ready:not(.image-manager-overlay) .settings-backdrop,
body.image-manager-ready:not(.image-manager-overlay) .community-modal {
  display: none !important;
}
#image-manager[hidden] { display: none !important; }
body.image-manager-ready:not(.image-manager-overlay) #image-manager {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
}
.image-manager-backdrop {
  position: fixed;
  inset: 0;
  z-index: 410;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(1.5px);
}
.image-manager-backdrop[hidden],
.image-manager-backdrop.view-hidden {
  display: none !important;
}
body.image-manager-overlay #image-manager {
  position: fixed;
  inset: auto;
  z-index: 420;
  display: flex;
  flex-direction: column;
  width: min(920px, 92vw);
  height: min(720px, 86vh);
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(14, 15, 18, 0.98);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.35);
}
body.image-manager-overlay #image-manager.is-placed {
  /* left/top/width/height set by placeImageManagerWindow */
}
body.image-manager-overlay #image-manager.is-pinned {
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(88, 101, 242, 0.35);
}
#image-manager-drag {
  cursor: move;
  user-select: none;
  touch-action: none;
}
.image-manager-icon-btn {
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
}
.image-manager-icon-btn svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}
.image-manager-icon-btn:hover,
.image-manager-icon-btn:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}
#image-manager-pin.is-on {
  color: #fff;
  background: rgba(88, 101, 242, 0.35);
}
body.is-gallery-dragging {
  cursor: move !important;
  user-select: none !important;
}
body.is-gallery-dragging * {
  cursor: move !important;
  user-select: none !important;
}
.image-manager-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  z-index: 6;
  touch-action: none;
  background:
    linear-gradient(135deg, transparent 55%, rgba(255, 255, 255, 0.22) 55%, rgba(255, 255, 255, 0.22) 62%, transparent 62%),
    linear-gradient(135deg, transparent 70%, rgba(255, 255, 255, 0.35) 70%, rgba(255, 255, 255, 0.35) 78%, transparent 78%);
}
.image-manager-resize:hover {
  background:
    linear-gradient(135deg, transparent 55%, rgba(255, 255, 255, 0.35) 55%, rgba(255, 255, 255, 0.35) 62%, transparent 62%),
    linear-gradient(135deg, transparent 70%, rgba(255, 255, 255, 0.5) 70%, rgba(255, 255, 255, 0.5) 78%, transparent 78%);
}
body.is-gallery-resizing {
  cursor: nwse-resize !important;
  user-select: none !important;
}
body.is-gallery-resizing * {
  cursor: nwse-resize !important;
  user-select: none !important;
}
.image-manager-bar,
.image-manager-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  background: var(--panel);
}
.image-manager-bar { border-bottom: 1px solid var(--line); }
.image-manager-foot { border-top: 1px solid var(--line); }
.image-manager-title h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}
.image-manager-title p,
.image-manager-foot p,
.image-manager-note {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.image-manager-foot p { margin: 0; }
.image-manager-bar-actions,
.image-manager-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
#image-manager-saved-tab.is-on {
  background: var(--accent);
  color: #fff;
}
.image-manager-body {
  flex: 1;
  min-height: 0;
  display: flex;
}
.image-manager-stage {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: stretch;
  background: #111;
}
.image-manager-nav {
  flex: 0 0 52px;
  background: transparent;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  border-radius: 0;
}
.image-manager-nav:hover { background: rgba(255, 255, 255, 0.08); }
.image-manager-nav:disabled { opacity: 0.28; }
.image-manager-frame {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.image-manager-view {
  position: absolute;
  inset: 0;
  overflow: auto;
  background: #111;
  touch-action: none;
}
.image-manager-view.can-pan { cursor: grab; }
.image-manager-view.is-panning,
.image-manager-view.is-panning img { cursor: grabbing; }
.image-manager-canvas {
  min-width: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-manager-frame img {
  display: block;
  flex: 0 0 auto;
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}
.image-manager-frame img:not([src]),
.image-manager-frame img[data-failed="1"] { display: none; }
.image-manager-frame video.image-manager-video,
.image-manager-frame audio.image-manager-audio {
  display: block;
  max-width: min(100%, 1100px);
  max-height: min(82vh, 100%);
  width: auto;
  height: auto;
  background: #000;
}
.image-manager-frame audio.image-manager-audio {
  width: min(520px, 90%);
  max-height: none;
}
.image-manager-frame video[hidden],
.image-manager-frame audio[hidden],
.image-manager-frame img[hidden] { display: none !important; }
.image-manager-zoom[hidden] { display: none !important; }
.image-manager-thumb-kind {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 64px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: #2a2d35;
}
.image-manager-zoom {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 3;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.72);
}
.image-manager-zoom .small { min-width: 2.6rem; }
#image-manager-zoom-fit { min-width: 4.2rem; font-variant-numeric: tabular-nums; }
.image-manager-cover {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
}
.image-manager-cover[hidden],
.image-manager-empty[hidden],
#image-manager-save[hidden],
#image-manager-remove[hidden] { display: none !important; }
.image-manager-empty {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  margin: 0;
  color: #d7d8dc;
  text-align: center;
  pointer-events: none;
}
.image-manager-side {
  width: 280px;
  flex: 0 0 280px;
  overflow: auto;
  background: var(--panel);
  border-left: 1px solid var(--line);
}
.image-manager-group h2 {
  margin: 0;
  padding: 0.75rem 0.75rem 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.image-manager-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 0.75rem 0.9rem;
}
.image-manager-thumb {
  width: 72px;
  height: 72px;
  padding: 0;
  overflow: hidden;
  border-radius: 8px;
  border: 2px solid transparent;
  background: #1a1a1a;
}
.image-manager-thumb.is-on { border-color: var(--accent); }
.image-manager-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-manager-thumb-cover {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
}
@media (max-width: 800px) {
  .image-manager-body { flex-direction: column; }
  .image-manager-stage { min-height: 46vh; }
  .image-manager-side {
    width: auto;
    flex: 1 1 auto;
    max-height: 34vh;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}
.app-confirm {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
  padding: 1rem;
}
.goto-channel {
  z-index: 150;
  place-items: start center;
  padding-top: min(18vh, 7rem);
}
.goto-channel-card {
  width: min(480px, 100%);
  padding: 0.85rem 0.85rem 0.7rem;
}
.goto-channel-title {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
}
.goto-channel-search {
  display: block;
  margin: 0 0 0.45rem;
}
.goto-channel-search input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  background: var(--wash);
  color: var(--text);
  padding: 0.55rem 0.7rem;
  font: inherit;
}
.goto-channel-results {
  max-height: min(360px, 50vh);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.goto-channel-item {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--text);
  border: 0;
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
  cursor: pointer;
}
.goto-channel-item.active,
.goto-channel-item:hover {
  background: #5865f2;
  color: #fff;
}
.goto-channel-kind {
  flex: 0 0 auto;
  min-width: 1.1rem;
  font-weight: 800;
}
.goto-channel-name {
  flex: 0 1 auto;
  font-weight: 700;
}
.goto-channel-meta {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}
.goto-channel-item.active .goto-channel-meta,
.goto-channel-item:hover .goto-channel-meta {
  color: rgba(255, 255, 255, 0.88);
}
.goto-channel-empty {
  margin: 0;
  padding: 0.55rem 0.45rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.app-confirm[hidden] { display: none !important; }
.app-confirm-card {
  width: min(420px, 100%);
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--hairline-strong);
  border-radius: 12px;
  padding: 1rem 1rem 0.9rem;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}
.app-confirm-card h2 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.app-confirm-card p { margin: 0; color: var(--muted); }
.app-confirm-card p.is-danger { color: #ff4d4d; font-weight: 700; }
.app-confirm-actions button:disabled { opacity: 0.55; cursor: default; }
.app-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-top: 0.9rem;
}
.app-confirm-actions button { padding: 0.45rem 0.8rem; }
.sync-wizard { z-index: 165; overscroll-behavior: contain; }
.sync-wizard-card {
  width: min(440px, 100%);
  height: 20.5rem;
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sync-wizard-card > .app-confirm-actions {
  margin-top: auto;
  flex: 0 0 auto;
}
#sync-wizard-share:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.sync-wizard-step {
  margin: 0.15rem 0 0.75rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sync-wizard-kinds {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.4rem;
  margin: 0.75rem 0 0.55rem;
}
.sync-wizard-kinds button {
  height: 2.4rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--inset);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}
.sync-wizard-kinds button[aria-pressed="true"] {
  background: var(--accent, #5865f2);
  border-color: transparent;
  color: #fff;
}
.sync-wizard-card input[type="text"] {
  width: 100%;
  height: 2.35rem;
  margin-top: 0.15rem;
  padding: 0 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input);
  color: var(--text);
}
.sync-wizard-people {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}
.sync-wizard-people label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: var(--inset);
  cursor: pointer;
  font-weight: 700;
}
.sync-wizard-people span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sync-wizard-people input { accent-color: var(--accent, #5865f2); }
.sync-wizard-alone,
.sync-wizard-preview {
  margin: 0.7rem 0 0;
  font-size: 0.84rem;
}
.sync-wizard-preview { font-weight: 750; color: var(--text); }
.sync-wizard-error {
  margin: 0.65rem 0 0;
  color: var(--danger-text);
  font-size: 0.8rem;
  font-weight: 650;
}
.sync-wizard-error[hidden],
.sync-wizard-alone[hidden],
#sync-wizard-content[hidden],
#sync-wizard-share[hidden],
#sync-wizard-back[hidden],
#sync-wizard-next[hidden],
#sync-wizard-go[hidden] { display: none !important; }
.stream-chooser { z-index: 160; }
.stream-chooser-card { width: min(640px, 100%); }
.stream-res-field { width: 100%; margin: 0.75rem 0 0; }
.stream-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.85rem;
}
.stream-mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  min-height: 12.5rem;
  margin: 0;
  padding: 0.95rem;
  border: 1px solid var(--hairline-strong);
  border-radius: 12px;
  background: var(--inset);
  color: var(--text);
  text-align: left;
}
button.stream-mode-card {
  width: 100%;
  font-weight: 500;
  cursor: pointer;
}
button.stream-mode-card:hover,
button.stream-mode-card:focus-visible {
  background: var(--hover);
  border-color: var(--accent, #5865f2);
}
.stream-mode-card strong {
  font-size: 1.05rem;
  font-weight: 750;
}
.stream-mode-card > span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.35;
}
.stream-mode-dj .audio-field {
  width: 100%;
  margin: 0.35rem 0 0;
}
.stream-dj-kind {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  width: 100%;
  margin-top: 0.2rem;
}
.stream-dj-kind-btn {
  min-height: 34px;
  margin: 0;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
}
.stream-dj-kind-btn[aria-pressed="true"] {
  border-color: #7c3aed;
  background: rgba(124, 58, 237, 0.28);
  color: #f3e8ff;
}
.stream-dj-kind-hint {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 550;
  line-height: 1.35;
}
.settings-dj-kind {
  margin-top: 0.35rem;
}
.talent-stereo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.talent-uv {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  height: 4.6rem;
}
.talent-uv-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.18rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
}
.talent-uv-track {
  display: flex;
  align-items: flex-end;
  width: 0.9rem;
  height: 4.1rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--sidebar);
}
.talent-uv-fill {
  width: 100%;
  height: 0%;
  background: linear-gradient(0deg, #3ba55d, #faa61a 70%, #ed4245);
}
.talent-uv.is-compact {
  height: 2.15rem;
  flex: 0 0 auto;
}
.talent-uv.is-compact .talent-uv-track {
  width: 0.45rem;
  height: 1.7rem;
  border-radius: 4px;
}
.talent-pick-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin-top: 0.85rem;
}
.talent-pick-tab {
  min-height: 34px;
  margin: 0;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
}
.talent-pick-tab:hover {
  background: var(--hover);
  color: var(--text);
}
.talent-pick-tab[aria-selected="true"],
.talent-pick-tab[aria-selected="true"]:hover {
  border-color: #7c3aed;
  background: rgba(124, 58, 237, 0.28);
  color: #f3e8ff;
}
.talent-pick-panel[hidden] {
  display: none !important;
}
.talent-pick-panel .audio-field {
  margin-top: 0.75rem;
}
.talent-live-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 16rem;
  margin-top: 0.75rem;
  overflow: auto;
}
.talent-live-list:empty {
  display: none;
}
.talent-live-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  background: var(--inset);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.talent-live-row:hover {
  background: var(--hover);
  color: var(--text);
}
.talent-live-row.is-picked,
.talent-live-row.is-picked:hover {
  border-color: #7c3aed;
  background: rgba(124, 58, 237, 0.18);
  color: var(--text);
}
.talent-live-copy {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.talent-live-name {
  overflow: hidden;
  font-size: 0.86rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.talent-live-meta {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
#talent-select-input {
  width: 100%;
  margin-top: 0.7rem;
}
.stream-mode-dj .primary-btn {
  width: 100%;
  margin-top: auto;
}
.stream-screen-field {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.15rem 0 0;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
}
.stream-screen-field input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  accent-color: #7c3aed;
  flex: 0 0 auto;
}
@media (max-width: 640px) {
  .stream-mode-grid { grid-template-columns: 1fr; }
  .stream-mode-card { min-height: 0; }
}
.stream-nsfw-field {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.9rem;
  color: var(--text);
  font-weight: 650;
  cursor: pointer;
}
.stream-nsfw-field input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  accent-color: #e01920;
  flex: 0 0 auto;
}
.nsfw-watch-confirm { z-index: 180; }
#nsfw-watch-continue { background: #e01920; }
#nsfw-watch-continue:hover { background: #c4161c; }
.tile-nsfw {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.32rem 0.5rem;
  background: #e01920;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.tile-nsfw[hidden],
.tile-nsfw.view-hidden { display: none !important; }
.tile-nsfw-toggle {
  margin: 0;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  background: #fff;
  color: #9d1016;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}
.tile-nsfw-toggle:hover { background: #ffe8e8; }
.tile.is-nsfw .label { bottom: 2.2rem; }
.tile.is-nsfw .tile-pip-restore { bottom: 2.4rem; }
.tile.is-nsfw.has-both .tile-pip { bottom: 2.5rem; }
.tile.is-nsfw .tile-watch { z-index: 8; }
.tile.is-nsfw-blur .tile-screen { filter: blur(18px); }
.dm-close,
.dm-dock-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.dm-log .chat-msg { width: 100%; max-width: 100%; }
.dm-log .chat-msg .body { flex: none; display: block; }
.dm-log .chat-reply-chip { flex-basis: auto; width: 100%; }
.tile .label { display: inline-flex; align-items: center; gap: 0.35rem; max-width: calc(100% - 3.2rem); }
.tile-live {
  display: inline-flex;
  align-items: center;
  padding: 0.05rem 0.32rem;
  border-radius: 4px;
  background: #da373c;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.tile-live[hidden] { display: none !important; }
.tile-live.is-dj,
.occupant-live.is-dj { background: #7c3aed; }
.tile-dj-wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2.35rem;
  width: 100%;
  height: 28%;
  min-height: 52px;
  max-height: 110px;
  z-index: 1;
  pointer-events: none;
}
.tile-dj-wave[hidden],
.tile-dj-wave.view-hidden { display: none !important; }
.tile.is-dj-audio .tile-media {
  padding-bottom: 5.4rem;
}
.tile.is-dj-audio .label {
  bottom: 0.45rem;
  z-index: 3;
}
.tile-deaf-inline,
.tile-deaf-overlay {
  color: #e01920;
}
.tile-deaf-inline {
  display: inline-flex;
  width: 0.95rem;
  height: 0.95rem;
  flex: 0 0 auto;
}
.tile-deaf-inline svg,
.tile-deaf-overlay svg {
  width: 100%;
  height: 100%;
  display: block;
}
.tile-deaf-inline[hidden],
.tile-deaf-inline.view-hidden,
.tile-deaf-overlay[hidden],
.tile-deaf-overlay.view-hidden,
.tile-watchers[hidden],
.tile-watchers.view-hidden {
  display: none !important;
}
.tile-deaf-overlay {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 5;
  width: 3.25rem;
  height: 3.25rem;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  padding: 0.62rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  box-shadow: 0 0 0 2px rgba(224, 25, 32, 0.85);
  pointer-events: none;
}
.tile.is-away .tile-media,
.tile.is-away .label,
.tile.is-away .tile-volume,
.tile.is-away .tile-unwatch,
.tile.is-away .tile-watch,
.tile.is-away .tile-pip-restore {
  opacity: 0.38;
}
.tile.is-away .tile-media {
  filter: grayscale(1);
}
.tile-watchers {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  z-index: 6;
  display: flex;
  flex-direction: row;
  align-items: center;
  max-width: calc(100% - 3.2rem);
  padding: 3px 6px 3px 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  cursor: default;
  transition: border-radius 0.15s ease, padding 0.15s ease, max-width 0.15s ease, background 0.15s ease;
}
.tile-watcher {
  position: relative;
  width: 18px;
  height: 18px;
  aspect-ratio: 1 / 1;
  margin-left: -5px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid rgba(0, 0, 0, 0.8);
  background: #1a1b1e;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 0;
  display: inline-flex;
  align-items: center;
  gap: 0;
  transition: margin 0.15s ease, width 0.15s ease, height 0.15s ease, border-radius 0.15s ease, overflow 0.15s ease;
}
.tile-watcher:first-child { margin-left: 0; }
.tile-watcher img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  display: block;
  flex: 0 0 auto;
}
.tile-watcher img:not(.avatar-photo) {
  object-fit: contain;
  padding: 2px;
  box-sizing: border-box;
}
.tile-watcher-name {
  display: none;
  min-width: 0;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.1;
}
.tile-watcher-more {
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.tile-watcher-more-count {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}
/* Hover/focus: spread stacked watcher icons into a named list. */
.tile-watchers:hover,
.tile-watchers:focus-within {
  flex-direction: column;
  align-items: stretch;
  gap: 0.28rem;
  max-width: min(14rem, calc(100% - 0.8rem));
  max-height: calc(100% - 0.8rem);
  overflow: auto;
  padding: 0.4rem 0.45rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.88);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
}
.tile-watchers:hover .tile-watcher,
.tile-watchers:focus-within .tile-watcher {
  width: auto;
  height: auto;
  min-height: 22px;
  margin-left: 0;
  aspect-ratio: auto;
  border-radius: 999px;
  overflow: visible;
  border: 0;
  background: transparent;
  gap: 0.4rem;
}
.tile-watchers:hover .tile-watcher img,
.tile-watchers:focus-within .tile-watcher img {
  position: relative;
  inset: auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.8);
  background: #1a1b1e;
}
.tile-watchers:hover .tile-watcher-name,
.tile-watchers:focus-within .tile-watcher-name {
  display: block;
}
.tile-watchers:hover .tile-watcher-more,
.tile-watchers:focus-within .tile-watcher-more {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0;
  background: transparent;
}
.tile-watchers:hover .tile-watcher-more-count,
.tile-watchers:focus-within .tile-watcher-more-count {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.8);
  background: rgba(0, 0, 0, 0.72);
  font-size: 0.55rem;
  font-weight: 800;
}
.tile.is-silent {
  box-shadow: 0 0 0 2px #da373c, 0 0 18px rgba(218, 55, 60, 0.55);
}
.tile-volume {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.85rem;
  line-height: 1;
}
.tile-volume[hidden] { display: none !important; }
.tile-volume:hover { background: rgba(0, 0, 0, 0.75); }
.tile-volume-pop {
  position: fixed;
  z-index: 80;
  width: 210px;
  padding: 0.5rem 0.6rem 0.55rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.88);
  color: #fff;
}
.tile-volume-pop[hidden] { display: none !important; }
.tile-volume-row {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  margin: 0 0 0.45rem;
}
.tile-volume-row span {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}
.tile-volume-pop input[type="range"] {
  width: 100%;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
}
.tile-volume-pop input[type="range"]:disabled {
  opacity: 0.4;
}
.tile-stream-mute {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.tile-stream-output-row {
  margin-top: 0.55rem;
}
.tile-stream-output {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.28rem 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 0.72rem;
}
.tile-stream-output-keep {
  margin-top: 0.4rem;
  align-items: flex-start;
  line-height: 1.25;
}
.tile-stream-mute input {
  width: 0.95rem;
  height: 0.95rem;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: #da373c;
  border: 0;
  background: transparent;
  border-radius: 3px;
}
.chat-embeds {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.35rem;
  max-width: 420px;
}
.chat-embeds.is-expanded { max-width: min(920px, 100%); }
.chat-embed-shell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
}
.chat-embed-tools {
  display: flex;
  gap: 0.35rem;
}
.chat-embed-tool {
  border: 1px solid var(--hairline);
  background: var(--input);
  color: var(--text);
  border-radius: 6px;
  padding: 0.12rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}
.chat-mature {
  position: relative;
  display: inline-block;
  max-width: min(100%, 420px);
}
.chat-mature:not(.is-open) {
  min-width: 12.5rem;
  min-height: 7.5rem;
  background: #16161a;
  border-radius: 10px;
}
.chat-mature:not(.is-open) .chat-image {
  filter: blur(28px);
  transform: scale(1.08);
}
.chat-mature:not(.is-open) .chat-video {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}
.chat-mature .chat-video { max-width: 100%; }
.chat-media:has(.chat-mature:not(.is-open)) .chat-file { display: none; }
.chat-mature-cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  border: 0;
  border-radius: 10px;
  background: #16161a;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.3;
  text-align: center;
  padding: 0.6rem;
  cursor: pointer;
  z-index: 1;
}
.chat-mature.is-open .chat-mature-cover { display: none; }
.chat-embed {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: #000;
}
.chat-embed-video {
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
  max-width: min(100%, 420px);
  max-height: min(280px, 40vh);
}
.chat-embed-tweet {
  min-height: 200px;
  height: 280px;
  max-width: min(100%, 420px);
  max-height: min(280px, 40vh);
}
.chat-embed-klipy {
  display: block;
  width: auto;
  max-width: min(100%, 420px);
  height: auto;
  max-height: min(280px, 40vh);
  object-fit: contain;
  background: transparent;
}
.chat-video {
  display: block;
  width: 100%;
  max-width: min(100%, 420px);
  max-height: min(280px, 40vh);
  object-fit: contain;
  border-radius: 8px;
  background: #000;
}
@media (max-width: 640px) {
  .chat-msg .chat-image,
  .chat-video,
  .chat-embed-video,
  .chat-embed-klipy,
  .chat-embed-tweet {
    max-width: min(100%, 280px);
    max-height: min(200px, 32vh);
  }
  .chat-embeds {
    max-width: min(100%, 280px);
  }
  .chat-embeds.is-expanded {
    max-width: min(100%, 320px);
  }
  .chat-mature {
    max-width: min(100%, 280px);
  }
}
.chat-audio { display: block; width: min(100%, 360px); margin: 0.2rem 0; }
.chat-wallpaper-preview {
  height: 72px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-size: cover;
  background-position: center;
  margin: 0.35rem 0 0.55rem;
}
.chat-wallpaper-preview[hidden] { display: none !important; }
.settings-section-chat textarea {
  width: 100%;
  min-height: 4.5rem;
  resize: vertical;
  margin: 0.35rem 0 0;
  box-sizing: border-box;
  background: var(--sidebar);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
}


.dev-apns-block {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.dev-apns-status {
  font-size: 0.9rem;
  margin: 0.4rem 0 0.75rem;
  word-break: break-word;
}
.dev-apns-form label {
  display: block;
  margin: 0.45rem 0 0.2rem;
  font-size: 0.85rem;
}
.dev-apns-form input[type="text"],
.dev-apns-form input[type="file"] {
  width: 100%;
  max-width: 28rem;
}
.dev-apns-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* Step 5: channel permissions sheet */
.channel-perm-sheet {
  width: min(40rem, calc(100vw - 2rem));
  max-width: 40rem;
  max-height: min(88vh, 46rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-bottom: 1rem;
}
.channel-perm-sheet .settings-head {
  flex: 0 0 auto;
  align-items: flex-start;
}
.channel-perm-sheet .settings-head h3,
.channel-perm-sheet #channel-perm-title {
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text, #f2f3f5);
}
.channel-perm-sheet .settings-sub {
  margin: 0.35rem 0 0;
  max-width: 34rem;
}
.channel-perm-sheet .settings-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0.35rem 0.15rem 0.25rem;
  display: block;
}
.channel-perm-sheet .admin-card {
  margin-bottom: 0;
}
.channel-perm-sheet .admin-card + .admin-card {
  margin-top: 0.75rem;
}
.channel-perm-sheet #channel-perm-picker-list.admin-list {
  max-height: min(22rem, 50vh);
  margin-bottom: 0;
}
.channel-perm-sheet #channel-perm-picker-list.admin-list li {
  min-height: 2.35rem;
  padding: 0.55rem 0.7rem;
}
.channel-perm-sheet #channel-perm-picker-list .ghost-link {
  flex: 0 0 auto;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
}
.channel-perm-sheet #channel-perm-picker-list .ghost-link:hover {
  background: var(--hover);
}
.channel-perm-sheet #channel-perm-roles.perm-channel-list {
  max-height: min(24rem, 52vh);
  overflow: auto;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--inset);
}
.channel-perm-sheet #channel-perm-roles .perm-row {
  flex-wrap: nowrap;
  gap: 0.85rem;
  align-items: center;
}
.channel-perm-sheet #channel-perm-roles .perm-row-main {
  min-width: 0;
  flex: 1 1 auto;
}
.channel-perm-sheet #channel-perm-roles .perm-row-toggles {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 0.75rem;
}
.channel-perm-sheet .admin-save-row {
  margin-top: 0.9rem;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: nowrap;
}

.access-inspector-people {
  margin-top: 0.75rem;
}
.access-inspector-sheet #access-inspector-roles.perm-channel-list {
  max-height: min(14rem, 32vh);
}
.access-inspector-sheet #access-inspector-viewers.admin-list,
.access-inspector-sheet #access-inspector-posters.admin-list {
  max-height: min(10rem, 24vh);
  margin-bottom: 0;
}

.channel-perm-members {
  margin-top: 0.9rem;
}
.channel-perm-members .admin-card-head {
  margin-bottom: 0.45rem;
}
.channel-perm-members #channel-perm-member-list.perm-channel-list {
  max-height: min(14rem, 32vh);
  overflow: auto;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--inset);
  margin-top: 0.45rem;
}
.channel-perm-members .perm-row-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 0 0 auto;
}
.role-board-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 1rem 1.1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.role-board-panel.view-hidden,
.role-board-panel[hidden] {
  display: none !important;
}
.role-board-card {
  width: min(36rem, 100%);
  margin: 0;
}
.role-board-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.35rem;
}
.role-board-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--inset);
}
.role-board-row-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.role-board-row-main strong {
  font-size: 0.95rem;
}
.role-board-row-main em {
  font-style: normal;
  font-size: 0.75rem;
  color: var(--muted, #a3a6aa);
}
.role-board-row-actions {
  display: flex;
  gap: 0.4rem;
  flex: 0 0 auto;
}
.role-board-config {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--hairline);
}
.role-board-config #role-board-config-list.perm-channel-list {
  max-height: min(16rem, 36vh);
  overflow: auto;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--inset);
}
.role-board-config .perm-row {
  align-items: center;
}
#role-board-status {
  margin-top: 0.75rem;
}
.text-channel.is-role-board .channel-title::before {
  content: none;
}

/* Channel permissions + access inspector must stack above Personal/Community settings */
.channel-perm-backdrop,
.access-inspector-backdrop {
  z-index: 130;
}
.channel-perm-sheet,
.access-inspector-sheet {
  z-index: 131;
}

/* Channel/group admin action buttons + kind chip */
.admin-channel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.45rem;
  flex: 0 1 auto;
}
.admin-channel-action {
  appearance: none;
  border: 1px solid var(--hairline-strong, #3f4147);
  background: var(--elevated, #1e1f22);
  color: var(--text, #f2f3f5);
  border-radius: 999px;
  padding: 0.18rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  flex: 0 0 auto;
  margin-left: 0;
}
.admin-channel-action:hover {
  background: var(--hover, rgba(79,84,92,.4));
  border-color: var(--accent, #5865f2);
}
.admin-channel-action.admin-delete,
.admin-channel-action.is-danger {
  color: var(--danger-text, #f23f43);
  border-color: rgba(242, 63, 67, 0.45);
}
.admin-channel-action.admin-delete:hover,
.admin-channel-action.is-danger:hover {
  color: #fff;
  background: var(--danger, #da373c);
  border-color: var(--danger, #da373c);
}
.admin-channel-kind {
  margin-left: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--hairline-strong, #3f4147);
  background: var(--inset, #1e1f22);
  color: var(--muted, #b5bac1);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.admin-channel-kind.is-call {
  color: #57f287;
  border-color: rgba(87, 242, 135, 0.35);
  background: rgba(87, 242, 135, 0.08);
}
.admin-channel-kind.is-text {
  color: #5865f2;
  border-color: rgba(88, 101, 242, 0.4);
  background: rgba(88, 101, 242, 0.1);
}
.admin-channel-kind.is-role-board {
  color: #fee75c;
  border-color: rgba(254, 231, 92, 0.4);
  background: rgba(254, 231, 92, 0.1);
}
.admin-group-head .admin-channel-actions {
  margin-left: 0.55rem;
}

.channel-folder-toggle {
  flex: 0 0 auto;
  width: 0.95rem;
  height: 0.95rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.channel-folder-toggle:hover,
.channel-folder-toggle:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}
.channel-folder-toggle.is-hover-only {
  opacity: 0;
}
.voice-channel:hover > button.channel-btn .channel-folder-toggle.is-hover-only,
.text-channel:hover > button.channel-btn .channel-folder-toggle.is-hover-only,
.voice-channel:focus-within > button.channel-btn .channel-folder-toggle.is-hover-only,
.text-channel:focus-within > button.channel-btn .channel-folder-toggle.is-hover-only,
.channel-folder-toggle.is-hover-only:focus-visible {
  opacity: 1;
}
.channel-folder-toggle svg {
  width: 0.95rem;
  height: 0.95rem;
  max-width: 100%;
  max-height: 100%;
  display: block;
}
.chat-panel.files-mode .chat-log,
.chat-panel.files-mode .chat-form,
.chat-panel.files-mode .chat-pin,
.chat-panel.files-mode .chat-jump,
.chat-panel.files-mode .chat-typing,
.chat-panel.files-mode .chat-upload-status,
.chat-panel.files-mode .chat-channel-gallery {
  display: none !important;
}
.chat-channel-files {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.18);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.channel-files-toolbar {
  flex: 0 0 auto;
  padding: 0.45rem 0.7rem 0.2rem;
}
.channel-files-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}
.channel-files-header,
.channel-files-row {
  display: grid;
  grid-template-columns: 1.6rem minmax(8rem, 1.6fr) 5.5rem 4.5rem 6rem 7.5rem;
  gap: 0.45rem;
  align-items: center;
  padding: 0.28rem 0.7rem;
}
.channel-files-header {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.channel-files-sort {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: left;
  padding: 0;
  margin: 0;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-files-sort:hover,
.channel-files-sort:focus-visible {
  color: var(--text);
  outline: none;
}
.channel-files-sort.is-on {
  color: var(--text);
}
.channel-files-list {
  flex: 1 1 auto;
  overflow: auto;
  min-height: 0;
}
.channel-files-row {
  border: 0;
  width: 100%;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.channel-files-row:hover,
.channel-files-row:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}
.channel-files-thumb,
.channel-files-file-icon {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 3px;
  object-fit: cover;
  display: block;
  background: rgba(255, 255, 255, 0.08);
}
.channel-files-file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
}
.channel-files-col-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-files-col-type,
.channel-files-col-size,
.channel-files-col-who,
.channel-files-col-date {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.78rem;
}
.channel-files-empty {
  margin: 1rem 0.7rem;
  color: var(--muted);
}

.chat-channel-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.chat-channel-title {
  flex: 1 1 auto;
  min-width: 0;
}
.chat-channel-files-btn {
  flex: 0 0 auto;
  width: 1.55rem;
  height: 1.55rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.chat-channel-files-btn:hover,
.chat-channel-files-btn:focus-visible,
.chat-channel-files-btn.is-on {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}
.chat-channel-files-btn svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}
.chat-channel-modes { display: none !important; }
.chat-panel:not(.files-mode):not(.gallery-mode) .chat-channel-gallery,
.chat-panel:not(.files-mode):not(.gallery-mode) .chat-channel-files {
  display: none !important;
}
.chat-panel.files-mode .chat-log,
.chat-panel.files-mode .chat-form,
.chat-panel.files-mode .chat-pin,
.chat-panel.files-mode .chat-jump,
.chat-panel.files-mode .chat-typing,
.chat-panel.files-mode .chat-upload-status,
.chat-panel.files-mode .chat-channel-gallery,
.chat-panel.files-mode .chat-reply,
.chat-panel.files-mode .chat-pending,
.chat-panel.files-mode .chat-compose {
  display: none !important;
}
.channel-files-toolbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.channel-files-back {
  flex: 0 0 auto;
}

.main-head-right .chat-channel-files-btn {
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.main-head-right .chat-channel-files-btn:hover,
.main-head-right .chat-channel-files-btn:focus-visible,
.main-head-right .chat-channel-files-btn.is-on {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}
.main-head-right .chat-channel-files-btn svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}


.chat-msg-search {
  position: relative;
  flex: 0 1 16rem;
  min-width: 10rem;
  max-width: 20rem;
  display: flex;
  align-items: center;
}
.chat-msg-search-icon {
  position: absolute;
  left: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.95rem;
  height: 0.95rem;
  color: var(--muted);
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.chat-msg-search-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.chat-msg-search input {
  width: 100%;
  box-sizing: border-box;
  height: 2rem;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
  padding: 0 0.65rem 0 2rem;
}
.chat-msg-search input:focus {
  outline: 2px solid rgba(88, 101, 242, 0.55);
  outline-offset: 1px;
}
html[data-theme="white"] .chat-msg-search input {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.16);
}
.chat-panel.search-mode .chat-log,
.chat-panel.search-mode .chat-form,
.chat-panel.search-mode .chat-pin,
.chat-panel.search-mode .chat-jump,
.chat-panel.search-mode .chat-typing,
.chat-panel.search-mode .chat-upload-status,
.chat-panel.search-mode .chat-channel-gallery,
.chat-panel.search-mode .chat-channel-files,
.chat-panel.search-mode .chat-reply,
.chat-panel.search-mode .chat-pending,
.chat-panel.search-mode .chat-compose {
  display: none !important;
}
.chat-panel:not(.search-mode) .msg-search-panel {
  display: none !important;
}
.msg-search-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.18);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.msg-search-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.7rem 0.25rem;
}
.msg-search-back {
  flex: 0 0 auto;
}
.msg-search-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.95rem;
  font-weight: 700;
}
.msg-search-status {
  margin: 0;
  padding: 0 0.7rem;
  color: var(--muted);
  font-size: 0.82rem;
  flex: 0 0 auto;
}
.msg-search-results {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem 0.8rem;
}
.msg-search-empty {
  margin: 1.4rem auto;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
  max-width: 28rem;
}
.msg-search-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.75rem;
  align-items: start;
  padding: 0.75rem 0.8rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.msg-search-item:hover {
  background: rgba(255, 255, 255, 0.07);
}
.msg-search-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.55rem;
  align-items: baseline;
  min-width: 0;
}
.msg-search-who {
  font-weight: 700;
  color: var(--text);
}
.msg-search-place {
  color: var(--muted);
  font-size: 0.84rem;
}
.msg-search-when {
  color: var(--muted);
  font-size: 0.8rem;
  margin-left: auto;
}
.msg-search-snip {
  grid-column: 1 / 2;
  color: var(--text);
  font-size: 0.93rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg-search-jump {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  align-self: center;
  border: 0;
  border-radius: 8px;
  background: #5865f2;
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
}
.msg-search-jump:hover,
.msg-search-jump:focus-visible {
  filter: brightness(1.08);
  outline: none;
}
html[data-theme="white"] .msg-search-panel {
  background: rgba(0, 0, 0, 0.03);
  border-top-color: rgba(0, 0, 0, 0.08);
}
html[data-theme="white"] .msg-search-item {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.08);
}
html[data-theme="white"] .msg-search-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.channel-files-views {
  display: inline-flex;
  gap: 0.2rem;
  margin-left: auto;
}
.channel-files-view-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  cursor: pointer;
}
.channel-files-view-btn:hover,
.channel-files-view-btn:focus-visible,
.channel-files-view-btn.is-on {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}
.channel-files-list.is-icons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.2rem, 1fr));
  gap: 0.55rem;
  padding: 0.65rem 0.7rem 1rem;
  align-content: start;
}
.channel-files-list.is-icons .channel-files-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.4rem;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: center;
  min-height: 7.5rem;
}
.channel-files-list.is-icons .channel-files-row:hover,
.channel-files-list.is-icons .channel-files-row:focus-visible {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}
.channel-files-list.is-icons .channel-files-col-icon {
  width: 4.2rem;
  height: 4.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.channel-files-list.is-icons .channel-files-thumb {
  width: 4.2rem;
  height: 4.2rem;
  border-radius: 6px;
}
.channel-files-list.is-icons .channel-files-file-icon {
  width: 4.2rem;
  height: 4.2rem;
  font-size: 0.85rem;
}
.channel-files-list.is-icons .channel-files-col-name {
  width: 100%;
  font-size: 0.78rem;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.channel-files-list.is-icons .channel-files-col-type,
.channel-files-list.is-icons .channel-files-col-size,
.channel-files-list.is-icons .channel-files-col-who,
.channel-files-list.is-icons .channel-files-col-date {
  display: none;
}
.channel-files-list.is-list .channel-files-row {
  display: grid;
  grid-template-columns: 1.4rem minmax(0, 1fr);
  gap: 0.45rem;
  padding: 0.22rem 0.7rem;
}
.channel-files-list.is-list .channel-files-col-type,
.channel-files-list.is-list .channel-files-col-size,
.channel-files-list.is-list .channel-files-col-who,
.channel-files-list.is-list .channel-files-col-date {
  display: none;
}
.channel-files-list.is-list .channel-files-thumb,
.channel-files-list.is-list .channel-files-file-icon {
  width: 1.1rem;
  height: 1.1rem;
  font-size: 0.58rem;
}
.channel-files-header.is-hidden {
  display: none !important;
}

/* #189 beta front-end badge */
.beta-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0.35rem auto 0;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #1a1200;
  background: linear-gradient(180deg, #ffd56a, #f0a500);
  border: 1px solid rgba(0, 0, 0, 0.25);
  box-shadow: 0 0 0 1px rgba(255, 213, 106, 0.25);
}
.beta-badge-shell {
  margin: 0 0.4rem 0 0;
  align-self: center;
  flex: 0 0 auto;
}
.ww-beta .community-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}
.beta-login-note {
  margin: 0.4rem 0 0.8rem;
  font-size: 0.85rem;
  line-height: 1.35;
  color: var(--muted, #c7ccd1);
  text-align: center;
}
.beta-login-note a {
  color: inherit;
  text-decoration: underline;
}
.ww-beta .login-card {
  outline: 1px solid rgba(240, 165, 0, 0.35);
}
