:root {
  color-scheme: dark;
  --bg: #0b0e14;
  --rail: #080a0f;
  --nav: #10141d;
  --surface: #141925;
  --surface-2: #191f2c;
  --surface-3: #202737;
  --border: #272f40;
  --border-soft: #1e2533;
  --text: #f4f6fb;
  --muted: #929db0;
  --muted-2: #9aa5b7;
  --accent: #5264d9;
  --accent-strong: #aab2ff;
  --accent-soft: rgba(113, 129, 255, .14);
  --green: #3bcf91;
  --yellow: #f5b84b;
  --red: #f06b78;
  --red-badge: #a91f3a;
  --cyan: #4dcbd6;
  --shadow: 0 22px 70px rgba(0, 0, 0, .42);
  --radius: 12px;
  --rail-width: 72px;
  --nav-width: 300px;
  --members-width: 286px;
}

:root[data-theme="midnight"] {
  --bg: #070b14;
  --rail: #050811;
  --nav: #0b1220;
  --surface: #101927;
  --surface-2: #142033;
  --surface-3: #1b2a40;
  --border: #263851;
  --border-soft: #1a2a3e;
  --accent: #0878ad;
  --accent-strong: #7bd0f6;
  --accent-soft: rgba(54, 169, 225, .14);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fa;
  --rail: #e9edf4;
  --nav: #f9fafc;
  --surface: #ffffff;
  --surface-2: #f4f6fa;
  --surface-3: #e9edf5;
  --border: #d9dfeb;
  --border-soft: #e7ebf2;
  --text: #1d2533;
  --muted: #68758a;
  --muted-2: #5f6b7e;
  --accent: #4357d3;
  --accent-strong: #3548bc;
  --accent-soft: rgba(82, 102, 232, .12);
  --shadow: 0 22px 70px rgba(45, 54, 75, .2);
}

* { box-sizing: border-box; }
html, body { width: 100%; min-width: 320px; height: 100%; margin: 0; overflow: hidden; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 Inter, "Segoe UI", system-ui, -apple-system, sans-serif; }
button, input, select, textarea { color: inherit; font: inherit; }
button { border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: var(--accent-strong); }
[hidden] { display: none !important; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 1000; padding: 10px 14px; border-radius: 8px; background: var(--text); color: var(--bg); transform: translateY(-140%); }
.skip-link:focus { transform: translateY(0); }

.app-shell { display: grid; grid-template-columns: var(--rail-width) var(--nav-width) minmax(390px, 1fr) var(--members-width); width: 100%; height: 100%; background: var(--bg); }
.app-shell.members-hidden { grid-template-columns: var(--rail-width) var(--nav-width) minmax(390px, 1fr); }
.app-shell.members-hidden .members-pane { display: none; }

.server-rail { z-index: 12; display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 14px 10px; background: var(--rail); border-right: 1px solid var(--border-soft); }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 15px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 900; letter-spacing: -.04em; box-shadow: 0 8px 20px rgba(75, 91, 220, .24); }
.brand-mark--large { width: 58px; height: 58px; border-radius: 18px; font-size: 16px; }
.rail-divider { width: 32px; height: 1px; margin: 3px 0 4px; background: var(--border); }
.rail-button { position: relative; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: transparent; color: var(--muted); font-size: 20px; transition: background .16s ease, color .16s ease, border-radius .16s ease; }
.rail-button:hover, .rail-button:focus-visible { background: var(--surface-3); color: var(--text); }
.rail-button.is-active { border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong); }
.rail-button.is-active::before { position: absolute; left: -10px; width: 3px; height: 22px; border-radius: 0 5px 5px 0; background: var(--accent); content: ""; }
.rail-spacer { flex: 1; }
.rail-badge, .account-badge { position: absolute; display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border: 2px solid var(--rail); border-radius: 9px; background: var(--red-badge); color: #fff; font-size: 10px; font-weight: 800; }
.rail-badge { top: -3px; right: -3px; }

.navigation-pane { position: relative; z-index: 10; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; min-width: 0; background: var(--nav); border-right: 1px solid var(--border-soft); }
.server-header { display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 17px 18px; border-bottom: 1px solid var(--border-soft); }
.server-header > div { min-width: 0; }
.server-header strong { display: block; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.eyebrow { display: block; margin-bottom: 3px; color: var(--muted-2); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.connection-dot { width: 10px; height: 10px; flex: 0 0 auto; border: 2px solid var(--nav); border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--red); }
.connection-dot.is-online { background: var(--green); box-shadow: 0 0 0 2px var(--green); }
.connection-dot.is-loading { background: var(--yellow); box-shadow: 0 0 0 2px var(--yellow); }
.connection-dot.is-degraded { background: var(--yellow); box-shadow: 0 0 0 2px var(--yellow); }

.quick-search { display: flex; align-items: center; gap: 8px; margin: 14px 14px 4px; padding: 9px 11px; border: 1px solid var(--border-soft); border-radius: 9px; background: var(--surface); color: var(--muted); }
.quick-search:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); box-shadow: 0 0 0 3px var(--accent-soft); }
.quick-search input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text); }
.quick-search input::placeholder { color: var(--muted-2); }
kbd { padding: 2px 5px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; color: var(--muted-2); font: 10px/1.2 inherit; white-space: nowrap; }
.navigation-scroll, .member-list, .message-viewport, .admin-content { scrollbar-color: var(--surface-3) transparent; scrollbar-width: thin; }
.navigation-scroll { min-height: 0; overflow: auto; padding: 8px 10px 20px; }
.nav-section { margin-top: 15px; }
.channel-section { padding-bottom: 24px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; height: 30px; padding: 0 7px; }
.section-heading h2 { margin: 0; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.section-empty { margin: 8px 8px 12px; color: var(--muted-2); font-size: 12px; line-height: 1.5; }

.conversation-link, .direct-link { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; width: 100%; gap: 9px; padding: 8px; border-radius: 9px; background: transparent; color: var(--muted); text-align: left; }
.conversation-link:hover, .direct-link:hover { background: var(--surface-2); color: var(--text); }
.conversation-link.is-active, .direct-link.is-active { background: var(--accent-soft); color: var(--text); }
.conversation-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--surface-3); color: var(--muted); font-size: 16px; font-weight: 800; }
.conversation-link.is-active .conversation-icon { background: var(--accent); color: #fff; }
.conversation-link strong, .conversation-link small, .direct-link strong, .direct-link small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-link strong, .direct-link strong { color: inherit; font-size: 13px; }
.conversation-link small, .direct-link small { margin-top: 1px; color: var(--muted-2); font-size: 11px; }
.unread-pill { min-width: 19px; padding: 2px 6px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 800; text-align: center; }
.direct-list { display: grid; gap: 2px; }

.channel-tree { display: grid; gap: 2px; }
.channel-node { display: grid; gap: 2px; }
.channel-row { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; min-height: 36px; gap: 5px; width: 100%; padding: 5px 7px; border-radius: 8px; background: transparent; color: var(--muted); text-align: left; }
.channel-row:hover { background: var(--surface-2); color: var(--text); }
.channel-row.is-current { background: var(--accent-soft); color: var(--text); }
.channel-row__icon { color: var(--muted-2); font-weight: 800; text-align: center; }
.channel-row__copy { min-width: 0; }
.channel-row__copy strong, .channel-row__copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-row__copy strong { font-size: 13px; font-weight: 650; }
.channel-row__copy small { color: var(--muted-2); font-size: 10px; }
.channel-count { color: var(--muted-2); font-size: 10px; }
.channel-row.channel-depth-1 { padding-left: 20px; }
.channel-row.channel-depth-2 { padding-left: 33px; }
.channel-row.channel-depth-3 { padding-left: 46px; }
.channel-row.channel-depth-4 { padding-left: 59px; }
.channel-row.channel-depth-5 { padding-left: 72px; }
.channel-row.channel-depth-6, .channel-row.channel-depth-7, .channel-row.channel-depth-8, .channel-row.channel-depth-9, .channel-row.channel-depth-10, .channel-row.channel-depth-11, .channel-row.channel-depth-12 { padding-left: 85px; }
.channel-members { display: grid; gap: 1px; margin: 0 0 4px 26px; }
.channel-member { display: grid; grid-template-columns: 25px minmax(0, 1fr); align-items: center; gap: 7px; min-height: 30px; padding: 3px 7px; border-radius: 7px; background: transparent; color: var(--muted); text-align: left; }
.channel-member:hover { background: var(--surface-2); color: var(--text); }
.channel-member span:last-child { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.channel-member.channel-depth-1 { margin-left: 13px; }
.channel-member.channel-depth-2 { margin-left: 26px; }
.channel-member.channel-depth-3 { margin-left: 39px; }
.channel-member.channel-depth-4 { margin-left: 52px; }
.channel-member.channel-depth-5, .channel-member.channel-depth-6, .channel-member.channel-depth-7, .channel-member.channel-depth-8, .channel-member.channel-depth-9, .channel-member.channel-depth-10, .channel-member.channel-depth-11, .channel-member.channel-depth-12 { margin-left: 65px; }
.skeleton { display: grid; gap: 8px; padding: 8px; }
.skeleton span { width: 90%; height: 34px; border-radius: 8px; background: var(--surface-2); animation: pulse 1.2s ease-in-out infinite alternate; }
.skeleton span:nth-child(2) { width: 72%; }
.skeleton span:nth-child(3) { width: 84%; }

.account-card { display: grid; grid-template-columns: minmax(0, 1fr) 36px 36px; align-items: center; gap: 2px; min-height: 64px; padding: 8px; border-top: 1px solid var(--border-soft); background: color-mix(in srgb, var(--nav) 80%, var(--surface)); }
.account-main { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; padding: 4px; border-radius: 9px; background: transparent; text-align: left; }
.account-main:hover { background: var(--surface-2); }
.account-copy { min-width: 0; }
.account-copy strong, .account-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { font-size: 12px; }
.account-copy small { color: var(--muted); font-size: 10px; }
.account-action { position: relative; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.account-action:hover { background: var(--surface-3); color: var(--text); }
.account-badge { top: -5px; right: -4px; border-color: var(--nav); }

.workspace { display: grid; grid-template-rows: 76px minmax(0, 1fr) auto; min-width: 0; min-height: 0; background: var(--bg); }
.conversation-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 20px; border-bottom: 1px solid var(--border-soft); background: color-mix(in srgb, var(--bg) 86%, var(--surface)); }
.conversation-heading { display: flex; align-items: center; min-width: 0; gap: 12px; }
.conversation-heading__glyph { display: grid; place-items: center; width: 39px; height: 39px; flex: 0 0 auto; border-radius: 11px; background: var(--surface-2); color: var(--accent-strong); font-size: 20px; font-weight: 800; }
.conversation-heading h1 { overflow: hidden; margin: 0; font-size: 16px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.conversation-heading p { overflow: hidden; margin: 4px 0 0; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.conversation-actions { display: flex; gap: 7px; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--muted); }
.icon-button:hover, .icon-button:focus-visible, .icon-button.is-active { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); background: var(--accent-soft); color: var(--text); }
.icon-button--small { width: 27px; height: 27px; border: 0; border-radius: 7px; background: transparent; font-size: 16px; }
.mobile-only { display: none; }

.message-viewport { position: relative; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.welcome-panel { display: grid; place-items: center; align-content: center; min-height: 100%; padding: 50px 24px; text-align: center; }
.welcome-mark { display: grid; place-items: center; width: 78px; height: 78px; margin-bottom: 22px; border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border)); border-radius: 24px; background: var(--accent-soft); color: var(--accent-strong); font-size: 22px; font-weight: 900; letter-spacing: -.05em; }
.welcome-panel h2 { margin: 0 0 8px; font-size: 24px; letter-spacing: -.025em; }
.welcome-panel p { max-width: 540px; margin: 0 0 24px; color: var(--muted); }
.message-list { max-width: 940px; min-height: 100%; margin: 0 auto; padding: 26px 26px 38px; }
.message-day { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted-2); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.message-day::before, .message-day::after { height: 1px; flex: 1; background: var(--border-soft); content: ""; }
.message { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 11px; padding: 9px 10px; border-radius: 9px; }
.message:hover { background: color-mix(in srgb, var(--surface) 58%, transparent); }
.message__header { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.message__header button { overflow: hidden; padding: 0; background: transparent; color: var(--text); font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.message__header button:hover { color: var(--accent-strong); text-decoration: underline; }
.message__header time { color: var(--muted-2); font-size: 10px; white-space: nowrap; }
.message__body { margin: 3px 0 0; color: color-mix(in srgb, var(--text) 91%, var(--muted)); overflow-wrap: anywhere; white-space: pre-wrap; }
.message.is-own .message__body { color: var(--text); }
.message-empty { display: grid; place-items: center; min-height: 100%; padding: 48px; color: var(--muted); text-align: center; }
.message-empty strong { display: block; margin-bottom: 5px; color: var(--text); font-size: 17px; }
.jump-button { position: sticky; bottom: 16px; left: 50%; padding: 8px 13px; border-radius: 18px; background: var(--accent); color: #fff; box-shadow: var(--shadow); transform: translateX(-50%); }

.composer { margin: 0 20px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
.composer:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer textarea { display: block; width: 100%; min-height: 50px; max-height: 180px; field-sizing: content; resize: none; padding: 14px 15px 7px; border: 0; outline: 0; background: transparent; color: var(--text); line-height: 1.5; }
.composer textarea::placeholder { color: var(--muted-2); }
.composer-footer { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 5px 7px 7px 14px; color: var(--muted-2); font-size: 10px; }
#composerContext { overflow: hidden; flex: 1; text-overflow: ellipsis; white-space: nowrap; }
.send-button { min-width: 91px; padding: 8px 12px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 750; }
.send-button:hover { background: color-mix(in srgb, var(--accent) 82%, #000); }

.members-pane { display: grid; grid-template-rows: 76px minmax(0, 1fr); min-width: 0; background: var(--nav); border-left: 1px solid var(--border-soft); }
.members-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border-soft); }
.members-header h2 { margin: 0; font-size: 14px; }
.count-badge { padding: 4px 7px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 10px; white-space: nowrap; }
.member-list { min-height: 0; overflow-y: auto; padding: 12px 9px 22px; }
.member-group-title { margin: 16px 8px 7px; color: var(--muted-2); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.member-button { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 9px; width: 100%; padding: 7px 8px; border-radius: 9px; background: transparent; color: var(--muted); text-align: left; }
.member-button:hover { background: var(--surface-2); color: var(--text); }
.member-copy { min-width: 0; }
.member-copy strong, .member-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-copy strong { font-size: 12px; }
.member-copy small { margin-top: 1px; color: var(--muted-2); font-size: 10px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); }
.status-dot.online { background: var(--green); }
.status-dot.away { background: var(--yellow); }
.status-dot.dnd { background: var(--red); }

.avatar { position: relative; display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; border-radius: 50%; background: var(--surface-3); color: var(--text); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--tiny { width: 25px; height: 25px; font-size: 8px; }
.avatar--small { width: 34px; height: 34px; }
.avatar--message { width: 40px; height: 40px; }
.avatar--member { width: 34px; height: 34px; }
.avatar--hero { width: 86px; height: 86px; border: 6px solid var(--surface); font-size: 25px; }
.avatar[data-status]::after { position: absolute; right: 0; bottom: 0; width: 9px; height: 9px; border: 2px solid var(--nav); border-radius: 50%; background: var(--muted-2); content: ""; }
.avatar[data-status="online"]::after { background: var(--green); }
.avatar[data-status="away"]::after { background: var(--yellow); }
.avatar[data-status="dnd"]::after { background: var(--red); }

.primary-button, .secondary-button { min-height: 38px; padding: 9px 15px; border-radius: 9px; font-weight: 750; }
.primary-button { background: var(--accent); color: #fff; }
.primary-button:hover { background: color-mix(in srgb, var(--accent) 82%, #000); }
.primary-button--wide { width: 100%; }
.secondary-button { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.secondary-button:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--surface-3); }

.popover { position: fixed; z-index: 80; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.notification-popover { right: calc(var(--members-width) + 12px); bottom: 74px; width: min(360px, calc(100vw - 24px)); max-height: 430px; overflow: hidden; }
.notification-popover header { display: flex; align-items: center; justify-content: space-between; padding: 11px 13px; border-bottom: 1px solid var(--border-soft); }
.notification-list { max-height: 360px; overflow: auto; padding: 6px; }
.notification-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 9px; padding: 10px; border-radius: 8px; }
.notification-item:hover { background: var(--surface-2); }
.notification-item__icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-strong); }
.notification-item strong, .notification-item small { display: block; }
.notification-item small { margin-top: 3px; color: var(--muted); }

.modal { width: auto; max-width: none; height: auto; max-height: none; margin: auto; padding: 0; border: 0; background: transparent; color: var(--text); }
.modal::backdrop { background: rgba(4, 6, 10, .78); backdrop-filter: blur(5px); }
.modal-card { position: relative; width: min(520px, calc(100vw - 28px)); max-height: calc(100vh - 28px); overflow: auto; padding: 28px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.modal-card--wide { width: min(970px, calc(100vw - 28px)); }
.modal-card h2 { margin: 2px 0 7px; font-size: 24px; letter-spacing: -.025em; }
.modal-lead { margin: 0 0 23px; color: var(--muted); }
.modal-close { position: absolute; z-index: 2; top: 12px; right: 12px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 9px; background: rgba(8, 10, 15, .44); color: #fff; font-size: 19px; }
.modal-close:hover { background: rgba(8, 10, 15, .72); }
.modal-close--static { position: static; flex: 0 0 auto; background: var(--surface-2); color: var(--muted); }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.connect-brand { margin-bottom: 18px; }
label { display: grid; gap: 6px; margin-bottom: 14px; color: var(--muted); font-size: 11px; font-weight: 700; }
label > span { color: var(--muted-2); font-weight: 500; }
input, select, textarea { width: 100%; border: 1px solid var(--border); border-radius: 8px; outline: 0; background: var(--surface-2); color: var(--text); }
input, select { min-height: 40px; padding: 8px 10px; }
textarea { resize: vertical; padding: 9px 10px; }
input:focus, select:focus, textarea:focus { border-color: color-mix(in srgb, var(--accent) 65%, var(--border)); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="checkbox"] { width: 17px; min-height: 17px; accent-color: var(--accent); }
input[type="range"] { min-height: 22px; padding: 0; border: 0; background: transparent; accent-color: var(--accent); box-shadow: none; }
input[type="color"] { padding: 4px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.check-row { display: flex; grid-template-columns: none; align-items: center; gap: 9px; min-height: 28px; }
.check-row span { color: var(--muted); font-weight: 600; }
.security-note { margin: 13px 0 0; color: var(--muted-2); font-size: 10px; text-align: center; }
.transport-warning { margin: 14px 0 0; padding: 11px 12px; border: 1px solid rgba(255, 190, 92, .42); border-radius: 10px; color: #ffd79a; background: rgba(137, 82, 5, .18); font-size: 12px; line-height: 1.45; }
.form-error { margin: 10px 0; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--red) 40%, transparent); border-radius: 8px; background: color-mix(in srgb, var(--red) 12%, transparent); color: color-mix(in srgb, var(--red) 75%, var(--text)); }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.settings-section { padding: 18px; border: 1px solid var(--border-soft); border-radius: 12px; background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.settings-section h3 { margin: 0 0 16px; font-size: 14px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--border-soft); }

.side-modal { margin-right: 20px; }
.profile-card { position: relative; width: min(410px, calc(100vw - 28px)); max-height: calc(100vh - 40px); overflow: auto; border: 1px solid var(--border); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow); }
.profile-cover { height: 112px; background: var(--accent); opacity: .72; }
.profile-card .avatar--hero { margin: -45px 0 0 22px; }
.profile-body { padding: 12px 22px 24px; }
.profile-body h2 { margin: 5px 0 0; font-size: 22px; }
.presence-label { float: right; margin-top: -38px; padding: 5px 8px; border-radius: 8px; background: var(--surface-2); color: var(--green); font-size: 10px; font-weight: 800; }
.muted-text { margin: 0; color: var(--muted); }
.profile-status { margin: 13px 0; color: var(--text); }
.role-chips, .permission-list { display: flex; flex-wrap: wrap; gap: 5px; margin: 11px 0; }
.role-chip, .permission-chip { padding: 4px 7px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-2); color: var(--muted); font-size: 9px; font-weight: 800; }
.profile-bio { margin: 16px 0; padding-top: 14px; border-top: 1px solid var(--border-soft); color: var(--muted); white-space: pre-wrap; }
.social-list { display: grid; gap: 6px; }
.social-link { display: flex; align-items: center; justify-content: space-between; padding: 9px 10px; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--surface-2); text-decoration: none; }
.social-link:hover { border-color: var(--accent); }
.profile-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.local-controls { margin-top: 18px; padding: 14px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface-2); }
.local-controls h3 { margin: 0 0 12px; font-size: 12px; }

.admin-modal { width: calc(100vw - 28px); height: calc(100vh - 28px); }
.admin-shell { display: grid; grid-template-columns: 238px minmax(0, 1fr); width: 100%; height: 100%; overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: var(--bg); box-shadow: var(--shadow); }
.admin-navigation { display: flex; flex-direction: column; gap: 18px; padding: 18px 13px; border-right: 1px solid var(--border-soft); background: var(--nav); }
.admin-brand { display: grid; grid-template-columns: 46px minmax(0, 1fr); align-items: center; gap: 10px; padding: 0 5px 12px; border-bottom: 1px solid var(--border-soft); }
.admin-brand .brand-mark { width: 42px; height: 42px; border-radius: 12px; }
.admin-brand strong, .admin-brand small { display: block; }
.admin-brand strong { font-size: 12px; }
.admin-brand small { color: var(--muted); font-size: 10px; }
.admin-navigation nav { display: grid; gap: 4px; }
.admin-nav-button { padding: 10px 11px; border-radius: 8px; background: transparent; color: var(--muted); text-align: left; }
.admin-nav-button:hover { background: var(--surface-2); color: var(--text); }
.admin-nav-button.is-active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 750; }
.admin-navigation > .secondary-button { margin-top: auto; }
.admin-content { min-width: 0; overflow: auto; padding: 24px 28px 40px; }
.admin-header, .admin-section-header, .editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.admin-header { margin-bottom: 22px; }
.admin-header h2 { margin: 0; font-size: 22px; }
.admin-section-header { margin-bottom: 15px; }
.admin-section-header h3, .admin-section-header p { margin: 0; }
.admin-section-header p { margin-top: 3px; color: var(--muted); font-size: 11px; }
.admin-view { display: none; }
.admin-view.is-active { display: block; }
.breakglass-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .6fr); align-items: center; gap: 18px; margin-bottom: 18px; padding: 15px; border: 1px solid color-mix(in srgb, var(--yellow) 45%, var(--border)); border-radius: 11px; background: color-mix(in srgb, var(--yellow) 8%, var(--surface)); }
.breakglass-card p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.breakglass-card form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.breakglass-card input { margin: 0; }
.admin-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin-bottom: 15px; }
.admin-metric, .admin-card, .editor-card { border: 1px solid var(--border-soft); border-radius: 11px; background: var(--surface); }
.admin-metric { padding: 15px; }
.admin-metric span, .admin-metric strong { display: block; }
.admin-metric span { color: var(--muted); font-size: 10px; }
.admin-metric strong { margin-top: 5px; font-size: 24px; }
.admin-info-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 12px; }
.admin-card { padding: 18px; }
.admin-card h3 { margin: 0 0 8px; }
.admin-card p { margin: 0; color: var(--muted); }
.admin-split { display: grid; grid-template-columns: minmax(330px, 1fr) minmax(300px, 390px); gap: 16px; align-items: start; }
.admin-list, .member-admin-list, .audit-list { display: grid; gap: 7px; }
.admin-list-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 13px; border: 1px solid var(--border-soft); border-radius: 9px; background: var(--surface); }
.admin-list-copy { min-width: 0; }
.admin-list-copy strong, .admin-list-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-list-copy small { margin-top: 3px; color: var(--muted); }
.admin-list-actions { display: flex; gap: 5px; }
.mini-button { padding: 6px 8px; border-radius: 7px; background: var(--surface-3); color: var(--muted); font-size: 10px; font-weight: 750; }
.mini-button:hover { color: var(--text); }
.mini-button.danger:hover { background: color-mix(in srgb, var(--red) 18%, var(--surface-3)); color: var(--red); }
.editor-card { position: sticky; top: 0; padding: 17px; }
.editor-heading { margin-bottom: 14px; }
.editor-heading h3 { margin: 0; }
.editor-card fieldset { margin: 4px 0 14px; padding: 12px; border: 1px solid var(--border); border-radius: 9px; }
.editor-card legend { padding: 0 5px; color: var(--muted); font-size: 11px; font-weight: 750; }
.field-hint { display: block; margin: 2px 0 9px; color: var(--muted-2); font-size: 9px; font-weight: 500; }
.field-subtitle { display: block; margin: 9px 0 5px; color: var(--muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.permission-editor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; max-height: 230px; overflow: auto; }
.permission-editor .check-row { margin: 0; font-size: 9px; }
.member-admin-card { padding: 14px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface); }
.member-admin-head { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.member-admin-head strong, .member-admin-head small { display: block; }
.member-admin-head small { color: var(--muted); }
.member-admin-body { display: grid; grid-template-columns: minmax(220px, 1fr) auto; align-items: end; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.role-assignment { display: flex; flex-wrap: wrap; gap: 6px; }
.role-toggle { display: flex; align-items: center; gap: 4px; margin: 0; padding: 5px 7px; border: 1px solid var(--border); border-radius: 7px; font-size: 9px; }
.role-toggle input { width: 13px; min-height: 13px; }
.moderation-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.audit-event { display: grid; grid-template-columns: 120px 130px minmax(0, 1fr); gap: 12px; padding: 11px 12px; border-bottom: 1px solid var(--border-soft); color: var(--muted); }
.audit-event strong { color: var(--text); }
.audit-event time { color: var(--muted-2); font-size: 10px; }

.toast-region { position: fixed; z-index: 120; right: 18px; top: 18px; display: grid; width: min(370px, calc(100vw - 36px)); gap: 8px; pointer-events: none; }
.toast { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: start; gap: 9px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); pointer-events: auto; animation: toast-in .18s ease-out; }
.toast__icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-strong); }
.toast strong, .toast small { display: block; }
.toast small { margin-top: 2px; color: var(--muted); }
.toast button { padding: 1px 4px; background: transparent; color: var(--muted); }
.toast.is-error .toast__icon { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.noscript-message { position: fixed; inset: 20px; z-index: 999; display: grid; place-items: center; border-radius: 12px; background: var(--surface); }

:root[data-density="compact"] .message { padding-top: 4px; padding-bottom: 4px; }
:root[data-density="compact"] .conversation-link, :root[data-density="compact"] .direct-link { padding-top: 5px; padding-bottom: 5px; }
:root[data-density="compact"] .channel-row { min-height: 30px; }
:root[data-reduced-motion="true"] *, :root[data-reduced-motion="true"] *::before, :root[data-reduced-motion="true"] *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }

@keyframes pulse { from { opacity: .45; } to { opacity: 1; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: var(--rail-width) var(--nav-width) minmax(380px, 1fr); }
  .members-pane { display: none; }
  #toggleMembersButton { display: none; }
  .notification-popover { right: 12px; }
}

@media (max-width: 860px) {
  :root { --rail-width: 62px; --nav-width: 264px; }
  .server-rail { padding-inline: 8px; }
  .brand-mark, .rail-button { width: 44px; height: 44px; }
  .admin-shell { grid-template-columns: 190px minmax(0, 1fr); }
  .admin-content { padding: 21px; }
  .admin-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-split { grid-template-columns: 1fr; }
  .editor-card { position: static; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  html, body { overflow: hidden; }
  .app-shell, .app-shell.members-hidden { display: grid; grid-template: minmax(0, 1fr) 62px / 1fr; }
  .server-rail { grid-row: 2; flex-direction: row; justify-content: space-around; padding: 7px 10px; border-top: 1px solid var(--border); border-right: 0; }
  .server-rail .rail-divider, .server-rail .rail-spacer { display: none; }
  .navigation-pane { position: fixed; z-index: 30; inset: 0 auto 62px 0; width: min(310px, calc(100vw - 44px)); transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .app-shell.show-navigation .navigation-pane { transform: translateX(0); }
  .workspace { grid-row: 1; grid-column: 1; }
  .mobile-only { display: grid; }
  .conversation-header { height: 65px; padding: 9px 12px; }
  .conversation-heading__glyph { display: none; }
  .conversation-heading p { max-width: 190px; }
  .message-list { padding: 16px 8px 24px; }
  .message { grid-template-columns: 36px minmax(0, 1fr); padding-inline: 6px; }
  .avatar--message { width: 34px; height: 34px; }
  .composer { margin: 0 8px 8px; }
  .members-pane { display: none; }
  .notification-popover { right: 8px; bottom: 70px; }
  .side-modal { margin: auto; }
  .admin-modal { width: 100vw; height: 100vh; }
  .admin-shell { display: grid; grid-template: auto minmax(0, 1fr) / 1fr; border: 0; border-radius: 0; }
  .admin-navigation { display: block; overflow-x: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
  .admin-brand, .admin-navigation > .secondary-button { display: none; }
  .admin-navigation nav { display: flex; gap: 5px; }
  .admin-nav-button { flex: 0 0 auto; }
  .admin-content { padding: 16px 12px 28px; }
  .admin-info-grid { grid-template-columns: 1fr; }
  .breakglass-card { grid-template-columns: 1fr; }
  .member-admin-body { grid-template-columns: 1fr; }
  .moderation-actions { justify-content: flex-start; }
  .audit-event { grid-template-columns: 90px minmax(0, 1fr); }
  .audit-event span:last-child { grid-column: 1 / -1; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Web voice */
.account-card { grid-template-columns: minmax(0, 1fr) repeat(4, 36px); }
.voice-action.is-active { color: #ff8f8f; background: rgba(229, 83, 83, .14); }
.voice-action:disabled { opacity: .36; }
.channel-member.is-speaking, .member-button.is-speaking { background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--text); }
.channel-member.is-speaking .avatar, .member-button.is-speaking .avatar { box-shadow: 0 0 0 2px var(--accent), 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent); }
.settings-section--audio { grid-column: 1 / -1; }
.audio-device-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.voice-status { margin: -5px 0 14px; padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: 9px; background: var(--surface-2); color: var(--muted); font-size: 12px; line-height: 1.45; }
.mic-meter { display: block; width: 100%; height: 12px; margin-top: 8px; accent-color: var(--accent); }
.settings-section--audio code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .92em; }
@media (max-width: 720px) {
  .account-card { grid-template-columns: minmax(0, 1fr) repeat(4, 34px); }
  .audio-device-row { grid-template-columns: 1fr; }
}
.audio-button-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 2px; }

/* Web PTT keybind recorder */
.audio-option-group { display: grid; gap: 7px; margin: 12px 0; }
.field-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.keybind-button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 46px; padding: 8px 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--text); text-align: left; }
.keybind-button:hover:not(:disabled), .keybind-button:focus-visible { border-color: color-mix(in srgb, var(--accent) 58%, var(--border)); background: color-mix(in srgb, var(--accent) 8%, var(--surface-2)); }
.keybind-button:disabled { opacity: .42; cursor: not-allowed; }
.keybind-button > span { color: var(--muted); font-size: 12px; }
.keybind-button kbd, .keybind-capture-live kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 58px; min-height: 30px; padding: 4px 10px; border: 1px solid var(--border); border-bottom-width: 3px; border-radius: 7px; background: var(--surface); color: var(--text); font: 700 12px/1 ui-monospace, SFMono-Regular, Consolas, monospace; box-shadow: 0 1px 0 rgba(255,255,255,.04) inset; }
.audio-option-group.is-disabled, label.is-audio-mode-disabled { opacity: .46; }
.keybind-capture-card { width: min(430px, calc(100vw - 28px)); text-align: center; }
.keybind-capture-card h2 { margin-top: 5px; }
.keybind-capture-card > p { color: var(--muted); line-height: 1.55; }
.keybind-capture-icon { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 12px; border: 1px solid var(--border); border-radius: 14px; background: color-mix(in srgb, var(--accent) 14%, var(--surface-2)); font-size: 25px; }
.keybind-capture-live { display: grid; justify-items: center; gap: 10px; margin: 21px 0 14px; padding: 16px; border: 1px dashed color-mix(in srgb, var(--accent) 54%, var(--border)); border-radius: 10px; background: color-mix(in srgb, var(--accent) 6%, transparent); }
.keybind-capture-live span { color: var(--muted); font-size: 12px; }
.keybind-capture-live kbd { min-width: 110px; min-height: 38px; font-size: 14px; }
.keybind-capture-card .secondary-button { margin-top: 8px; }

/* ===== Web Suite 1: Discord-inspired settings, Stage, soundboard and richer voice ===== */
.settings-modal .modal-card--wide{width:min(1120px,96vw);max-height:94vh;padding:0;overflow:hidden}
.settings-modal .modal-header{padding:22px 26px;border-bottom:1px solid var(--border,#252b39)}
.settings-layout{display:grid;grid-template-columns:230px minmax(0,1fr);min-height:600px;max-height:72vh}
.settings-nav{padding:20px 12px;background:rgba(5,8,14,.32);border-right:1px solid var(--border,#252b39);display:flex;flex-direction:column;gap:4px;overflow:auto}
.settings-nav-label{padding:12px 10px 5px;color:var(--text-muted,#929db2);font-size:11px;text-transform:uppercase;letter-spacing:.08em;font-weight:800}
.settings-nav-button{border:0;background:transparent;color:var(--text-muted,#a8b1c5);text-align:left;border-radius:8px;padding:10px 12px;font:inherit;font-weight:650;cursor:pointer}
.settings-nav-button:hover{background:rgba(255,255,255,.055);color:var(--text,#fff)}
.settings-nav-button.is-active{background:rgba(113,129,255,.16);color:var(--text,#fff)}
.settings-content{overflow:auto;padding:24px 30px 40px}
.settings-content .settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.settings-section[data-settings-panel]{display:none}
.settings-section[data-settings-panel].is-active{display:flex}
.settings-section--full{grid-column:1/-1}
.settings-description{margin:-4px 0 16px;color:var(--text-muted,#9aa5ba)}
.settings-divider{height:1px;background:var(--border,#2a3040);margin:18px 0}
.settings-section h4{margin:2px 0 8px}
.settings-section .check-row span small{display:block;color:var(--text-muted,#929db2);font-weight:400;margin-top:2px}
.voice-security-badge{display:inline-flex;align-items:center;gap:7px;width:max-content;max-width:100%;padding:7px 10px;border-radius:999px;background:rgba(61,198,160,.1);border:1px solid rgba(61,198,160,.24);color:#84e5c6;font-size:12px;font-weight:700}
.quality-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:8px 0 16px}
.quality-grid article{border:1px solid var(--border,#2b3242);background:rgba(255,255,255,.025);border-radius:10px;padding:12px}
.quality-grid span{display:block;color:var(--text-muted,#929db2);font-size:11px;text-transform:uppercase;letter-spacing:.06em}
.quality-grid strong{display:block;font-size:18px;margin-top:3px}
.settings-action-card{display:flex;align-items:center;justify-content:space-between;gap:16px;border:1px solid var(--border,#2b3242);background:rgba(255,255,255,.025);border-radius:12px;padding:14px;margin:10px 0}
.settings-action-card p{margin:4px 0 0;color:var(--text-muted,#929db2);font-size:13px}
#micTestPlayback{width:100%;margin:4px 0 10px}
.whisper-targets{display:grid;grid-template-columns:1fr 1fr;gap:6px 14px;max-height:190px;overflow:auto;border:1px solid var(--border,#2b3242);border-radius:10px;padding:10px;margin:8px 0 14px}
.whisper-targets .target-group{grid-column:1/-1;color:var(--text-muted,#929db2);font-size:11px;text-transform:uppercase;font-weight:800;margin-top:4px}
.whisper-targets label{display:flex;align-items:center;gap:8px;font-size:13px}
.soundboard-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}
.soundboard-tile{position:relative;border:1px solid var(--border,#2b3242);background:rgba(255,255,255,.035);border-radius:12px;padding:14px;text-align:left;color:var(--text,#fff);cursor:pointer;min-height:88px;transition:transform .14s ease,border-color .14s ease,background .14s ease}
.soundboard-tile:hover{transform:translateY(-2px);border-color:rgba(113,129,255,.6);background:rgba(113,129,255,.08)}
.soundboard-tile strong{display:block;margin-top:18px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.soundboard-tile span{position:absolute;top:10px;left:12px;font-size:18px}
.soundboard-tile small{color:var(--text-muted,#929db2)}
.sound-upload-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.stage-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 18px;border-bottom:1px solid rgba(113,129,255,.23);background:linear-gradient(90deg,rgba(113,129,255,.12),rgba(239,93,168,.06))}
.stage-bar>div:first-child{display:grid;grid-template-columns:auto auto;align-items:center;column-gap:8px}.stage-bar small{grid-column:2;color:var(--text-muted,#a1acc0)}
.stage-live-dot{width:9px;height:9px;border-radius:50%;background:#ef5da8;box-shadow:0 0 0 5px rgba(239,93,168,.12);animation:stagePulse 1.6s infinite}
@keyframes stagePulse{50%{box-shadow:0 0 0 9px rgba(239,93,168,0)}}
.stage-actions{display:flex;gap:8px}
.reply-bar{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:8px 10px;margin-bottom:7px;border-left:3px solid #7181ff;background:rgba(113,129,255,.08);border-radius:7px}
.reply-bar div{min-width:0}.reply-bar span{display:block;font-size:11px;color:var(--text-muted,#929db2)}.reply-bar strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px}
.message{position:relative}.message:hover .message-tools{opacity:1;transform:translateY(0)}
.message-tools{position:absolute;right:10px;top:-12px;display:flex;gap:2px;padding:3px;background:var(--surface,#171c28);border:1px solid var(--border,#2a3140);border-radius:8px;box-shadow:0 7px 20px rgba(0,0,0,.22);opacity:0;transform:translateY(3px);transition:.12s;z-index:2}
.message-tool{border:0;background:transparent;color:var(--text-muted,#a2acc0);border-radius:5px;padding:5px 7px;cursor:pointer}.message-tool:hover{background:rgba(255,255,255,.07);color:var(--text,#fff)}
.message__reply-preview{display:flex;gap:6px;align-items:center;color:var(--text-muted,#929db2);font-size:12px;margin-bottom:3px;border-left:2px solid rgba(113,129,255,.5);padding-left:7px}.message__reply-preview strong{color:var(--text,#fff)}
.message__body.is-deleted{font-style:italic;color:var(--text-muted,#7f899d)}
.message__edited{font-size:10px;color:var(--text-muted,#8892a4);margin-left:5px}
.message-reactions{display:flex;gap:5px;flex-wrap:wrap;margin-top:5px}.reaction-chip{border:1px solid var(--border,#2a3140);background:rgba(255,255,255,.035);color:var(--text,#fff);border-radius:999px;padding:3px 8px;cursor:pointer;font-size:12px}.reaction-chip.is-own{background:rgba(113,129,255,.13);border-color:rgba(113,129,255,.45)}
.mention{background:rgba(244,185,66,.15);color:#ffd47a;border-radius:3px;padding:0 2px}.message.is-mentioned{background:linear-gradient(90deg,rgba(244,185,66,.09),transparent)}
.message.is-pinned{box-shadow:inset 2px 0 #f4b942}
.search-results{display:flex;flex-direction:column;gap:7px;max-height:420px;overflow:auto;margin-top:12px}.search-result{border:1px solid var(--border,#2a3140);background:rgba(255,255,255,.02);border-radius:9px;padding:10px;text-align:left;color:inherit;cursor:pointer}.search-result small{display:block;color:var(--text-muted,#929db2);margin-bottom:4px}
.channel-row.is-stage .channel-row__icon{color:#ef5da8}.channel-row.is-afk{opacity:.72}.stage-badge{font-size:9px;text-transform:uppercase;letter-spacing:.05em;background:rgba(239,93,168,.14);color:#ff9ac8;border-radius:4px;padding:2px 5px;margin-left:4px}
.channel-member.is-speaking,.member-row.is-speaking,.account-card.is-speaking .account-main{filter:none}
.account-card.is-speaking .avatar,.channel-member.is-speaking .avatar,.member-row.is-speaking .avatar{box-shadow:0 0 0 3px rgba(61,198,160,.9),0 0 20px rgba(61,198,160,.28);animation:localSpeakPulse .75s ease-in-out infinite alternate}
.account-card.is-speaking .account-copy strong{color:#76e7c1}
@keyframes localSpeakPulse{to{box-shadow:0 0 0 4px rgba(61,198,160,.65),0 0 30px rgba(61,198,160,.4);transform:scale(1.035)}}
.speaking-wave{display:inline-flex;gap:2px;align-items:center;height:12px;margin-left:auto}.speaking-wave i{width:2px;height:5px;background:#3dc6a0;border-radius:2px;animation:wave .55s ease-in-out infinite alternate}.speaking-wave i:nth-child(2){animation-delay:.12s}.speaking-wave i:nth-child(3){animation-delay:.24s}@keyframes wave{to{height:12px}}
.check-row--boxed{border:1px solid var(--border,#2b3242);border-radius:9px;padding:10px;margin-top:20px}
@media(max-width:820px){.settings-layout{grid-template-columns:1fr;max-height:80vh}.settings-nav{flex-direction:row;overflow-x:auto;border-right:0;border-bottom:1px solid var(--border,#252b39);padding:9px}.settings-nav-label{display:none}.settings-nav-button{white-space:nowrap}.settings-content{padding:18px}.settings-content .settings-grid{grid-template-columns:1fr}.quality-grid{grid-template-columns:1fr 1fr}.whisper-targets{grid-template-columns:1fr}}
/* Web Suite 3.1 refinements */
.speaking-wave{opacity:0;transition:opacity .14s ease}.is-speaking>.speaking-wave,.is-speaking .speaking-wave{opacity:1}
.channel-member.is-speaking,.member-button.is-speaking{box-shadow:inset 3px 0 0 #3dc6a0;background:rgba(61,198,160,.09)}
.local-speaking .account-card{box-shadow:0 0 0 2px rgba(61,198,160,.55),0 0 28px rgba(61,198,160,.18)}
.local-speaking .account-card .avatar{animation:localTalkPulse .75s ease-in-out infinite alternate}@keyframes localTalkPulse{to{transform:scale(1.07);filter:drop-shadow(0 0 8px rgba(61,198,160,.65))}}
.stage-member-action{margin-left:4px;border:0;border-radius:6px;background:rgba(113,129,255,.14);color:inherit;cursor:pointer}.message-tools{display:flex;gap:5px;flex-wrap:wrap;opacity:0;transition:opacity .12s}.message:hover .message-tools,.message:focus-within .message-tools{opacity:1}.message.is-mentioned{background:linear-gradient(90deg,rgba(244,185,66,.13),transparent 70%);border-left:2px solid rgba(244,185,66,.7)}.message.is-pinned{box-shadow:inset 2px 0 rgba(113,129,255,.65)}.message__body.is-deleted{opacity:.55;font-style:italic}.message-edited,.message-pinned{font-size:11px;color:var(--text-muted,#9aa5ba)}.message-reply-preview{border:0;background:transparent;color:var(--text-muted,#9aa5ba);padding:2px 0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;cursor:pointer}.message__body a{color:#8ea0ff}.message__body code{background:rgba(0,0,0,.25);border-radius:5px;padding:2px 5px}.mention{background:rgba(113,129,255,.18);color:#bac3ff;border-radius:4px;padding:0 3px}.whisper-target-group{min-width:0}.whisper-target-group>strong{display:block;margin-bottom:7px}.search-result{display:flex;flex-direction:column;gap:4px;width:100%;text-align:left;border:0;border-bottom:1px solid var(--border,#2a3140);background:transparent;color:inherit;padding:10px;cursor:pointer}.search-result:hover{background:rgba(255,255,255,.045)}
.composer-input-row{display:flex;align-items:flex-end;gap:8px}.composer-input-row textarea{flex:1}.attachment-button{display:grid;place-items:center;width:36px;height:36px;border-radius:10px;background:rgba(255,255,255,.055);color:var(--text,#fff);cursor:pointer;font-size:22px}.attachment-button.is-disabled{opacity:.45;pointer-events:none}.attachment-preview{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:6px}.attachment-chip{display:inline-flex;align-items:center;gap:6px;padding:5px 8px;border:1px solid var(--border,#2a3140);border-radius:8px;background:rgba(255,255,255,.04);font-size:12px}.attachment-chip button{border:0;background:transparent;color:inherit;cursor:pointer}.message-attachments{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}.message-attachment-image{max-width:min(420px,100%);max-height:320px;border-radius:10px;border:1px solid var(--border,#2a3140);object-fit:contain}.message-attachment-file{display:inline-flex;padding:9px 11px;border:1px solid var(--border,#2a3140);border-radius:9px;background:rgba(255,255,255,.04);color:inherit;text-decoration:none}
