:root {
  color-scheme: dark;
  font-family: 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --bg: #0b1020;
  --panel: #11172b;
  --panel-raised: #171f38;
  --line: rgba(183, 199, 241, .13);
  --text: #f1f4ff;
  --muted: #9ca8c8;
  --blue: #526dff;
  --cyan: #34d5df;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button { color: inherit; }
.auth-layout { display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(430px, .96fr); min-height: 100vh; }
.welcome-panel { position: relative; display: flex; min-height: 100vh; flex-direction: column; justify-content: space-between; overflow: hidden; padding: clamp(28px, 5vw, 72px); background: radial-gradient(ellipse at 18% 14%, rgba(62, 97, 239, .3), transparent 36%), radial-gradient(ellipse at 85% 82%, rgba(23, 195, 210, .12), transparent 32%), linear-gradient(145deg, #131b36, #0d1428 68%, #101a30); border-right: 1px solid var(--line); }
.brand-lockup { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; font: 800 20px Manrope, sans-serif; letter-spacing: -.04em; }
.brand-lockup img { display: block; width: 42px; height: 42px; flex: 0 0 42px; aspect-ratio: 1; object-fit: contain; }
.welcome-copy { position: relative; z-index: 1; max-width: 560px; margin: auto 0; padding: 80px 0; }
.eyebrow { margin: 0 0 16px; color: #8ea2ff; font-size: 11px; font-weight: 700; letter-spacing: .16em; }
.welcome-copy h1 { max-width: 480px; margin: 0 0 20px; font: 800 clamp(42px, 5.4vw, 72px)/1.03 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif; letter-spacing: -.065em; }
.welcome-copy > p:last-child { max-width: 450px; margin: 0; color: #aab6d5; font-size: 17px; line-height: 1.75; }
.welcome-footnote { position: relative; z-index: 1; color: #8290b2; font-size: 12px; }
.welcome-orbit { position: absolute; pointer-events: none; border: 1px solid rgba(106, 137, 255, .12); border-radius: 50%; }
.orbit-one { width: 620px; height: 620px; right: -330px; top: 8%; box-shadow: 0 0 0 50px rgba(76, 103, 216, .025), 0 0 0 110px rgba(76, 103, 216, .018); }
.orbit-two { width: 280px; height: 280px; right: 5%; bottom: 10%; border-color: rgba(52, 213, 223, .14); box-shadow: 0 0 90px rgba(52, 213, 223, .08), inset 0 0 80px rgba(52, 213, 223, .04); }
.form-panel { display: flex; min-width: 0; min-height: 100vh; flex-direction: column; justify-content: center; padding: clamp(28px, 6vw, 88px); background: linear-gradient(155deg, #11172b, #0f1528); }
.auth-card { width: min(100%, 420px); min-width: 0; margin: auto; }
.auth-card h2 { margin: 0; font: 800 32px/1.2 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif; letter-spacing: -.045em; }
.form-intro { margin: 12px 0 32px; color: var(--muted); font-size: 14px; line-height: 1.65; }
form { display: grid; gap: 11px; }
label { margin-top: 5px; color: #dbe2f6; font-size: 13px; font-weight: 600; }
input { width: 100%; height: 49px; padding: 0 15px; border: 1px solid var(--line); border-radius: 11px; outline: 0; background: #0d1325; color: var(--text); transition: border-color .18s, box-shadow .18s; }
input::placeholder { color: #687493; }
input:focus { border-color: #7085ff; box-shadow: 0 0 0 3px rgba(82, 109, 255, .16); }
select { width:100%; min-height:44px; padding:0 12px; border:1px solid var(--line); border-radius:10px; background:#0d1325; color:var(--text); }
select:focus { outline:2px solid rgba(112,133,255,.7); outline-offset:1px; }
.password-label-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.password-label-row label { margin: 0; }
.text-button, .back-button { border: 0; background: transparent; color: #91a4ff; cursor: pointer; font-size: 12px; font-weight: 600; }
.text-button:hover, .back-button:hover { color: #c1cbff; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 78px; }
.password-toggle { position: absolute; top: 0; right: 8px; height: 49px; border: 0; background: transparent; color: #8291b2; cursor: pointer; font-size: 11px; }
.primary-button { min-height: 49px; margin-top: 13px; border: 0; border-radius: 11px; background: linear-gradient(110deg, #5068f0, #4565ec); box-shadow: 0 8px 24px rgba(67, 98, 237, .22); color: white; cursor: pointer; font-size: 14px; font-weight: 700; transition: transform .15s, filter .15s; }
.full-width { width: 100%; }
.primary-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.primary-button:active { transform: translateY(0); }
.form-status { min-height: 18px; margin: 0; color: #aab7d7; font-size: 12px; line-height: 1.5; }
.form-status.error-text { color: #ff9aab; }
.auth-note { display: flex; align-items: center; gap: 10px; margin-top: 24px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.018); color: #96a3c2; font-size: 12px; }
.auth-download-link { display: flex; min-height: 46px; align-items: center; justify-content: center; gap: 9px; margin-top: 12px; padding: 0 14px; color: #dce4ff; font-size: 12px; text-align: center; text-decoration: none; }
.auth-download-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:12px; }
.auth-download-actions .auth-download-link { min-width:0; margin:0; padding-inline:7px; font-size:10px; }
.auth-download-link .line-icon { width: 17px; height: 17px; flex: 0 0 17px; }
.auth-download-link:focus-visible { outline: 2px solid #8c9fff; outline-offset: 3px; }
.secure-icon { display: grid; width: 23px; height: 23px; flex: 0 0 23px; place-items: center; border-radius: 8px; background: rgba(52, 213, 223, .11); color: var(--cyan); font-weight: 700; }
.back-button { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 40px; padding: 0; color: #b0bddb; }
.back-button .line-icon { width: 16px; height: 16px; flex: 0 0 16px; }
.hidden { display: none !important; }
.mobile-brand { display: none; }
.form-footer { display: flex; justify-content: space-between; width: min(100%, 420px); margin: 34px auto 0; color: #66728f; font-size: 11px; }

@media (max-width: 850px) {
  .auth-layout { width: 100vw; max-width: 100vw; min-width: 0; grid-template-columns: minmax(0, 1fr); }
  .welcome-panel { display: none; }
  .form-panel { width: 100%; max-width: 100%; min-width: 0; min-height: 100vh; padding: max(28px, env(safe-area-inset-top)) clamp(22px, 7vw, 42px) max(22px, env(safe-area-inset-bottom)); background: radial-gradient(ellipse at 50% 0%, rgba(70, 101, 231, .2), transparent 42%), var(--panel); }
  .mobile-brand { display: flex; margin: 0 auto 56px; }
  .mobile-brand img { width: 38px; height: 38px; flex-basis: 38px; }
  .auth-card, .form-footer {
    box-sizing: border-box;
    width: min(420px, calc(100vw - clamp(44px, 14vw, 84px) - env(safe-area-inset-left) - env(safe-area-inset-right)));
    max-width: 100%;
    min-width: 0;
    margin: 0 auto;
  }
  .form-footer { margin-top: 48px; }
}

@media (max-width: 420px) {
  .mobile-brand { margin-bottom: 44px; }
  .auth-card h2 { font-size: 28px; }
  .form-intro { margin-bottom: 26px; }
}

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

/* Authenticated workspace foundation */
.app-view { width: 100%; min-height: 100dvh; height: 100dvh; display: grid; grid-template-columns: 72px 308px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); overflow: hidden; background: #0d1018; color: #eef1fa; }
.app-rail { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 17px 10px; border-right: 1px solid rgba(255,255,255,.055); background: #090b11; }
.rail-home,.rail-button,.icon-button { display: grid; flex: 0 0 auto; place-items: center; border: 0; cursor: pointer; transition: background .16s, color .16s, transform .16s; }
.rail-home { width: 46px; height: 46px; margin-bottom: 19px; padding: 4px; border-radius: 15px; background: #171b27; }
.rail-home:hover { background: #22283a; transform: translateY(-1px); }
.rail-home .line-icon { width: 23px; height: 23px; }
.rail-home-mark { display: block; width: 36px; height: 36px; aspect-ratio: 1; border-radius: 10px; object-fit: contain; pointer-events: none; }
.rail-home.active { background: #22283a; box-shadow: 0 0 0 2px #526dff, 0 7px 22px rgba(64, 91, 230, .2); }
.rail-button { width: 46px; height: 46px; border-radius: 15px; background: #171b27; color: #929bb0; }
.rail-button:hover { background: #22283a; color: white; transform: translateY(-1px); }
.rail-button.active { border-radius: 15px; background: #526dff; color: white; box-shadow: 0 7px 22px rgba(64, 91, 230, .28); }
.rail-button > svg:not(.line-icon) { width: 21px; height: 21px; fill: currentColor; }
.rail-spacer { flex: 1; }
.server-shortcuts { display: flex; width: 100%; max-height: min(54dvh, 460px); flex-direction: column; align-items: center; gap: 10px; overflow: auto; scrollbar-width: none; }
.server-shortcuts::-webkit-scrollbar { display: none; }
.server-shortcuts:empty { display: none; }
.server-shortcut { position: relative; display: grid; width: 46px; height: 46px; flex: 0 0 46px; place-items: center; border: 1px solid rgba(255,255,255,.07); border-radius: 15px; background: #1b2231; color: #cbd5f3; cursor: pointer; font-size: 15px; font-weight: 800; transition: border-radius .16s, background .16s, color .16s; }
.server-shortcut:hover { border-radius: 12px; background: #29334a; color: #fff; }
.server-shortcut.active { border-color: rgba(130,151,255,.5); border-radius: 12px; background: #303e68; color: #fff; }
.server-shortcut.active::before { position: absolute; left: -11px; width: 4px; height: 25px; border-radius: 0 4px 4px 0; background: #8ea2ff; content: ''; }
.rail-add-server { color: #7ee0c2; font-size: 23px; }
.app-sidebar { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 23px 17px 12px; border-right: 1px solid rgba(255,255,255,.07); background: #11141d; }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.sidebar-heading .eyebrow { margin-bottom: 5px; font-size: 9px; }
.sidebar-heading h1 { margin: 0; font-size: 21px; letter-spacing: -.035em; }
.icon-button { width: 38px; height: 38px; border-radius: 11px; background: #1e2330; color: #bac3d9; font-size: 20px; }
.icon-button:hover { background: #2a3143; color: white; }
.search-box { display: flex; align-items: center; gap: 9px; height: 42px; padding: 0 12px; border: 1px solid rgba(255,255,255,.075); border-radius: 11px; background: #0d1018; color: #8d97ad; }
.search-box > span { font-size: 22px; line-height: 1; }
.search-box input { height: 38px; min-width: 0; padding: 0; border: 0; background: transparent; box-shadow: none; font-size: 12px; }
.search-box input:focus { border: 0; box-shadow: none; }
.search-results { display: flex; max-height: 240px; flex-direction: column; gap: 5px; margin-top: 6px; overflow: auto; padding: 9px; border: 1px solid rgba(255,255,255,.08); border-radius: 10px; background: #191e2a; color: #aeb8ce; font-size: 11px; line-height: 1.45; }
.search-result-action { padding: 9px 10px; border: 0; border-radius: 7px; background: rgba(82,109,255,.13); color: #dce3ff; cursor: pointer; font-size: 11px; text-align: left; overflow-wrap: anywhere; }
.search-result-action:hover { background: rgba(82,109,255,.24); }
.search-result-action:disabled { opacity: .6; cursor: wait; }
.search-more-button { min-height: 34px; border: 1px solid rgba(111,133,255,.3); border-radius: 8px; background: rgba(82,109,255,.08); color: #bac7ff; cursor: pointer; font: inherit; font-weight: 700; }
.search-more-button:hover { background: rgba(82,109,255,.18); }
.search-more-button:disabled { opacity: .65; cursor: wait; }
.search-results-note { padding: 4px 2px; color: #8994aa; }
.friend-button { display: flex; align-items: center; gap: 10px; min-height: 43px; margin-top: 12px; padding: 0 12px; border: 1px solid rgba(92,119,255,.2); border-radius: 11px; background: rgba(82,109,255,.1); color: #c2ccff; text-align: left; cursor: pointer; font-size: 12px; font-weight: 700; }
.friend-button:hover { background: rgba(82,109,255,.18); }
.friend-icon { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 7px; background: #526dff; color: white; font-size: 16px; }
.sidebar-section-title { display: flex; align-items: center; justify-content: space-between; margin: 25px 2px 11px; color: #a7b0c4; font-size: 11px; font-weight: 700; }
.section-count { color: #737e96; font-size: 10px; font-weight: 500; }
.chat-list { flex: 1; min-height: 80px; overflow: auto; }
.chat-item { display: flex; width: 100%; align-items: center; gap: 10px; margin: 3px 0; padding: 10px 9px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: #c4cada; text-align: left; cursor: pointer; }
.chat-item:hover { background: rgba(255,255,255,.045); }
.chat-item.active { border-color: rgba(117,139,255,.18); background: #272c37; }
.chat-item-avatar { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 13px; background: linear-gradient(145deg,#536eff,#24bac9); color: white; font-weight: 800; }
.chat-item-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 4px; }
.chat-item-copy strong,.chat-item-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item-copy strong { color: #e1e5ef; font-size: 11px; }
.chat-folder-tools { display: flex; align-items: center; justify-content: space-between; margin: 8px 3px 4px; color: var(--ui-muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.chat-folder-tools button { padding: 4px 6px; border: 0; border-radius: 6px; background: transparent; color: var(--ui-accent); font: inherit; text-transform: none; letter-spacing: 0; cursor: pointer; }
.chat-folder-tools button:hover { background: var(--ui-hover); }
.chat-folder-list { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 5px; }
.chat-folder-chip { max-width: 100%; padding: 4px 8px; overflow: hidden; border: 1px solid var(--ui-line); border-radius: 999px; background: var(--ui-panel); color: var(--ui-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.chat-folder-chip.active { border-color: var(--ui-accent); background: color-mix(in srgb, var(--ui-accent) 18%, var(--ui-panel)); color: var(--ui-text); }
.folder-dialog { width: min(460px, calc(100vw - 28px)); }
.folder-dialog .dialog-form { display: grid; gap: 20px; }
.folder-dialog form { display: grid; gap: 8px; }
.folder-local-note { margin: 0; color: var(--ui-muted); font-size: 11px; line-height: 1.5; }
#app-view[data-page="servers"] .chat-folder-tools,
#app-view[data-page="servers"] .chat-folder-list,
#app-view[data-friends-open="true"] .chat-folder-tools,
#app-view[data-friends-open="true"] .chat-folder-list { display: none; }
.chat-item-copy small { color: #858fa4; font-size: 10px; }
.channel-item { padding-left: 12px; }
.channel-kind-icon { display: grid; width: 30px; flex: 0 0 30px; place-items: center; color: #8f9ab2; font-size: 18px; font-weight: 700; }
.channel-kind-icon .line-icon { width: 19px; height: 19px; }
.channel-item.active .channel-kind-icon { color: #aebcff; }
.list-empty { display: flex; min-height: 180px; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px 12px; color: #78839a; text-align: center; }
.list-empty-icon { display: grid; width: 42px; height: 42px; margin-bottom: 4px; place-items: center; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; background: #191e2a; color: #7886a6; font-size: 22px; letter-spacing: 2px; }
.list-empty strong { color: #c4ccdd; font-size: 12px; }
.list-empty > span:last-child { max-width: 190px; font-size: 11px; line-height: 1.55; }
.list-status-spinner { width: 24px; height: 24px; border: 2px solid rgba(142,162,255,.22); border-top-color: var(--blue); border-radius: 50%; animation: list-status-spin .8s linear infinite; }
.list-status-action { margin-top: 4px; padding: 7px 12px; border: 1px solid rgba(142,162,255,.28); border-radius: 9px; background: rgba(82,109,255,.12); color: #c7d0ff; font-size: 11px; font-weight: 700; cursor: pointer; }
.list-status-action:hover { border-color: rgba(142,162,255,.55); background: rgba(82,109,255,.2); }
@keyframes list-status-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .list-status-spinner { animation: none; border-top-color: var(--cyan); } }
.account-card { display: flex; align-items: center; gap: 5px; min-width: 0; margin-top: 10px; padding: 7px 6px; border: 1px solid rgba(255,255,255,.07); border-radius: 13px; background: #181d28; }
.account-card:hover { background: #212737; }
.account-profile-button { display:flex; min-width:0; flex:1; align-items:center; gap:8px; padding:0; border:0; background:transparent; color:inherit; text-align:left; cursor:pointer; }
.account-voice-controls { display:flex; flex:0 0 auto; align-items:center; gap:1px; }
.account-voice-button,.account-device-button { display:grid; width:30px; height:32px; flex:0 0 auto; place-items:center; padding:0; border:0; border-radius:8px; background:transparent; color:#aeb5c2; cursor:pointer; }
.account-voice-button:hover,.account-device-button:hover { background:rgba(255,255,255,.09); color:#fff; }
.account-voice-button .line-icon { width:18px; height:18px; }
.account-device-button { width:15px; color:#8f98a8; font-size:15px; }
.account-voice-button.is-muted { background:rgba(237,66,69,.13); color:#f28b91; }
.account-voice-button.is-transmitting { color:#45d39a; }
.account-card { gap:7px; padding:6px 7px; }
.account-profile-button { gap:8px; }
.account-avatar { width:36px; height:36px; flex-basis:36px; border-radius:50%; }
.account-copy strong { font-size:12px; }
.account-copy small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.account-voice-controls { position:relative; gap:2px; }
.account-voice-button { width:29px; height:34px; }
.account-device-button { width:13px; height:32px; font-size:14px; }
.voice-quick-menu { position:absolute; z-index:50; right:0; bottom:calc(100% + 7px); display:grid; width:min(210px,calc(100vw - 24px)); gap:7px; padding:10px; border:1px solid rgba(255,255,255,.1); border-radius:10px; background:#25262c; box-shadow:0 10px 26px rgba(0,0,0,.4); color:#ebedf0; }
.voice-quick-menu.hidden { display:none; }
.voice-quick-menu > strong,.voice-quick-menu > label { color:#f0f1f3; font-size:12px; font-weight:700; }
.voice-quick-menu > select { width:100%; min-width:0; height:31px; padding:0 8px; border:1px solid rgba(255,255,255,.11); border-radius:7px; background:#17181c; color:#e7e9ed; font:inherit; font-size:10px; }
.voice-quick-menu > label { display:flex; justify-content:space-between; gap:6px; margin-top:2px; }
.voice-quick-menu output { color:#aeb9ff; font-variant-numeric:tabular-nums; }
.voice-quick-menu > input[type="range"] { width:100%; margin:0; accent-color:#5865f2; }
.voice-quick-settings { min-height:30px; margin-top:1px; padding:0 5px; border:0; border-top:1px solid rgba(255,255,255,.1); background:transparent; color:#dbdde1; text-align:left; cursor:pointer; font:inherit; font-size:10px; font-weight:650; }
.voice-quick-settings:hover { color:#fff; }
.account-avatar { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border-radius: 12px; background: linear-gradient(145deg, #536eff, #25c5d2); color: white; font-size: 13px; font-weight: 800; }
.account-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 3px; }
.account-copy strong { overflow: hidden; color: #e7ebf6; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.account-copy small { color: #8390a8; font-size: 10px; }
.account-copy small.is-voice-connected { color: #45d39a; }
.account-menu { color: #8994a9; }
.app-content,.settings-page { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: radial-gradient(ellipse at 55% 40%, rgba(51,71,135,.12), transparent 42%), #0e1119; }
.content-header { display: flex; align-items: center; justify-content: space-between; min-height: 68px; padding: 0 24px; border-bottom: 1px solid rgba(255,255,255,.065); }
.app-view[data-open-chat="true"] #header-new-group-button,.app-view[data-page="servers"] #header-new-group-button { display: none !important; }
.content-header h2 { margin: 0; color: #eff2fb; font-size: 15px; font-weight: 700; }
.content-heading { display: flex; min-width: 0; flex: 1 1 auto; align-items: center; gap: 9px; }
.content-heading h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-chat-back { display: none; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 9px; background: #1e2330; color: #dce3f5; cursor: pointer; font-size: 24px; }
.header-actions { display: flex; gap: 8px; }
.header-actions .icon-button { width: 34px; height: 34px; font-size: 17px; }
.content-stage { display: grid; flex: 1; min-height: 0; place-items: center; padding: 30px; }
.content-stage:has(.conversation-view:not(.hidden)) { display: block; padding: 0; }
.content-stage:has(.friends-page:not(.hidden)) { display: block; padding: 0; overflow: auto; }
.friends-page { width: min(100%, 1180px); min-height: 100%; margin: 0 auto; padding: 32px clamp(18px, 3.2vw, 42px); }
.friends-page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--ui-line); }
.friends-page-heading .eyebrow { margin-bottom: 6px; }
.friends-page-heading h3 { margin: 0; color: var(--ui-text); font-size: 24px; letter-spacing: -.025em; }
.friends-page-heading > p { margin: 0 0 3px; color: var(--ui-muted); font-size: 12px; }
.friends-directory-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.friends-directory-tabs { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--ui-line); border-radius: 10px; background: var(--ui-sidebar); }
.friends-directory-tab { min-height: 34px; padding: 0 13px; border: 0; border-radius: 7px; background: transparent; color: var(--ui-muted); cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; }
.friends-directory-tab:hover { color: var(--ui-text); }
.friends-directory-tab.active { background: var(--ui-raised); color: var(--ui-text); }
.friends-directory-search { flex: 1; min-width: 120px; margin: 0; }
.friends-directory-search-results { min-width: 0; max-height: min(60vh, 620px); overflow: auto; align-content: start; gap: 7px; }
.friends-directory-search-results .friend-result { min-height: 64px; padding: 11px 13px; border-color: var(--ui-line); background: var(--ui-sidebar); }
.friends-directory-search-results .friend-result strong { min-width: 0; overflow-wrap: anywhere; color: var(--ui-text); font-size: 13px; }
.friends-directory-search-results .friend-result small { color: var(--ui-muted); }
.friends-directory-search-results .friend-result button { width: auto; min-width: 82px; min-height: 36px; flex: 0 0 auto; margin: 0 0 0 auto; font-size: 12px; }
.friends-directory-search-results.hidden { display: none; }
.friends-page-add-button { min-height: 40px; padding-inline: 15px; white-space: nowrap; font-size: 12px; font-weight: 750; }
.friends-directory-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(200px,250px); gap: 26px; min-height: 260px; }
.friends-directory-list { min-width: 0; max-height: none; overflow: visible; align-content: start; gap: 7px; }
.friends-directory-list .friend-result { min-height: 64px; padding: 11px 13px; border-color: var(--ui-line); background: var(--ui-sidebar); }
.friends-directory-list .friend-result[hidden] { display: none; }
.friends-directory-list .friend-result strong { color: var(--ui-text); font-size: 13px; }
.friends-directory-list .friend-result .friend-directory-state { flex: 0 0 auto; padding: 4px 8px; border-radius: 99px; background: var(--ui-raised); color: var(--ui-muted); }
.friends-filter-empty { padding: 12px 4px; color: var(--ui-muted); font-size: 13px; }
.friends-directory-empty { display: grid; justify-items: start; gap: 14px; max-width: 520px; padding: 8px 0; }
.friends-directory-empty p { margin: 0; color: var(--ui-muted); font-size: 14px; line-height: 1.55; }
.friends-directory-empty .friends-directory-add { min-height: 40px; padding: 0 16px; font-size: 13px; font-weight: 700; }
.friends-activity-panel { align-self: start; min-height: 150px; padding: 15px 0 12px 20px; border-left: 1px solid var(--ui-line); }
.friends-activity-panel .eyebrow { margin: 0 0 8px; font-size: 10px; }
.friends-activity-panel h4 { margin: 0 0 10px; color: var(--ui-text); font-size: 16px; }
.friends-activity-panel > p:last-child { margin: 0; color: var(--ui-muted); font-size: 12px; line-height: 1.55; }
.friend-directory-avatar { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 50%; background: linear-gradient(145deg, #5865f2, #8d69d5); color: #fff; font-size: 13px; font-weight: 800; }
.friends-directory-list .friend-result button { min-width: 82px; min-height: 36px; font-size: 12px; }
.friend-button.active { border-color: rgba(117,139,255,.34); background: rgba(82,109,255,.2); color: #e0e6ff; }
@media (max-width: 900px) { .friends-directory-layout { grid-template-columns: minmax(0,1fr); } .friends-activity-panel { display: none; } }
@media (max-width: 680px) {
  .friends-page { padding: 22px 16px; }
  .friends-directory-toolbar { flex-wrap: wrap; gap: 9px; }
  .friends-directory-tabs { flex: 1 1 auto; }
  .friends-directory-search { order: 3; flex: 1 0 100%; }
  .friends-page-add-button { min-height: 38px; padding-inline: 11px; font-size: 11px; }
  .friends-directory-list .friend-result { flex-wrap: wrap; gap: 8px; }
  .friends-directory-list .friend-result strong { overflow-wrap: anywhere; white-space: normal; }
}
.conversation-view { display: flex; width: 100%; height: 100%; min-height: 0; flex-direction: column; }
.voice-media-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 10px; max-height: min(42vh, 440px); overflow: auto; padding: 14px 16px 0; }
.voice-media-tile { position: relative; min-width: 0; min-height: 90px; margin: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.09); border-radius: 12px; background: #080a10; }
.voice-media-tile video { display: block; width: 100%; max-height: min(42vh, 440px); aspect-ratio: 16 / 9; background: #080a10; object-fit: contain; }
.voice-media-tile.is-screen { grid-column: 1 / -1; }
.voice-media-tile.is-screen video { aspect-ratio: 16 / 9; }
.voice-media-tile figcaption { position: absolute; right: 8px; bottom: 8px; left: 8px; width: fit-content; max-width: calc(100% - 16px); padding: 4px 8px; overflow: hidden; border-radius: 6px; background: rgba(0,0,0,.64); color: #f2f4fa; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.message-list { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 14px; overflow: auto; padding: 24px clamp(16px,4vw,48px); }
.history-loader { align-self: center; min-height: 32px; margin: 0 0 8px; padding: 0 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 9px; background: #191e2a; color: #aab7d0; cursor: pointer; font: inherit; font-size: 11px; }
.history-loader:hover:not(:disabled) { border-color: rgba(117,139,255,.38); color: #d7dfff; }
.history-loader:disabled { cursor: default; opacity: .65; }
.message-row { display: grid; grid-template-columns: 38px minmax(0,1fr); gap: 10px; align-items: start; }
.message-row { position: relative; }
.message-avatar { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; background: #27314d; color: #b8c5ff; font-size: 12px; font-weight: 800; }
.message-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.message-head strong { color: #e6ebf7; font-size: 13px; }
.message-action-toolbar { position:absolute; z-index:3; top:-12px; right:4px; display:flex; align-items:center; gap:2px; padding:3px; border:1px solid var(--ui-line); border-radius:9px; background:var(--ui-sidebar); box-shadow:0 4px 16px rgba(0,0,0,.22); opacity:0; pointer-events:none; transform:translateY(2px); transition:opacity .12s ease,transform .12s ease; }
.message-action-quick,.message-action-trigger { display:grid; width:27px; height:27px; flex:0 0 27px; place-items:center; border:0; border-radius:6px; background:transparent; color:var(--ui-text); cursor:pointer; line-height:1; }
.message-action-quick { font-size:16px; }
.message-action-quick .line-icon { width:16px; height:16px; }
.message-action-trigger { margin:0; color:var(--ui-muted); font:inherit; font-size:18px; }
.message-action-toolbar button:hover:not(:disabled),.message-action-toolbar button:focus-visible { outline:0; background:var(--ui-raised); }
.message-action-quick[aria-pressed="true"] { background:color-mix(in srgb,var(--ui-accent) 22%,var(--ui-raised)); }
.message-action-quick:disabled { opacity:.55; cursor:wait; }
.message-row:hover .message-action-toolbar,.message-row:focus-within .message-action-toolbar { opacity:1; pointer-events:auto; transform:translateY(0); }
.message-reply-preview { display: grid; gap: 2px; max-width: min(100%, 520px); margin: 2px 0 7px; padding: 5px 9px; border-left: 2px solid var(--ui-accent); border-radius: 0 6px 6px 0; background: color-mix(in srgb, var(--ui-accent) 8%, transparent); color: var(--ui-muted); font-size: 11px; }
.message-reply-preview strong { overflow: hidden; color: var(--ui-text); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.message-reply-preview span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-reply-preview { width:auto; border:0; text-align:left; font:inherit; cursor:pointer; }
.message-reply-preview:hover:not(:disabled),.message-reply-preview:focus-visible:not(:disabled) { outline:1px solid color-mix(in srgb,var(--ui-accent) 55%,transparent); background:color-mix(in srgb,var(--ui-accent) 14%,var(--ui-sidebar)); }
.replying-to { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; border-left: 3px solid var(--ui-accent); border-radius: 7px; background: color-mix(in srgb, var(--ui-accent) 10%, var(--ui-raised)); }
.replying-to > span { display: grid; min-width: 0; gap: 2px; }
.replying-to strong,.replying-to small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.replying-to strong { color: var(--ui-text); font-size: 11px; }
.replying-to small { color: var(--ui-muted); font-size: 10px; }
.replying-to button { width: 30px; height: 30px; flex: 0 0 30px; border: 0; border-radius: 7px; background: transparent; color: var(--ui-muted); cursor: pointer; font: inherit; font-size: 20px; }
.replying-to button:hover,.replying-to button:focus-visible { outline: 0; background: var(--ui-raised); color: var(--ui-text); }
.message-action-menu { position: fixed; z-index: 1000; width: max-content; min-width: 240px; max-width: min(320px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); overflow-y: auto; overscroll-behavior: contain; padding: 5px; border: 1px solid var(--ui-line); border-radius: 9px; background: var(--ui-sidebar); box-shadow: 0 12px 32px rgba(0,0,0,.36); }
.message-bookmarks-dialog { width: min(620px,calc(100vw - 28px)); }
.message-bookmarks-list { display:grid; gap:7px; max-height:min(60dvh,520px); overflow:auto; }
.message-bookmark-entry { display:grid; min-width:0; grid-template-columns:minmax(0,1fr) auto; gap:6px; }
.message-bookmark-item { display:grid; min-width:0; grid-template-columns:minmax(0,1fr) auto; gap:4px 10px; padding:10px 12px; border:1px solid var(--ui-line); border-radius:9px; background:var(--ui-sidebar); color:var(--ui-text); text-align:left; cursor:pointer; }
.message-bookmark-item:hover,.message-bookmark-item:focus-visible { border-color:var(--ui-accent); outline:none; }
.message-bookmark-item strong { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
.message-bookmark-item time { color:var(--ui-muted); font-size:10px; }
.message-bookmark-item span { grid-column:1/-1; display:-webkit-box; overflow:hidden; color:var(--ui-muted); font-size:11px; line-height:1.45; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.message-bookmark-remove { align-self:center; width:34px; height:34px; border:0; border-radius:8px; background:transparent; color:var(--ui-muted); cursor:pointer; }
.message-bookmark-remove:hover,.message-bookmark-remove:focus-visible { outline:0; background:var(--ui-raised); color:var(--ui-danger,#ed4245); }
.message-forward-dialog { width: min(520px,calc(100vw - 28px)); }
.message-forward-preview { max-height: 150px; overflow: auto; padding: 12px; border: 1px solid var(--ui-line); border-radius: 10px; background: rgba(255,255,255,.035); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ui-text); font-size: 12px; line-height: 1.5; }
.message-forward-attachment-note { margin: 8px 0 0; color: var(--ui-muted); font-size: 11px; line-height: 1.45; }
.message-forward-targets { display: grid; gap: 8px; min-width: 0; max-height: min(36dvh,280px); margin: 14px 0 0; padding: 0; overflow: auto; border: 0; }
.message-forward-targets legend { margin-bottom: 8px; color: var(--ui-muted); font-size: 11px; }
#message-forward-target-list { display: grid; gap: 5px; }
.message-forward-target { display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 7px 9px; border: 1px solid var(--ui-line); border-radius: 8px; background: rgba(255,255,255,.025); color: var(--ui-text); cursor: pointer; font-size: 12px; }
.message-forward-target:has(input:checked) { border-color: color-mix(in srgb, var(--ui-accent) 62%, transparent); background: color-mix(in srgb, var(--ui-accent) 14%, transparent); }
.message-forward-target input[type="checkbox"] { display: block; width: 16px; height: 16px; flex: 0 0 16px; margin: 0; padding: 0; border: 0; border-radius: 4px; background: transparent; accent-color: var(--ui-accent); }
.message-forward-target span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-link-target { outline: 2px solid color-mix(in srgb, var(--ui-accent) 78%, transparent); outline-offset: 2px; background: color-mix(in srgb, var(--ui-accent) 12%, transparent); }
.message-reaction-picker { display:flex; align-items:center; justify-content:space-between; gap:2px; margin:0 0 4px; padding:2px 3px 6px; border-bottom:1px solid var(--ui-line); }
.message-reaction-option { display:grid; width:30px; height:30px; flex:0 0 30px; place-items:center; border:0; border-radius:6px; background:transparent; cursor:pointer; font:inherit; font-size:17px; }
.message-reaction-option:hover,.message-reaction-option:focus-visible { outline:0; background:var(--ui-raised); transform:scale(1.08); }
.message-reaction-option:disabled { opacity:.55; }
.message-reactions { display:flex; flex-wrap:wrap; gap:5px; margin-top:7px; }
.message-reaction-chip { min-height:25px; padding:2px 8px; border:1px solid var(--ui-line); border-radius:99px; background:var(--ui-raised); color:var(--ui-text); cursor:pointer; font:inherit; font-size:12px; }
.message-reaction-chip:hover,.message-reaction-chip.is-mine { border-color:color-mix(in srgb,var(--ui-accent) 60%,var(--ui-line)); background:color-mix(in srgb,var(--ui-accent) 18%,var(--ui-raised)); }
.message-reaction-chip:disabled { opacity:.6; cursor:wait; }
.message-action-item { display: flex; width: 100%; min-height: 38px; align-items: center; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: inherit; cursor: pointer; font: inherit; font-size: 12px; text-align: left; }
.message-action-item:hover:not(:disabled),.message-action-item:focus-visible { outline: 0; background: var(--ui-raised); color: inherit; }
.message-action-item:disabled { color: #777b83; cursor: default; }
.message-action-item-danger { color: #ff9eaa; }
.message-action-item-danger:hover:not(:disabled),.message-action-item-danger:focus-visible { background: rgba(176,52,68,.2); color: #ffb5be; }
.message-edited-label { margin-left: 3px; color: var(--ui-muted); font-size: 11px; }
@media (pointer: coarse) { .message-action-toolbar { opacity:1; pointer-events:auto; transform:none; } }
.message-head time { color: #7f899f; font-size: 10px; }
.message-body { margin: 4px 0 0; color: #c4cada; font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-empty { margin: auto; color: #8893a8; font-size: 12px; text-align: center; }
.message-load-status { display: flex; max-width: 440px; flex-direction: column; align-items: center; justify-content: center; gap: 10px; margin: auto; padding: 24px; text-align: center; }
.message-load-status .message-empty { max-width: 380px; margin: 0; line-height: 1.6; }
.message-composer { position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 0 18px 18px; padding: 10px; border: 1px solid rgba(255,255,255,.09); border-radius: 14px; background: #181c27; }
.pending-attachments { display: flex; min-width: 0; flex: 0 0 100%; flex-wrap: wrap; gap: 6px; }
.message-outbox { display:flex; min-width:0; max-height:170px; flex:0 0 100%; flex-direction:column; gap:6px; overflow:auto; padding:2px; }
.message-outbox-heading,.message-outbox-remainder { color:var(--ui-muted,#b5bac1); font-size:10px; }
.message-outbox-corruption { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:9px 11px; border:1px solid color-mix(in srgb,var(--ui-warning,#edbd72) 48%,transparent); border-radius:9px; color:var(--ui-warning,#edbd72); font-size:11px; }
.message-outbox-corruption a { color:inherit; flex:0 0 auto; }
.message-outbox-item { display:flex; min-width:0; align-items:center; justify-content:space-between; gap:10px; padding:7px 9px; border:1px solid color-mix(in srgb,var(--ui-text,#f2f3f5) 12%,transparent); border-radius:9px; background:color-mix(in srgb,var(--ui-text,#f2f3f5) 4%,transparent); }
.message-outbox-item[data-state="blocked"] { border-color:color-mix(in srgb,#e9a23b 48%,transparent); }
.message-outbox-details { display:flex; min-width:0; flex:1; flex-direction:column; gap:3px; }
.message-outbox-details strong { overflow:hidden; color:var(--ui-text,#f2f3f5); font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.message-outbox-preview { overflow:hidden; color:var(--ui-muted,#b5bac1); font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.message-outbox-details small { color:var(--ui-muted,#b5bac1); font-size:10px; }
.message-outbox-item[data-state="blocked"] .message-outbox-details small { color:var(--ui-warning,#edbd72); }
.message-outbox-actions { display:flex; flex:0 0 auto; flex-wrap:wrap; justify-content:flex-end; gap:3px 8px; }
.message-outbox-actions .text-button { min-height:30px; padding-inline:5px; font-size:10px; }
@media (max-width:560px) { .message-outbox-item { align-items:flex-start; flex-direction:column; gap:4px; } .message-outbox-actions { width:100%; justify-content:flex-start; } }
.pending-attachment { display: flex; min-width: 0; max-width: min(100%, 320px); align-items: center; gap: 7px; padding: 5px 6px 5px 9px; border: 1px solid rgba(117,139,255,.2); border-radius: 9px; background: rgba(74,95,166,.13); color: #d5dcff; font-size: 11px; }
.pending-attachment-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pending-attachment-size { flex: 0 0 auto; color: #9da9c5; font-size: 10px; }
.pending-attachment-remove { display: grid; width: 25px; height: 25px; flex: 0 0 25px; place-items: center; border: 0; border-radius: 7px; background: transparent; color: #bbc5df; cursor: pointer; font-size: 18px; line-height: 1; }
.pending-attachment-remove:hover:not(:disabled),.pending-attachment-remove:focus-visible { outline: 0; background: rgba(255,255,255,.1); color: #fff; }
.pending-attachment-remove:disabled { cursor: wait; opacity: .55; }
.message-composer textarea,.dialog-field textarea { width: 100%; min-height: 42px; max-height: 150px; resize: vertical; padding: 11px 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 9px; outline: 0; background: #0f121a; color: #f0f3fa; font: inherit; font-size: 12px; }
.message-composer textarea { min-width: 0; flex: 1; border: 0; background: transparent; resize: none; }
.attachment-button { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border: 0; border-radius: 9px; background: #252b3a; color: #aebaff; cursor: pointer; font-size: 22px; line-height: 1; }
.attachment-button:hover { background: #313a50; color: #fff; }
.emoji-picker { position: fixed; z-index: 40; top: 0; left: 0; width: min(304px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow: auto; overscroll-behavior: contain; padding: 12px; border: 1px solid var(--ui-line); border-radius: 12px; background: var(--ui-sidebar); box-shadow: 0 12px 34px rgba(0,0,0,.42); }
.emoji-picker h2 { margin: 0 0 9px; color: var(--ui-text); font-size: 12px; font-weight: 700; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; }
.emoji-option { display: grid; width: 32px; height: 34px; place-items: center; padding: 0; border: 0; border-radius: 7px; background: transparent; cursor: pointer; font-size: 21px; line-height: 1; }
.emoji-option:hover,.emoji-option:focus-visible { outline: 0; background: var(--ui-raised); }
.message-composer .primary-button { min-height: 38px; margin: 0; padding: 0 14px; font-size: 11px; }
.message-attachments { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.attachment-download { max-width: min(100%,420px); min-height: 34px; padding: 7px 10px; overflow: hidden; border: 1px solid rgba(117,139,255,.2); border-radius: 9px; background: rgba(74,95,166,.13); color: #cbd5ff; cursor: pointer; font: inherit; font-size: 11px; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.attachment-download:hover:not(:disabled) { background: rgba(84,110,205,.25); }
.attachment-download:disabled { cursor: wait; opacity: .65; }
.attachment-preview { display:grid; width:fit-content; max-width:min(420px,100%); justify-items:start; gap:5px; padding:4px; overflow:hidden; border:1px solid rgba(104,130,255,.24); border-radius:10px; background:rgba(82,109,255,.08); color:#b8c2dc; cursor:pointer; font:inherit; font-size:11px; text-align:left; }
.attachment-preview:hover:not(:disabled) { border-color:rgba(132,151,255,.58); background:rgba(82,109,255,.14); }
.attachment-link-target { outline:2px solid var(--ui-accent); outline-offset:2px; }
.attachment-thumbnail { display:block; width:auto; max-width:100%; max-height:360px; object-fit:contain; border-radius:7px; background:rgba(0,0,0,.16); }
.attachment-thumbnail-status { display:block; padding:6px 8px; color:#aeb8d0; }
.attachment-preview:disabled { cursor:wait; opacity:.65; }
.conversation-dialog { width: min(460px,calc(100vw - 28px)); max-height: min(90dvh,640px); padding: 22px; overflow: auto; border: 1px solid rgba(255,255,255,.12); border-radius: 18px; background: #191d27; color: #edf1fa; box-shadow: 0 25px 90px rgba(0,0,0,.5); }
.user-profile-dialog { width: min(420px,calc(100vw - 28px)); padding: 18px; }
.user-profile-card { display:flex; align-items:center; gap:14px; margin:18px 0 14px; padding:16px; border:1px solid rgba(255,255,255,.08); border-radius:14px; background:rgba(255,255,255,.035); }
.user-profile-avatar { display:grid; width:56px; height:56px; flex:0 0 56px; place-items:center; border-radius:50%; background:linear-gradient(145deg,#5865f2,#8d69d5); color:#fff; font-size:22px; font-weight:800; }
.user-profile-copy { display:grid; min-width:0; gap:5px; }
.user-profile-copy strong { overflow-wrap:anywhere; color:#f1f3f8; font-size:14px; }
.user-profile-copy small,.user-profile-note { color:#aeb5c5; font-size:11px; line-height:1.55; }
.user-profile-note { margin:0 0 14px; }
.user-profile-dialog .primary-button { width:100%; margin-top:8px; }
.conversation-dialog::backdrop { background: rgba(2,4,9,.72); backdrop-filter: blur(4px); }
.friend-note-dialog { width:min(520px,calc(100vw - 28px)); }
.friend-note-dialog textarea { min-height:150px; resize:vertical; line-height:1.5; }
.friend-alias-dialog { width:min(480px,calc(100vw - 28px)); }
.friend-directory-alias-email { display:block; color:var(--muted); font-size:11px; }
.image-preview-dialog { width:min(960px,calc(100vw - 28px)); max-height:min(92dvh,840px); padding:18px; overflow:auto; border:1px solid rgba(255,255,255,.12); border-radius:16px; background:#191d27; color:#edf1fa; box-shadow:0 25px 90px rgba(0,0,0,.5); }
.image-preview-dialog::backdrop { background:rgba(2,4,9,.78); backdrop-filter:blur(4px); }
.image-preview-dialog .form-status { margin:4px 0 8px; }
.attachment-preview-stage { display:grid; min-height:0; max-height:calc(92dvh - 110px); place-items:center; overflow:auto; border-radius:10px; background:#101218; }
.attachment-preview-stage img,.attachment-preview-stage video { display:block; max-width:100%; max-height:calc(92dvh - 130px); object-fit:contain; }
.attachment-preview-stage audio { width:min(720px,100%); }
.attachment-preview-text { width:100%; max-height:calc(92dvh - 130px); margin:0; padding:16px; overflow:auto; color:#e1e5ef; white-space:pre-wrap; overflow-wrap:anywhere; font:13px/1.55 ui-monospace,Consolas,monospace; }
.image-preview-stage { display:grid; min-height:80px; max-height:76dvh; place-items:center; overflow:auto; }
.image-preview-stage img { display:block; max-width:100%; max-height:76dvh; object-fit:contain; }
.dialog-topline { display: flex; grid-template-columns: 1fr auto; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-topline h2 { margin: 0; font-size: 18px; }
.dialog-form { margin-top: 16px; }
.dialog-field { display: grid; gap: 7px; color: #c9d1e2; font-size: 11px; }
.dialog-field input { height: 43px; font-size: 12px; }
.dialog-field select { width: 100%; height: 43px; padding: 0 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 9px; background: #0f121a; color: #f0f3fa; font: inherit; font-size: 12px; }
.dialog-field small { color: #8893a8; font-size: 10px; line-height: 1.5; }
.friend-results { display: grid; gap: 7px; max-height: 220px; overflow: auto; }
.friend-search-message { margin: 0; padding: 8px 10px; border: 1px solid var(--ui-line); border-radius: 9px; background: rgba(255,255,255,.025); color: var(--ui-muted); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.friend-search-message[aria-busy="true"] { color: var(--ui-text); }
.friend-search-message.is-error { border-color: rgba(238,105,123,.3); color: #f2a0ab; }
.friend-result { display: flex; align-items: center; gap: 9px; padding: 9px; border: 1px solid rgba(255,255,255,.075); border-radius: 10px; background: rgba(255,255,255,.025); }
.friend-result strong { min-width: 0; flex: 1; overflow: hidden; color: #dce3f2; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.friend-result small { color: #8b97ae; font-size: 10px; }
.friend-result button { min-height: 30px; padding: 0 9px; border: 1px solid rgba(117,139,255,.24); border-radius: 8px; background: rgba(82,109,255,.12); color: #c3ceff; cursor: pointer; font-size: 10px; }
.friend-choice-list,.group-member-list { max-height: 210px; overflow: auto; }
.friend-choice { display: flex; min-height: 39px; align-items: center; gap: 10px; margin: 0; padding: 8px 10px; border: 1px solid rgba(255,255,255,.075); border-radius: 9px; background: rgba(255,255,255,.025); color: #d3dbed; cursor: pointer; font-size: 11px; }
.friend-choice:hover { border-color: rgba(117,139,255,.35); background: rgba(82,109,255,.07); }
.friend-choice input { width: 16px; height: 16px; flex: 0 0 16px; margin: 0; padding: 0; accent-color: #7489ff; }
.friend-choice span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-invite-friends { display:grid; gap:8px; margin:12px 0; padding:10px; border:1px solid rgba(255,255,255,.08); border-radius:10px; background:rgba(255,255,255,.02); }
.server-invite-friends h3 { margin:0; font-size:13px; }
.server-invite-friends .dialog-field { margin:0; }
.server-invite-friend-list { display:grid; gap:6px; max-height:160px; }
.server-invite-friend-list .friend-choice { min-height:36px; }
.server-invite-friend-state { margin-left:auto; color:#8b97ae; font-size:10px; }
.server-invite-friends .form-status:empty { display:none; }
.group-member { display: flex; min-height: 38px; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid rgba(255,255,255,.06); border-radius: 9px; background: rgba(255,255,255,.02); }
.group-member strong { overflow: hidden; color: #dce3f2; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.group-member small { flex: 0 0 auto; color: #8f9ab0; font-size: 9px; }
.dialog-form .primary-button { width: 100%; margin-top: 3px; }
.welcome-card { width: min(100%, 650px); padding: clamp(28px, 5vw, 54px); border: 1px solid rgba(158,174,226,.12); border-radius: 23px; background: linear-gradient(145deg, rgba(30,39,65,.88), rgba(20,25,39,.94)); box-shadow: 0 25px 90px rgba(0,0,0,.22); }
.welcome-mark { display: grid; width: 54px; height: 54px; margin-bottom: 30px; place-items: center; border: 1px solid rgba(255,255,255,.1); border-radius: 17px; background: rgba(255,255,255,.035); }
.welcome-mark img { display: block; width: 40px; height: 40px; flex: 0 0 40px; aspect-ratio: 1; object-fit: contain; }
.welcome-card .eyebrow { margin-bottom: 11px; }
.welcome-card h2 { margin: 0 0 12px; font-size: clamp(25px, 3vw, 36px); letter-spacing: -.045em; }
.welcome-card > p:not(.eyebrow) { max-width: 540px; margin: 0; color: #a4aec4; font-size: 14px; line-height: 1.75; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 25px; }
.welcome-actions .primary-button,.welcome-actions .secondary-button { width: auto; min-height: 40px; margin: 0; padding: 0 14px; font-size: 11px; }
.secondary-button { border: 1px solid rgba(255,255,255,.1); border-radius: 10px; background: rgba(255,255,255,.04); color: #d3dbed; cursor: pointer; font-weight: 700; }
.secondary-button:hover { background: rgba(255,255,255,.09); }
.danger-button { min-height: 40px; padding: 0 14px; border: 1px solid rgba(242,102,120,.32); border-radius: 10px; background: rgba(176,52,68,.15); color: #ff9eaa; cursor: pointer; font: inherit; font-weight: 700; }
.danger-button:hover:not(:disabled) { border-color: rgba(255,124,141,.5); background: rgba(176,52,68,.25); }
.danger-button:disabled { cursor: wait; opacity: .65; }
.server-settings-danger-zone { margin-top: 18px; padding-top: 17px; border-top: 1px solid rgba(255,255,255,.08); }
.server-owner-limit { margin: 10px 2px 0; color: #929cb0; font-size: 11px; line-height: 1.55; }
.server-owner-leave { display:grid; gap:10px; margin-top:16px; }
.server-owner-leave > small { color:var(--muted); font-size:11px; line-height:1.5; }
.server-owner-delete { display:grid; gap:10px; margin-top:16px; padding-top:14px; border-top:1px solid rgba(242,102,120,.2); }
.server-owner-delete strong { color:#ff9eaa; font-size:13px; }
.server-owner-delete p { margin:5px 0 0; color:var(--muted); font-size:11px; line-height:1.55; }
.server-owner-delete .danger-button { min-height:38px; }
.server-delete-name { width:100%; min-height:42px; margin-top:6px; padding:0 12px; border:1px solid rgba(255,255,255,.12); border-radius:10px; background:#10131b; color:#e6eaf3; font:inherit; }
.server-delete-name:focus-visible { border-color:#8191ff; outline:2px solid rgba(129,145,255,.24); }
.leave-server-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 16px; }
.leave-server-actions > button { min-height: 44px; }
.group-membership-actions { display: grid; gap: 9px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.group-membership-actions > section { display: grid; gap: 9px; }
.group-membership-actions > button { min-height: 42px; }
.voice-dock { display: flex; align-items: center; gap: 11px; min-height: 72px; padding: 10px 21px; border-top: 1px solid rgba(255,255,255,.06); background: rgba(14,17,25,.85); }
.voice-status-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #72809c; }
.voice-status-dot.is-connected { background: #45d39a; box-shadow: 0 0 12px rgba(69,211,154,.58); }
.voice-status-dot.is-reconnecting { background: #f2b84b; box-shadow: 0 0 10px rgba(242,184,75,.5); animation: voice-reconnect-pulse 1.1s ease-in-out infinite alternate; }
@keyframes voice-reconnect-pulse { to { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .voice-status-dot.is-reconnecting { animation: none; } }
.voice-status-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 4px; }
.voice-status-copy strong { color: #dfe5f3; font-size: 11px; }
.voice-status-copy small { overflow: hidden; color: #818ca3; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.dock-button { min-height: 34px; padding: 0 12px; border: 1px solid rgba(112,133,255,.28); border-radius: 9px; background: rgba(82,109,255,.12); color: #bec9ff; cursor: pointer; font-size: 10px; font-weight: 700; }
.dock-button:hover { background: rgba(82,109,255,.22); }
.dock-button.is-transmitting { border-color: rgba(69,211,154,.45); background: rgba(69,211,154,.15); color: #9bf2ca; }
.voice-dock.is-connected { background: rgba(18,29,31,.94); }
.app-view[data-voice-connected="false"] .voice-dock { display:none !important; }

.settings-page { grid-column: 3; overflow: auto; }
.app-view[data-settings="open"] { grid-template-columns: minmax(0,1fr); }
.app-view[data-settings="open"] .app-rail,.app-view[data-settings="open"] .app-sidebar { display: none; }
.app-view[data-settings="open"] .settings-page { grid-column: 1; }
.settings-header { position: sticky; z-index: 2; top: 0; background: rgba(14,17,25,.96); backdrop-filter: blur(12px); }
.settings-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: 0; flex: 1; }
.settings-nav { padding: 28px 13px; border-right: 1px solid rgba(255,255,255,.06); background: rgba(17,20,29,.7); }
.settings-nav .eyebrow { margin: 0 10px 14px; font-size: 9px; }
.settings-link { display: flex; width: 100%; align-items: center; gap: 10px; min-height: 40px; margin-bottom: 5px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: #9da7ba; text-align: left; cursor: pointer; font-size: 11px; }
.settings-link > span:first-child { width: 19px; color: #8592ad; font-size: 16px; text-align: center; }
.settings-link small { margin-left: auto; color: #707b91; font-size: 9px; }
.settings-link:hover { background: #1b202d; color: #e6ebf6; }
.settings-link.active { background: #252b3a; color: #f2f4fb; font-weight: 700; }
.settings-link.active > span:first-child { color: #91a2ff; }
.settings-body { width: min(100%, 770px); padding: clamp(25px, 4vw, 48px); }
.device-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 16px; margin: 22px 0 16px; }
.device-field,.device-level { display: grid; gap: 8px; color: #e0e5f0; font-size: 11px; font-weight: 650; }
.device-field select { width: 100%; min-width: 0; height: 42px; padding: 0 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 9px; outline: 0; background: #171c27; color: #e5eaf5; font: inherit; }
.device-field select:focus-visible,.device-level input:focus-visible { border-color: #8497ff; outline: 2px solid rgba(132,151,255,.28); outline-offset: 2px; }
.device-level > span { display: flex; justify-content: space-between; gap: 8px; }
.device-level output { color: #a9b6ff; font-variant-numeric: tabular-nums; }
.device-level input { width: 100%; accent-color: #7085ff; }
.device-test-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.device-test-row .primary-button,.device-test-row .secondary-button { min-height: 38px; padding-inline: 13px; font-size: 10px; }
.mic-level { position: relative; display: block; height: 8px; min-width: 120px; flex: 1; overflow: hidden; border-radius: 99px; background: #252c3a; }
.mic-level > span { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: linear-gradient(90deg,#d99b49 0 35%,#57b781 65%,#d99b49); transition: width .08s linear; }
.device-status { min-height: 15px; margin: 9px 0 0; color: #8f9bb1; font-size: 10px; line-height: 1.5; }
.settings-divider { height: 1px; margin: 22px 0; border: 0; background: rgba(255,255,255,.08); }
.settings-subheading { margin-bottom: 15px !important; font-size: 18px !important; }
.settings-body > .eyebrow { margin-bottom: 8px; font-size: 9px; }
.settings-body h3 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.settings-intro { max-width: 590px; margin: 10px 0 24px; color: #9ba6bb; font-size: 12px; line-height: 1.65; }
.voice-mode-list { display: grid; gap: 9px; margin: 0; padding: 0; border: 0; }
.voice-mode-card { position: relative; display: flex; align-items: flex-start; gap: 12px; min-height: 75px; padding: 15px; border: 1px solid rgba(255,255,255,.075); border-radius: 12px; background: rgba(255,255,255,.018); cursor: pointer; transition: border-color .16s, background .16s; }
.voice-mode-card:hover { border-color: rgba(132,151,255,.35); background: rgba(82,109,255,.045); }
.voice-mode-card:has(input:checked) { border-color: rgba(99,122,255,.65); background: rgba(82,109,255,.095); box-shadow: inset 0 0 0 1px rgba(82,109,255,.13); }
.voice-mode-card input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.mode-radio { display: grid; width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; place-items: center; border: 1.5px solid #69748d; border-radius: 50%; }
.voice-mode-card input:checked + .mode-radio { border-color: #778dff; }
.voice-mode-card input:checked + .mode-radio::after { width: 8px; height: 8px; border-radius: 50%; background: #778dff; content: ''; }
.mode-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 6px; }
.mode-copy strong { color: #e8edf8; font-size: 12px; }
.mode-copy small { color: #929db2; font-size: 10px; line-height: 1.5; }
.mode-tag { padding: 5px 7px; border-radius: 6px; background: rgba(140,157,255,.1); color: #aab8ff; font-size: 9px; white-space: nowrap; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 75px; margin-top: 19px; padding: 14px 3px; border-top: 1px solid rgba(255,255,255,.065); }
.setting-row > div:first-child { display: flex; flex-direction: column; gap: 6px; }
.setting-row strong { color: #e4e9f4; font-size: 11px; }
.setting-row small { color: #8994a9; font-size: 10px; line-height: 1.45; }
.account-setting-row output { max-width: min(52%, 380px); overflow-wrap: anywhere; color: #e5eaf5; font-size: 12px; font-weight: 650; text-align: right; }
.account-setting-row .secondary-button { flex: 0 0 auto; min-height: 38px; margin: 0; padding: 0 13px; font-size: 11px; }
#account-recovery-status { min-height: 1.5em; }
.keybind-button { display: flex; min-height: 39px; align-items: center; gap: 11px; padding: 0 10px; border: 1px solid rgba(255,255,255,.11); border-radius: 9px; background: #171c27; cursor: pointer; font-size: 10px; }
.keybind-button:hover { border-color: rgba(140,157,255,.5); }
.keybind-button kbd { min-width: 75px; padding: 6px 8px; border: 1px solid rgba(255,255,255,.1); border-radius: 6px; background: #222938; color: #e7ecf8; font: 600 10px 'Segoe UI', sans-serif; text-align: center; }
.keybind-button span { color: #aab7ff; }
.range-control { display: flex; align-items: center; gap: 12px; width: min(230px, 45%); }
.range-control input { height: 5px; padding: 0; accent-color: #7489ff; }
.range-control output { min-width: 36px; color: #bac5ff; font-size: 11px; text-align: right; }
.settings-note { display: flex; gap: 10px; margin-top: 18px; padding: 12px; border: 1px solid rgba(88,156,218,.19); border-radius: 10px; background: rgba(39,102,161,.08); }
.settings-note > span:first-child { display: grid; width: 17px; height: 17px; flex: 0 0 17px; place-items: center; border-radius: 50%; background: rgba(92,165,224,.17); color: #89c4f1; font: 700 11px Georgia,serif; }
.settings-note > span:last-child { display: block; min-width: 0; flex: 1; color: #c0c4d4; font: inherit; font-size: 11px; line-height: 1.55; }
.settings-note p { margin: 0; color: #9fb1c7; font-size: 10px; line-height: 1.55; }
.app-toast { position: fixed; z-index: 10; right: 22px; bottom: 22px; max-width: min(380px, calc(100vw - 32px)); padding: 12px 15px; border: 1px solid rgba(255,255,255,.12); border-radius: 11px; background: #232a3a; box-shadow: 0 15px 45px rgba(0,0,0,.3); color: #e6eaf5; font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .18s, transform .18s; }
.app-toast.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.toast-action { margin-left: 12px; padding: 4px 8px; border: 1px solid rgba(255,255,255,.24); border-radius: 7px; background: transparent; color: inherit; font: inherit; font-weight: 700; cursor: pointer; }
.app-update-notice { position: fixed; z-index: 12; right: 22px; bottom: 22px; display: flex; width: min(500px, calc(100vw - 32px)); align-items: center; justify-content: space-between; gap: 18px; padding: 16px; border: 1px solid rgba(128,151,255,.42); border-radius: 14px; background: #171f38; box-shadow: 0 18px 55px rgba(0,0,0,.42); }
.app-update-copy { display: grid; gap: 5px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.app-update-copy strong { color: var(--text); font-size: 14px; }
.app-update-status { color: #ffcf8a; }
.app-update-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.app-update-actions button { min-height: 38px; margin: 0; padding: 0 12px; font-size: 12px; }
#app-view[data-settings="open"] #app-update-notice,#app-view:has(dialog[open]) #app-update-notice { display:none; }
:root[data-theme="light"] .app-update-notice { background: #fff; box-shadow: 0 18px 55px rgba(30,45,80,.2); }
@media (max-width: 560px) {
  .app-update-notice { right: 12px; bottom: calc(128px + env(safe-area-inset-bottom)); left: 76px; width: auto; align-items: center; gap: 8px; padding: 8px 10px; }
  .app-update-copy { min-width: 0; gap: 0; font-size: 10px; }
  .app-update-copy strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .app-update-copy > span:not(.app-update-status) { display: none; }
  .app-update-actions { gap: 5px; }
  .app-update-actions button { min-height: 34px; flex: 1; padding-inline: 8px; font-size: 10px; }
}
.mobile-context { display: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.app-view button:focus-visible,.app-view input:focus-visible { outline: 2px solid #8c9fff; outline-offset: 2px; }

.desktop-download-cta { display:inline-flex; align-items:center; justify-content:center; min-height:40px; padding:0 14px; line-height:1.35; text-align:center; text-decoration:none; }
.settings-nav { scrollbar-width:none; }
.settings-nav::-webkit-scrollbar { display:none; width:0; height:0; }
.theme-choice-list { display: grid; gap: 11px; margin: 0; padding: 0; border: 0; }
.theme-choice-card { display: flex; align-items: center; gap: 15px; min-height: 82px; padding: 13px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: rgba(255,255,255,.02); cursor: pointer; }
.theme-choice-card:has(input:checked) { border-color: rgba(99,122,255,.65); background: rgba(82,109,255,.08); }
.theme-choice-card input { width: 16px; height: 16px; flex: 0 0 16px; margin: 0; padding: 0; accent-color: #7489ff; }
.theme-choice-card > span:last-child { display: flex; flex-direction: column; gap: 6px; }
.theme-choice-card strong { font-size: 12px; }
.theme-choice-card small { color: #929db2; font-size: 10px; }
.theme-preview { display: flex; width: 76px; height: 48px; gap: 4px; padding: 5px; border: 1px solid rgba(255,255,255,.14); border-radius: 7px; }
.theme-preview i { display: block; height: 100%; border-radius: 3px; }
.theme-preview i:first-child { width: 18%; }.theme-preview i:nth-child(2) { width: 27%; }.theme-preview i:last-child { flex: 1; }
.theme-preview-dark { background: #101726; }.theme-preview-dark i { background: #252e42; }.theme-preview-dark i:last-child { background: #303b59; }
.theme-preview-black { background: #000; }.theme-preview-black i { background: #151515; }.theme-preview-black i:last-child { background: #242424; }
.theme-preview-light { background: #f2f4f8; }.theme-preview-light i { background: #d9deea; }.theme-preview-light i:last-child { background: #fff; }

:root[data-theme="black"] { --bg:#050505; --panel:#101010; --panel-raised:#191919; --line:rgba(255,255,255,.11); color-scheme:dark; }
:root[data-theme="black"] body { background:#050505; }
:root[data-theme="black"] .welcome-panel,:root[data-theme="black"] .form-panel { background:#090909; }
:root[data-theme="black"] .app-view,:root[data-theme="black"] .app-rail,:root[data-theme="black"] .app-sidebar,:root[data-theme="black"] .settings-nav,:root[data-theme="black"] .voice-dock { background-color:#090909; }
:root[data-theme="black"] .app-content,:root[data-theme="black"] .settings-page { background:#080808; }

:root[data-theme="light"] { color-scheme:light; --bg:#f1f3f8; --panel:#fff; --panel-raised:#f8f9fc; --line:rgba(26,38,65,.14); --text:#202638; --muted:#68738a; }
:root[data-theme="light"] body { background:var(--bg); color:var(--text); }
:root[data-theme="light"] .welcome-panel { background:radial-gradient(ellipse at 18% 14%,rgba(62,97,239,.18),transparent 36%),linear-gradient(145deg,#e3eaff,#f3f6ff 68%,#e9f4f7); }
:root[data-theme="light"] .form-panel,:root[data-theme="light"] .app-sidebar,:root[data-theme="light"] .settings-nav { background:#fff; }
:root[data-theme="light"] .app-view,:root[data-theme="light"] .app-rail,:root[data-theme="light"] .voice-dock { background:#f6f7fb; }
:root[data-theme="light"] .app-content,:root[data-theme="light"] .settings-page { background:#f1f3f8; }
:root[data-theme="light"] .content-header,:root[data-theme="light"] .settings-header { background:rgba(248,249,252,.96); }
:root[data-theme="light"] .welcome-card,:root[data-theme="light"] .voice-mode-card,:root[data-theme="light"] .theme-choice-card,:root[data-theme="light"] .auth-note { background:#fff; border-color:rgba(26,38,65,.12); }
:root[data-theme="light"] .welcome-card h2,:root[data-theme="light"] .settings-body h3,:root[data-theme="light"] .mode-copy strong,:root[data-theme="light"] .setting-row strong,:root[data-theme="light"] .settings-link.active,:root[data-theme="light"] .content-heading h2 { color:#202638; }
:root[data-theme="light"] .welcome-card > p:not(.eyebrow),:root[data-theme="light"] .mode-copy small,:root[data-theme="light"] .settings-intro,:root[data-theme="light"] .setting-row small,:root[data-theme="light"] .settings-note p,:root[data-theme="light"] .voice-status-copy small { color:#65718a; }
:root[data-theme="light"] input,:root[data-theme="light"] .device-field select,:root[data-theme="light"] .keybind-button,:root[data-theme="light"] .keybind-button kbd { background:#fff; color:#202638; border-color:rgba(26,38,65,.18); }
:root[data-theme="light"] .settings-link { color:#556078; }
:root[data-theme="light"] .settings-link:hover,:root[data-theme="light"] .settings-link.active { background:#e8ecf5; }
:root[data-theme="light"] .voice-status-copy strong { color:#283148; }
:root[data-theme="light"] .dock-button { color:#364a9c; }
:root[data-theme="light"] .secondary-button { color:#34405a; background:#fff; border-color:rgba(26,38,65,.17); }
:root[data-theme="light"] .danger-button { color:#a32232; background:rgba(190,38,55,.08); border-color:rgba(164,32,49,.25); }
:root[data-theme="light"] .danger-button:hover:not(:disabled) { background:rgba(190,38,55,.14); }
:root[data-theme="light"] .server-owner-limit { color:#626a78; }
:root[data-theme="light"] .app-toast { background:#fff; color:#202638; border-color:rgba(26,38,65,.18); }
.network-status-banner { display:flex; align-items:flex-start; gap:9px; padding:10px 18px; border-bottom:1px solid color-mix(in srgb,#d99b24 38%,var(--overlay-border)); background:color-mix(in srgb,#d99b24 12%,var(--overlay-bg)); color:var(--overlay-fg); font-size:12px; line-height:1.5; }
.network-status-banner::before { content:"!"; display:grid; width:18px; height:18px; flex:0 0 18px; place-items:center; border-radius:50%; background:#d99b24; color:#17130b; font-size:12px; font-weight:800; }
.network-status-banner[data-state="online"] { border-color:color-mix(in srgb,#36a77a 42%,var(--overlay-border)); background:color-mix(in srgb,#36a77a 12%,var(--overlay-bg)); }
.network-status-banner[data-state="online"]::before { content:"✓"; background:#36a77a; color:#06150f; }
@media (max-width:560px) { .network-status-banner { padding:9px 12px; font-size:11px; } }
.density-heading { margin:26px 0 8px; color:var(--ui-text,#f2f3f5); font-size:15px; }
.density-choice-list { display:grid; gap:7px; margin:0; padding:0; border:0; }
.density-choice-card { min-height:62px; gap:12px; padding:10px 13px; }
.density-choice-card input { width:18px; height:18px; flex-basis:18px; }
.density-choice-card > span:last-child { min-width:0; }
.density-choice-card small { line-height:1.4; }
:root[data-density="compact"] .message-list { gap:8px; padding-block:16px; }
:root[data-density="compact"] .chat-item { min-height:50px; padding-block:5px; }
:root[data-density="compact"] .message-row { gap:8px; }
:root[data-density="spacious"] .message-list { gap:20px; padding-block:30px; }
:root[data-density="spacious"] .chat-item { min-height:68px; padding-block:11px; }
:root[data-density="spacious"] .message-row { gap:13px; }
:root[data-density="spacious"] .message-body { font-size:15px; line-height:1.65; }
:root[data-theme="light"] label { color:#38435c; }
:root[data-theme="light"] .content-heading h2,:root[data-theme="light"] .settings-header h2,:root[data-theme="light"] .sidebar-heading h1 { color:#202638; }
:root[data-theme="light"] .settings-nav .eyebrow,:root[data-theme="light"] .settings-body > .eyebrow { color:#64739b; }
:root[data-theme="light"] .settings-body,:root[data-theme="light"] .settings-nav { color:#283148; }
:root[data-theme="light"] .theme-choice-card strong,:root[data-theme="light"] .device-field,:root[data-theme="light"] .device-level { color:#303b53; }
:root[data-theme="light"] .settings-note > span:last-child { min-width:0; flex:1; color:#50607a; font-size:10px; line-height:1.55; }
:root[data-theme="light"] .settings-note > span:first-child { flex:0 0 17px; }
:root[data-theme="light"] .theme-choice-card small,:root[data-theme="light"] .settings-intro,:root[data-theme="light"] .device-status { color:#68748b; }
:root[data-theme="light"] .mode-tag { color:#465ba9; background:rgba(82,109,255,.1); }
:root[data-theme="light"] .keybind-button span { color:#455bb1; }
:root[data-theme="light"] .device-level output,:root[data-theme="light"] .range-control output { color:#455bb1; }

.server-category-tools { display:flex;align-items:center;justify-content:space-between;gap:8px;margin:7px 8px;padding:7px 8px;border:1px solid var(--ui-line);border-radius:8px;color:var(--text-muted);font-size:10px; }
.server-category-tools button { border:0;background:transparent;color:var(--accent);font:inherit;cursor:pointer; }
.server-channel-category { margin:6px 0; }
.server-channel-category-heading { display:flex;align-items:center;gap:4px;min-width:0;padding:3px 7px 3px 9px; }
.server-channel-category-toggle { display:flex;align-items:center;justify-content:space-between;gap:8px;flex:1;min-width:0;padding:5px 2px;border:0;background:transparent;color:var(--text-muted);text-align:left;cursor:pointer; }
.server-channel-category-toggle strong { overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;font-weight:750;letter-spacing:.06em;text-transform:uppercase; }
.server-channel-category-toggle small { flex-shrink:0;color:var(--text-muted);font-size:10px; }
.server-channel-category-actions { display:flex;align-items:center;gap:2px; }
.server-channel-category-actions button { border:0;background:transparent;color:var(--text-muted);font-size:10px;cursor:pointer; }
.server-channel-category-actions .category-action-button { width:22px;height:22px;padding:0;font-size:14px; }
.server-channel-category-actions button:disabled { opacity:.35;cursor:default; }
.server-channel-category-content { min-width:0; }
.server-channel-ungrouped-heading { padding:7px 9px 3px;color:var(--text-muted);font-size:10px;font-weight:750;letter-spacing:.06em;text-transform:uppercase; }
.channel-category-settings { margin-top:12px; }
.channel-order-row { display:flex;align-items:center;gap:2px;min-width:0;border-radius:11px; }
.channel-order-row .channel-item { min-width:0;flex:1; }
.channel-order-row[draggable="true"] .channel-item { cursor:grab; }
.channel-order-controls { display:flex;flex:0 0 auto;align-items:center;gap:1px;padding-right:4px;opacity:0;transition:opacity .12s ease; }
.channel-order-row:hover .channel-order-controls,.channel-order-row:focus-within .channel-order-controls { opacity:1; }
.channel-order-button { display:grid;width:23px;height:24px;place-items:center;border:0;border-radius:6px;background:transparent;color:var(--ui-muted);font-size:13px;cursor:pointer; }
.channel-order-button:hover { background:var(--ui-hover);color:var(--ui-text); }
.channel-order-button:focus-visible { outline:2px solid var(--ui-accent);outline-offset:1px; }
.channel-order-row.is-dragging { opacity:.45; }
.channel-order-row.is-drop-target { background:color-mix(in srgb,var(--ui-accent) 14%,transparent);outline:1px solid color-mix(in srgb,var(--ui-accent) 48%,transparent); }
@media (prefers-reduced-motion:reduce) { .channel-order-controls { transition:none; } }
@media (hover:none) { .channel-order-controls { opacity:1; } }

/* Product UI refresh: clearer hierarchy, neutral surfaces, and one consistent icon language. */
.app-view {
  --ui-base: #1e1f22;
  --ui-rail: #17181b;
  --ui-sidebar: #232428;
  --ui-main: #313338;
  --ui-raised: #383a40;
  --ui-line: rgba(255,255,255,.075);
  --ui-text: #f2f3f5;
  --ui-muted: #b5bac1;
  --ui-subtle: #b5bac1;
  --ui-accent: #5865f2;
  grid-template-columns: 76px 300px minmax(0,1fr);
  background: var(--ui-main);
}
.app-rail { gap: 10px; padding: 16px 12px; border-color: var(--ui-line); background: var(--ui-rail); }
.rail-home,.rail-button { width: 48px; height: 48px; border-radius: 16px; background: #292a2e; color: #b5bac1; }
.rail-home { margin-bottom: 10px; }
.rail-home.active,.rail-button.active { border-radius: 16px; background: var(--ui-accent); box-shadow: 0 5px 14px rgba(88,101,242,.2); }
.rail-button:hover,.rail-home:hover { border-radius: 14px; background: #3b3d44; color: #fff; }
.rail-home.active:hover,.rail-button.active:hover { background: #6873f5; }
.rail-button .line-icon { width: 22px; height: 22px; }
.server-shortcuts { gap: 9px; }
.server-shortcut { width: 48px; height: 48px; flex-basis: 48px; border: 0; border-radius: 16px; background: #292a2e; color: #dbdee1; }
.server-shortcut:hover,.server-shortcut.active { border-radius: 14px; background: #3b3d44; }
.server-shortcut.active { box-shadow: inset 0 0 0 2px rgba(88,101,242,.72); }
.server-shortcut.active::before { left: -12px; width: 4px; height: 26px; background: #f2f3f5; }
.rail-add-server { color: #23a559; }
.rail-add-server:hover { color: #3ba55c; }
.app-sidebar { padding: 21px 14px 12px; border-color: var(--ui-line); background: var(--ui-sidebar); }
.sidebar-heading { min-height: 46px; margin-bottom: 14px; }
.sidebar-heading .eyebrow { color: #aeb5ff; font-size: 9px; letter-spacing: .14em; }
.sidebar-heading h1 { font-size: 22px; letter-spacing: -.03em; }
.icon-button { width: 38px; height: 38px; border-radius: 12px; background: #383a40; color: #dbdee1; }
.icon-button:hover { background: #45474e; color: #fff; }
.line-icon { display: block; width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; shape-rendering: geometricPrecision; }
.search-box { height: 42px; gap: 10px; border: 1px solid transparent; border-radius: 9px; background: #1e1f22; color: #b5bac1; }
.search-box:focus-within { border-color: rgba(88,101,242,.72); box-shadow: 0 0 0 2px rgba(88,101,242,.13); }
.search-box:focus-within input:focus-visible { outline: 0; }
.search-box > .line-icon { width: 17px; height: 17px; flex: 0 0 17px; }
.search-box input { color: #f2f3f5; font-size: 12px; }
.search-box input::placeholder { color: #949ba4; }
.friend-button { min-height: 42px; margin-top: 10px; border: 0; border-radius: 9px; background: transparent; color: #b5bac1; }
.friend-button:hover { background: rgba(88,101,242,.12); color: #e5e7ff; }
.friend-icon { width: 23px; height: 23px; border-radius: 7px; background: var(--ui-raised); color: #b5bac1; }
.friend-button.active .friend-icon,.friend-button:hover .friend-icon { background: var(--ui-accent); color: #fff; }
.friend-icon .line-icon { width: 17px; height: 17px; stroke-width: 2; }
.sidebar-section-title { margin: 22px 3px 8px; color: #b5bac1; font-size: 10px; letter-spacing: .035em; text-transform: uppercase; }
.section-count { color: #8e9299; }
.server-shortcut-menu { position: fixed; z-index: 30; min-width: 190px; padding: 5px; border: 1px solid var(--ui-line,rgba(255,255,255,.075)); border-radius: 9px; background: var(--ui-sidebar,#232428); box-shadow: 0 12px 32px rgba(0,0,0,.4); }
.server-shortcut-menu-item { display: flex; width: 100%; min-height: 38px; align-items: center; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--ui-text,#f2f3f5); cursor: pointer; font: inherit; font-size: 12px; text-align: left; }
.server-shortcut-menu-item:hover,.server-shortcut-menu-item:focus-visible { outline: 0; background: var(--ui-raised,#383a40); }
.conversation-shortcut-menu { position: fixed; z-index: 40; min-width: 176px; padding: 5px; border: 1px solid var(--ui-line,rgba(255,255,255,.075)); border-radius: 9px; background: var(--ui-sidebar,#232428); box-shadow: 0 12px 32px rgba(0,0,0,.4); }
.conversation-shortcut-menu-item { display: flex; width: 100%; min-height: 38px; align-items: center; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--ui-text,#f2f3f5); cursor: pointer; font: inherit; font-size: 12px; text-align: left; }
.conversation-shortcut-menu-item:hover,.conversation-shortcut-menu-item:focus-visible { outline: 0; background: var(--ui-raised,#383a40); }
.conversation-shortcut-menu-item.danger { color: #ff8997 !important; }
.conversation-shortcut-menu-item.danger:hover,.conversation-shortcut-menu-item.danger:focus-visible { background: rgba(176,52,68,.2); }
.direct-search-result { min-height: 58px; gap: 10px; padding: 9px 11px; }
.search-result-avatar { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 50%; background: linear-gradient(145deg,#5865f2,#7781ff); color: #fff; font-size: 13px; font-weight: 750; }
.search-result-copy { display: flex; min-width: 0; flex: 1 1 auto; flex-direction: column; gap: 3px; }
.friend-result .search-result-copy strong { width: 100%; color: #f2f3f5; font-size: 12px; }
.search-result-copy small { color: #aeb5bd; font-size: 10px; }
.friend-result .search-result-open { width: auto; min-width: 92px; min-height: 36px; flex: 0 0 auto; margin: 0; padding: 0 12px; border-radius: 8px; background: #5865f2; box-shadow: none; font-size: 11px; }
.chat-item { min-height: 58px; gap: 11px; margin: 2px 0; padding: 8px; border-radius: 9px; }
.chat-item:hover { background: #2e3035; }
.chat-item.active { border-color: transparent; background: #3a3c43; }
.chat-item-avatar { width: 40px; height: 40px; flex-basis: 40px; border-radius: 50%; background: #3a3c43; }
.chat-item-copy { gap: 3px; }
.chat-item-copy strong { color: #f2f3f5; font-size: 12px; }
.chat-item-copy small { color: #aeb5bd; font-size: 10px; }
.list-empty { min-height: 160px; gap: 9px; padding: 16px 12px; }
.list-empty-icon { width: 42px; height: 42px; margin-bottom: 2px; border: 0; border-radius: 50%; background: #2b2d31; color: #b5bac1; }
.list-empty-icon .line-icon { width: 20px; height: 20px; }
.list-empty strong { color: #dbdee1; font-size: 12px; }
.list-empty > span:last-child { color: #949ba4; }
.account-card { min-height: 56px; margin-top: auto; padding: 8px; border: 0; border-radius: 9px; background: #1e1f22; }
.account-card:hover { background: #191a1d; }
.account-profile-button { min-height:40px; }
.account-voice-controls { gap:0; }
.account-voice-controls { gap:1px; }
.account-voice-button { width:27px; }
.account-device-button { width:12px; }
.account-voice-button,.account-device-button { width:29px; height:34px; }
.account-device-button { width:13px; }
.account-avatar { width: 38px; height: 38px; flex-basis: 38px; border-radius: 50%; background: linear-gradient(145deg,#5865f2,#7781ff); }
.account-avatar { overflow:hidden; }
.account-avatar img { display:block; width:100%; height:100%; object-fit:cover; border-radius:inherit; }
.account-copy strong { color: #f2f3f5; font-size: 11px; }
.account-copy small { color: #aeb5bd; }
.app-content,.settings-page { background: var(--ui-main); }
.content-header { min-height: 64px; padding-inline: 22px; border-color: var(--ui-line); background: rgba(49,51,56,.86); }
.content-header h2 { font-size: 15px; letter-spacing: -.01em; }
.content-header h2:has(.content-channel-icon) { display: flex; min-width: 0; align-items: center; gap: 8px; }
.content-channel-icon { width: 18px; height: 18px; flex: 0 0 18px; color: #aeb5bd; }
.header-actions { gap: 6px; }
.header-actions .icon-button { width: 36px; height: 36px; border-radius: 10px; background: transparent; color: #b5bac1; }
.header-actions .icon-button:hover { background: #3d3f45; color: #fff; }
.header-actions .line-icon { width: 20px; height: 20px; }
.content-stage { padding: 36px; }
.welcome-card { width: min(100%, 620px); padding: clamp(28px,4vw,44px); border: 1px solid rgba(255,255,255,.055); border-radius: 18px; background: #2b2d31; box-shadow: 0 12px 34px rgba(0,0,0,.12); }
.welcome-mark { width: 48px; height: 48px; margin-bottom: 25px; border: 0; border-radius: 14px; background: #222327; }
.welcome-mark img { width: 40px; height: 40px; flex-basis: 40px; }
.welcome-card .eyebrow { color: #aeb5ff; font-size: 10px; }
.welcome-card h2 { max-width: 510px; font-size: clamp(24px,2.7vw,32px); line-height: 1.16; }
.welcome-card > p:not(.eyebrow) { color: #b5bac1; font-size: 13px; line-height: 1.7; }
.welcome-actions { gap: 8px; margin-top: 22px; }
.welcome-actions .primary-button,.welcome-actions .secondary-button { min-height: 40px; border-radius: 9px; font-size: 11px; }
.welcome-actions .primary-button { background: var(--ui-accent); box-shadow: none; }
.secondary-button { border-color: rgba(255,255,255,.09); background: #383a40; color: #dbdee1; }
.secondary-button:hover { background: #45474e; }
.voice-dock { position: fixed; z-index: 4; right: 0; bottom: 0; left: 376px; min-height: 68px; gap: 10px; padding: 9px 18px; border-color: var(--ui-line); background: #2b2d31; }
.app-content { min-height: 0; padding-bottom: 0; }
.app-view:has(.voice-dock.is-connected:not(.hidden))[data-open-chat="true"] .app-content { padding-bottom: 68px; }
.app-view[data-settings="open"] .voice-dock { display: none; }
.voice-status-dot { background: #6d727a; }
.voice-status-copy strong { color: #f2f3f5; }
.voice-status-copy small { color: #aeb5bd; }
.dock-button { min-height: 36px; border: 0; border-radius: 8px; background: #383a40; color: #dbdee1; font-size: 10px; }
.dock-button:hover { background: #45474e; }
.dock-button#voice-join-button { background: #383a40; color: #dbdee1; }
.dock-button#voice-join-button:hover { background: #45474e; }
.dock-button.is-transmitting { background: rgba(35,165,89,.2); color: #70d99a; }
.voice-dock.is-connected { background: #25272b; }
.settings-header { background: rgba(49,51,56,.96); }
.settings-nav { background: #2b2d31; }
.settings-link { min-height: 42px; border-radius: 8px; font-size: 12px; }
.settings-link > .line-icon { width: 18px; height: 18px; flex: 0 0 19px; color: #949ba4; }
.settings-link:hover { background: #383a40; }
.settings-link.active { background: rgba(88,101,242,.2); color: #e5e7ff; }
.settings-link.active > .line-icon { color: #aeb5ff; }
.attachment-button { border-radius: 50%; background: transparent; color: #b5bac1; }
.attachment-button:hover { background: #383a40; color: #fff; }
.attachment-button .line-icon { width: 21px; height: 21px; }
.app-view button:focus-visible,.app-view a:focus-visible,.app-view input:focus-visible,.app-view textarea:focus-visible { outline-color: #aeb5ff; }
:root[data-theme="black"] .app-view { --ui-base:#111; --ui-rail:#050505; --ui-sidebar:#101010; --ui-main:#171717; --ui-raised:#222; background:#171717; }
:root[data-theme="black"] .app-sidebar,:root[data-theme="black"] .settings-nav { background:#101010; }
:root[data-theme="black"] .app-content,:root[data-theme="black"] .settings-page { background:#171717; }
:root[data-theme="black"] .welcome-card { background:#202020; }
:root[data-theme="light"] .app-view { --ui-rail:#e3e5e8; --ui-sidebar:#f2f3f5; --ui-main:#fff; --ui-text:#232428; --ui-muted:#6d6f78; --ui-subtle:#5c6068; background:#fff; color:#232428; }
:root[data-theme="light"] .app-rail { background:#e3e5e8; }
:root[data-theme="light"] .app-sidebar,:root[data-theme="light"] .settings-nav { background:#f2f3f5; }
:root[data-theme="light"] .app-content,:root[data-theme="light"] .settings-page { background:#fff; }
:root[data-theme="light"] .content-header { background:#fff; border-color:rgba(35,36,40,.1); }
:root[data-theme="light"] .content-header h2,:root[data-theme="light"] .sidebar-heading h1 { color:#232428; }
:root[data-theme="light"] .welcome-card { background:#f2f3f5; border-color:rgba(35,36,40,.09); }
:root[data-theme="light"] .welcome-card h2,:root[data-theme="light"] .list-empty strong { color:#232428; }
:root[data-theme="light"] .welcome-card > p:not(.eyebrow),:root[data-theme="light"] .list-empty > span:last-child { color:#5c6068; }
:root[data-theme="light"] .voice-dock { background:#f2f3f5; border-color:rgba(35,36,40,.1); }
:root[data-theme="light"] .voice-status-copy strong { color:#232428; }
:root[data-theme="light"] .voice-status-copy small { color:#5c6068; }
:root[data-theme="light"] .dock-button { background:#e3e5e8; color:#3f4248; }
:root[data-theme="light"] .search-box { background:#e3e5e8; }
:root[data-theme="light"] .search-box input { color:#232428; }
:root[data-theme="light"] .account-card { background:#e3e5e8; }
:root[data-theme="light"] .friend-button { color:#535b6a; }
:root[data-theme="light"] .friend-button:hover,:root[data-theme="light"] .friend-button.active { background:#e1e6f5; color:#2e3d70; }
:root[data-theme="light"] .friend-icon { background:#e3e5e8; color:#4e586b; }
:root[data-theme="light"] .friend-button.active .friend-icon,:root[data-theme="light"] .friend-button:hover .friend-icon { background:#526dff; color:#fff; }
@media (max-width:900px) { .app-view { grid-template-columns:68px 270px minmax(0,1fr); } }
@media (min-width:681px) and (max-width:900px) {
  .app-update-notice { right:12px; bottom:92px; left:331px; width:auto; max-width:500px; }
}
@media (min-width:681px) and (max-width:740px) {
  .app-update-copy > span:not(.app-update-status) { display:none; }
}
@media (min-width:561px) and (max-width:680px) {
  .app-update-notice { right:12px; bottom:92px; left:76px; width:auto; align-items:center; gap:8px; padding:8px 10px; }
  .app-update-copy { min-width:0; gap:0; font-size:10px; }
  .app-update-copy strong { overflow:hidden; font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
  .app-update-copy > span:not(.app-update-status) { display:none; }
  .app-update-actions { gap:5px; }
  .app-update-actions button { min-height:34px; flex:1; padding-inline:8px; font-size:10px; }
}
@media (max-width:680px) {
  .app-view { grid-template-columns:minmax(0,1fr); }
  .app-rail { background:rgba(23,24,27,.97); }
  .rail-home,.rail-button { width:44px; height:44px; }
  .app-sidebar { background:var(--ui-sidebar); }
  .content-header { min-height:58px; padding-inline:14px; }
  .content-stage { padding:18px; }
  .welcome-card { padding:25px 21px; }
  .welcome-mark { margin-bottom:19px; }
  .welcome-actions { display:grid; grid-template-columns:1fr 1fr; }
  .welcome-actions .primary-button { grid-column:1 / -1; }
  .welcome-actions .desktop-download-cta { grid-column:1 / -1; }
  .voice-dock { background:rgba(35,36,40,.97); }
}

.voice-processing-options { display:grid; gap:0; margin:4px 0 10px; border:1px solid var(--line); border-radius:14px; overflow:hidden; }
.setting-toggle { display:flex; min-height:64px; align-items:center; justify-content:space-between; gap:18px; padding:12px 16px; border-bottom:1px solid var(--line); cursor:pointer; }
.setting-toggle:last-child { border-bottom:0; }
.setting-toggle > span { display:grid; gap:4px; }
.setting-toggle strong { font-size:13px; }
.setting-toggle small { color:var(--muted); font-size:11px; line-height:1.5; }
.setting-toggle input { position:absolute; width:1px; height:1px; opacity:0; }
.setting-toggle i { position:relative; width:42px; height:24px; flex:0 0 42px; border-radius:99px; background:rgba(255,255,255,.18); transition:background .16s ease; }
.setting-toggle i::after { position:absolute; top:3px; left:3px; width:18px; height:18px; border-radius:50%; background:#fff; content:""; transition:transform .16s ease; }
.setting-toggle input:checked + i { background:var(--blue); }
.setting-toggle input:checked + i::after { transform:translateX(18px); }
.setting-toggle input:focus-visible + i { outline:2px solid var(--text); outline-offset:3px; }
.voice-processing-options.is-readonly .setting-toggle { opacity:.76; }
:root[data-theme="light"] .setting-toggle small { color:#68748b; }
:root[data-theme="light"] .setting-toggle i { background:rgba(25,35,55,.2); }

/* Additional dark palettes keep Discord-like contrast while changing only the accent and surface hue. */
:root[data-theme="amethyst"] { color-scheme:dark; --blue:#a78bfa; }
:root[data-theme="amethyst"] .app-view { --ui-base:#211d27; --ui-rail:#1a171f; --ui-sidebar:#25212b; --ui-main:#302a37; --ui-raised:#3a3343; --ui-accent:#9b7bed; background:#302a37; }
:root[data-theme="amethyst"] .app-rail { background:#1a171f; }
:root[data-theme="amethyst"] .app-sidebar,:root[data-theme="amethyst"] .settings-nav { background:#25212b; }
:root[data-theme="amethyst"] .app-content,:root[data-theme="amethyst"] .settings-page { background:#302a37; }
:root[data-theme="amethyst"] .content-header,:root[data-theme="amethyst"] .settings-header { background:rgba(37,33,43,.94); }
:root[data-theme="amethyst"] .welcome-card { background:#28232f; border-color:rgba(218,204,255,.09); }
:root[data-theme="amethyst"] .rail-home.active,:root[data-theme="amethyst"] .rail-button.active,:root[data-theme="amethyst"] .friend-icon,:root[data-theme="amethyst"] .welcome-actions .primary-button { background:#7955c7; }
:root[data-theme="amethyst"] .friend-button:hover { background:rgba(167,139,250,.12); color:#e2d7ff; }
:root[data-theme="amethyst"] .friend-button.active { background:rgba(167,139,250,.2); color:#f0eaff; }
:root[data-theme="amethyst"] .friend-button.active .friend-icon,:root[data-theme="amethyst"] .friend-button:hover .friend-icon { background:#7955c7; color:#fff; }
:root[data-theme="amethyst"] .settings-link.active,:root[data-theme="amethyst"] .theme-choice-card:has(input:checked),:root[data-theme="amethyst"] .voice-mode-card:has(input:checked) { background:rgba(167,139,250,.16); border-color:rgba(190,165,255,.48); }
:root[data-theme="amethyst"] .setting-toggle input:checked + i { background:#8d68d8; }
:root[data-theme="amethyst"] .device-level input,:root[data-theme="amethyst"] .range-control input,:root[data-theme="amethyst"] .theme-choice-card input { accent-color:#a78bfa; }
:root[data-theme="amethyst"] .settings-note { background:rgba(167,139,250,.1); }
:root[data-theme="amethyst"] .app-view button:focus-visible,:root[data-theme="amethyst"] .app-view a:focus-visible,:root[data-theme="amethyst"] .app-view input:focus-visible,:root[data-theme="amethyst"] .app-view textarea:focus-visible { outline-color:#d2c1ff; }

:root[data-theme="ocean"] { color-scheme:dark; --blue:#42cbb8; }
:root[data-theme="ocean"] .app-view { --ui-base:#18252b; --ui-rail:#131e23; --ui-sidebar:#1d2a30; --ui-main:#26363c; --ui-raised:#30434a; --ui-accent:#35b6a5; background:#26363c; }
:root[data-theme="ocean"] .app-rail { background:#131e23; }
:root[data-theme="ocean"] .app-sidebar,:root[data-theme="ocean"] .settings-nav { background:#1d2a30; }
:root[data-theme="ocean"] .app-content,:root[data-theme="ocean"] .settings-page { background:#26363c; }
:root[data-theme="ocean"] .content-header,:root[data-theme="ocean"] .settings-header { background:rgba(29,42,48,.95); }
:root[data-theme="ocean"] .welcome-card { background:#202f35; border-color:rgba(190,242,234,.09); }
:root[data-theme="ocean"] .rail-home.active,:root[data-theme="ocean"] .rail-button.active,:root[data-theme="ocean"] .friend-icon,:root[data-theme="ocean"] .welcome-actions .primary-button { background:#168f83; }
:root[data-theme="ocean"] .friend-button:hover { background:rgba(66,203,184,.12); color:#c6f6ee; }
:root[data-theme="ocean"] .friend-button.active { background:rgba(66,203,184,.18); color:#e2fffa; }
:root[data-theme="ocean"] .friend-button.active .friend-icon,:root[data-theme="ocean"] .friend-button:hover .friend-icon { background:#168f83; color:#fff; }
:root[data-theme="ocean"] .settings-link.active,:root[data-theme="ocean"] .theme-choice-card:has(input:checked),:root[data-theme="ocean"] .voice-mode-card:has(input:checked) { background:rgba(66,203,184,.13); border-color:rgba(103,222,205,.46); }
:root[data-theme="ocean"] .setting-toggle input:checked + i { background:#168f83; }
:root[data-theme="ocean"] .device-level input,:root[data-theme="ocean"] .range-control input,:root[data-theme="ocean"] .theme-choice-card input { accent-color:#42cbb8; }
:root[data-theme="ocean"] .settings-note { background:rgba(66,203,184,.09); }
:root[data-theme="ocean"] .app-view button:focus-visible,:root[data-theme="ocean"] .app-view a:focus-visible,:root[data-theme="ocean"] .app-view input:focus-visible,:root[data-theme="ocean"] .app-view textarea:focus-visible { outline-color:#a1f0e4; }
.theme-preview-amethyst { background:#1a171f; }.theme-preview-amethyst i { background:#302a37; }.theme-preview-amethyst i:last-child { background:#7955c7; }
.theme-preview-ocean { background:#131e23; }.theme-preview-ocean i { background:#26363c; }.theme-preview-ocean i:last-child { background:#168f83; }

@media (max-width: 900px) {
  .app-view { grid-template-columns: 62px 255px minmax(0,1fr); }
  .voice-dock { left: 317px; }
  .app-rail { padding-inline: 8px; }
  .app-sidebar { padding-inline: 13px; }
  .settings-layout { grid-template-columns: minmax(220px, 25vw) minmax(0,1fr); }
}
@media (max-width: 680px) {
  .app-view { position: relative; grid-template-columns: 64px minmax(0,1fr); grid-template-rows: minmax(0,1fr); padding-bottom: 0; }
  .app-rail { position: relative; z-index: 5; grid-column: 1; grid-row: 1; height: 100%; min-height: 0; flex-direction: column; justify-content: flex-start; gap: 9px; padding: max(10px,env(safe-area-inset-top)) 7px max(10px,env(safe-area-inset-bottom)); border-top: 0; border-right: 1px solid rgba(255,255,255,.08); background: rgba(10,12,18,.97); backdrop-filter: blur(14px); }
  .rail-home { display: grid; margin: 0; }
  .rail-button { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 14px; }
  .server-shortcuts { display: flex; width: 100%; max-height: none; min-height: 0; flex: 1 1 auto; overflow-x: hidden; overflow-y: auto; }
  .rail-add-server { display: grid; }
  .rail-spacer { display: block; min-height: 8px; flex: 0 0 8px; }
  .app-sidebar { grid-column: 2; grid-row: 1; min-width: 0; min-height: 0; border-right: 0; padding: max(16px, env(safe-area-inset-top)) 12px max(12px,env(safe-area-inset-bottom)); }
  .sidebar-heading { margin-bottom: 13px; }
  .sidebar-heading h1 { font-size: 22px; }
  .sidebar-section-title { margin-top: 20px; }
  .chat-list { min-height: 100px; }
  .list-empty { min-height: 145px; }
  .account-card { margin-top: auto; }
  .app-content { grid-column: 2; grid-row: 1; min-width: 0; min-height: 0; padding-bottom: env(safe-area-inset-bottom); }
  .settings-page { grid-column: 1 / -1; grid-row: 1; min-height: 0; }
  .app-content { display: none; }
  .app-view[data-page="servers"] .app-sidebar { display: flex; }
  .app-view[data-page="servers"] .app-content { display: none; }
  .app-view[data-open-chat="true"] { grid-template-columns: minmax(0,1fr); }
  .app-view[data-open-chat="true"] .app-rail,.app-view[data-open-chat="true"] .app-sidebar { display: none; }
  .app-view[data-open-chat="true"] .app-content { display: flex; grid-column: 1; }
  .app-view[data-open-chat="true"] .app-content { touch-action: pan-y; }
  .app-view:has(.voice-dock.is-connected:not(.hidden))[data-open-chat="true"] .app-content { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .app-view[data-open-chat="true"] .mobile-chat-back[data-back-to-conversations],
  .app-view[data-page="servers"] .mobile-chat-back[data-back-to-messages] { display: grid; }
  .app-view[data-settings="open"] .app-rail,.app-view[data-settings="open"] .app-sidebar,.app-view[data-settings="open"] .app-content { display: none; }
  .settings-page { position: fixed; z-index: 6; inset: 0; overflow: auto; padding-bottom: env(safe-area-inset-bottom); }
  .settings-layout { grid-template-columns: minmax(0,1fr); }
  .settings-nav { display: flex; height: 60px; min-height: 60px; flex: 0 0 60px; align-items: center; gap: 7px; overflow-x: auto; overflow-y: hidden; padding: 8px 14px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.06); }
  .settings-nav .eyebrow { display: none; }
  .settings-link { display: flex; width: auto; min-width: max-content; min-height: 40px; flex: 0 0 auto; margin: 0; padding-inline: 10px; white-space: nowrap; }
  .settings-link small { display: none; }
  .settings-body { padding: 27px 17px; }
  .device-grid { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .device-test-row { display: grid; grid-template-columns: 1fr 1fr; }
  .mic-level { grid-column: 1 / -1; width: 100%; }
  .settings-body h3 { font-size: 21px; }
  .settings-intro { margin-bottom: 18px; }
  .voice-mode-card { min-height: 70px; padding: 12px; }
  .mode-tag { display: none; }
  .setting-row { align-items: flex-start; flex-direction: column; }
  .setting-row .keybind-button { align-self: stretch; justify-content: space-between; }
  .range-control { width: 100%; }
  .range-control input { flex: 1; }
  .settings-header { min-height: 60px; padding-inline: 17px; }
  .settings-header h2 { font-size: 14px; }
  .mobile-context { display: block; margin-bottom: 3px; color: #8390a8; font-size: 9px; font-weight: 500; }
  .app-view[data-page="servers"][data-open-chat="false"] .content-stage { padding: 18px; }
  .welcome-card { padding: 27px 22px; }
  .voice-dock { left: 64px; display: flex; min-height: 56px; gap: 7px; overflow-x: auto; overscroll-behavior-x: contain; padding: 7px 10px max(7px,env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.08); background: rgba(14,17,25,.97); backdrop-filter: blur(12px); scrollbar-color: #5865f2 transparent; scrollbar-width: thin; }
  .voice-dock .voice-status-copy { min-width: 82px; flex: 0 0 min(26vw,100px); }
  .voice-dock .voice-status-copy small { display: none; }
  .voice-dock .dock-button { flex: 0 0 auto; }
  .app-view[data-open-chat="true"] .voice-dock { left: 0; }
  .app-view[data-open-chat="false"]:not([data-voice-connected="true"]) .voice-dock { display: none; }
  .app-view[data-voice-connected="true"][data-settings="closed"] .voice-dock:not(.hidden) { display: flex !important; }
  .app-view[data-voice-connected="true"]:has(.voice-dock.is-connected:not(.hidden))[data-open-chat="false"][data-settings="closed"] .app-sidebar { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .app-view[data-voice-connected="false"] .app-sidebar,
  .app-view[data-settings="open"] .app-sidebar { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .app-view[data-open-chat="true"] .content-header { gap: 8px; padding-inline: 12px; }
  .app-view[data-open-chat="true"] .content-heading { flex: 1 1 auto; gap: 8px; overflow: hidden; }
  .app-view[data-open-chat="true"] .content-heading .mobile-context { display: none; }
  .app-view[data-open-chat="true"] .content-heading h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app-view[data-open-chat="true"] .header-actions { flex: 0 0 auto; gap: 2px; }
  .voice-dock .voice-status-copy { flex: 1; }
  .voice-dock .voice-status-copy strong { font-size: 10px; }
  .voice-dock .voice-status-copy small { font-size: 9px; }
  .voice-dock .dock-button { min-height: 36px; padding-inline: 9px; font-size: 9px; }
  .voice-media-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); max-height: 36vh; padding: 8px 9px 0; }
  .voice-media-tile video { max-height: 36vh; }
  .voice-media-tile.is-screen { grid-column: 1 / -1; }
}

@media (min-width: 681px) and (max-height: 600px) {
  .content-stage { place-items: start center; overflow-y: auto; padding: 18px; }
  .welcome-card { padding: 22px 25px; }
  .welcome-mark { width: 40px; height: 40px; margin-bottom: 14px; }
  .welcome-mark img { width: 36px; height: 36px; }
  .welcome-card h2 { font-size: clamp(22px,2.5vw,28px); }
  .welcome-card > p:not(.eyebrow) { font-size: 12px; line-height: 1.55; }
  .welcome-actions { gap: 7px; margin-top: 14px; }
  .welcome-actions .primary-button,.welcome-actions .secondary-button { min-height: 36px; }
}

/* Compact phone layout, but keep controls and conversation labels comfortably readable. */
@media (max-width: 680px) {
  .app-toast { right: 12px; bottom: calc(72px + var(--app-visual-bottom, 0px)); left: 12px; width: auto; max-width: none; }
  .app-view[data-open-chat="true"] .app-toast { bottom: calc(166px + var(--app-visual-bottom, 0px)); }
  .search-box input { font-size: 16px; }
  .search-results { font-size: 13px; }
  .search-result-action { min-height: 42px; font-size: 13px; }
  .friend-button { font-size: 13px; }
  .sidebar-section-title { font-size: 12px; }
  .chat-item { min-height: 58px; }
  .chat-item-copy strong { font-size: 14px; }
  .chat-item-copy small { font-size: 12px; }
  .list-empty strong { font-size: 13px; }
  .list-empty > span:last-child { font-size: 12px; }
  .account-copy strong { font-size: 12px; }
  .account-copy small { font-size: 11px; }
  .content-header h2 { font-size: 16px; }
  .message-head strong { font-size: 14px; }
  .message-head time { font-size: 11px; }
  .message-body { font-size: 15px; line-height: 1.5; }
  .mobile-context { font-size: 11px; }
  .voice-dock .voice-status-copy strong { font-size: 12px; }
  .voice-dock .dock-button { min-height: 40px; font-size: 11px; }
}

@media (max-width: 390px) {
  .app-rail { padding-inline: 5px; }
  .app-view { grid-template-columns: 58px minmax(0,1fr); }
  .rail-button { width: 44px; height: 44px; flex-basis: 44px; }
  .app-view[data-open-chat="true"] { grid-template-columns: minmax(0,1fr); }
  .voice-dock { left: 58px; }
  .app-view[data-open-chat="true"] .voice-dock { left: 0; }
  .app-sidebar { padding-inline: 10px; }
  .friend-button { min-height: 40px; }
  .welcome-card h2 { font-size: 25px; }
  .welcome-actions { gap: 7px; }
  .welcome-actions .primary-button,.welcome-actions .secondary-button { min-height: 38px; padding-inline: 11px; }
}

/* Settings are a focused modal, with the app context retained behind a dim veil. */
.settings-page {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: clamp(12px, 3.5vh, 38px) clamp(12px, 3vw, 48px);
  background: transparent;
}
.settings-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(0,0,0,.72);
  cursor: default;
}
.settings-window {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1440px, 100%);
  height: min(920px, 100%);
  min-height: 0;
  grid-template-columns: minmax(0,1fr);
  grid-template-rows: 58px minmax(0,1fr);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 16px;
  background: #1c1d22;
  box-shadow: 0 28px 90px rgba(0,0,0,.52);
}
.settings-header {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px 0 24px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: #1c1d22;
}
.settings-header h2 { margin: 0; color: #e5e6e8; font-size: 14px; }
.settings-layout { min-height: 0; grid-template-columns: 268px minmax(0,1fr); }
.settings-nav {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: auto;
  padding: 20px 14px 16px;
  background: #232428;
}
.settings-profile { display:flex; min-width:0; align-items:center; gap:11px; margin:0 2px 18px; padding:0 4px; }
.settings-profile-avatar { display:grid; width:43px; height:43px; flex:0 0 43px; place-items:center; overflow:hidden; border-radius:50%; background:linear-gradient(145deg,#7886ff,#975de8); color:#fff; font-size:17px; font-weight:750; }
.settings-profile-avatar img { display:block; width:100%; height:100%; object-fit:cover; border-radius:inherit; }
.settings-profile-copy { display:grid; min-width:0; gap:4px; }
.settings-profile-copy strong,.settings-profile-copy small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.settings-profile-copy strong { color:#f2f3f5; font-size:12px; }
.settings-profile-copy small { color:#949ba4; font-size:10px; }
.settings-search { display:flex; height:38px; flex:0 0 38px; align-items:center; gap:9px; margin:0 2px 19px; padding:0 10px; border:1px solid rgba(255,255,255,.1); border-radius:8px; background:#17181b; color:#949ba4; }
.settings-search:focus-within { border-color:rgba(88,101,242,.72); box-shadow:0 0 0 2px rgba(88,101,242,.13); }
.settings-search .line-icon { width:16px; height:16px; flex:0 0 16px; }
.settings-search input { width:100%; min-width:0; border:0; outline:0; background:transparent; color:#dbdee1; font:inherit; font-size:11px; }
.settings-search input:focus { border:0; box-shadow:none; outline:0; }
.settings-search input:focus-visible { outline:0; }
.settings-search input::placeholder { color:#8e9299; }
.settings-search-empty { display:flex; min-height:34px; flex:0 0 auto; align-items:center; justify-content:space-between; gap:8px; margin:-10px 2px 12px; padding:5px 8px; border:1px solid rgba(255,255,255,.08); border-radius:7px; background:rgba(255,255,255,.035); color:#aeb5bd; font-size:10px; }
.settings-search-empty .text-button { min-height:26px; flex:0 0 auto; padding:0 6px; font-size:10px; }
.settings-group-label { margin:12px 10px 7px; color:#9da7cc; font-size:9px; font-weight:750; letter-spacing:.12em; }
.settings-link { min-height:38px; flex:0 0 auto; margin:1px 0; border-radius:7px; color:#b5bac1; font-size:11px; }
.settings-link > span:not(.line-icon) { min-width:0; }
.settings-sub-link { min-height:34px; margin:0 0 3px 18px; padding-left:29px; border-left:2px solid rgba(255,255,255,.09); border-radius:0 6px 6px 0; }
.settings-sub-link.active { border-left-color:#aab2ff; }
.settings-link.active { background:rgba(88,101,242,.22); color:#f1f2f5; }
.settings-link.signout-link { margin-top:auto; padding-top:12px; border-top:1px solid rgba(255,255,255,.08); color:#ed777d; }
.settings-link.signout-link > .line-icon { color:#ed777d; }
.settings-content { min-width:0; min-height:0; overflow:auto; background:#1c1d22; scrollbar-color:#4b4d55 #1c1d22; scrollbar-width:thin; }
.settings-body { width:min(100%, 940px); margin:0 auto; padding:clamp(30px,4vw,58px) clamp(28px,6vw,90px); }
.settings-body > .eyebrow { color:#aeb5ff; }
.settings-body h3 { color:#f2f3f5; }
.settings-intro { max-width:680px; }
.setting-row.account-setting-row { min-height:76px; }
@media (max-width: 760px) {
  .settings-page { padding:0; }
  .settings-window { width:100%; height:100%; border:0; border-radius:0; }
  .settings-layout { grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(0,1fr); }
  .settings-nav { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px 7px; overflow:visible; padding:11px 13px; border-right:0; border-bottom:1px solid rgba(255,255,255,.07); }
  .settings-profile { grid-column:1/-1; margin:0 0 5px; }
  .settings-search { grid-column:1/-1; margin:0 0 6px; }
  .settings-group-label { display:none; }
  .settings-link { width:auto; min-width:0; min-height:38px; margin:0; padding-inline:8px; font-size:10px; }
  .settings-sub-link { margin:0; padding-left:8px; border-left:0; }
  .settings-link.signout-link { margin:0; padding-top:0; border-top:0; }
  .settings-content { min-height:0; }
  .settings-body { width:100%; padding:28px 19px; }
}
@media (min-width: 681px) {
  .app-view[data-settings="open"] { grid-template-columns:62px 290px minmax(0,1fr); }
  .app-view[data-settings="open"] .app-rail,.app-view[data-settings="open"] .app-sidebar { display:flex; }
  .app-view[data-settings="open"] .settings-page { grid-column:auto; }
}

@media (max-width: 680px) {
  .app-view:not(.hidden) {
    top: var(--app-visual-top, 0px);
    right: 0;
    bottom: var(--app-visual-bottom, 0px);
    left: 0;
    height: auto;
    min-height: 0;
  }
  .voice-dock { bottom: var(--app-visual-bottom, 0px); }
}

/* The default palette follows the darker, compact contrast of the supplied Discord references. */
:root[data-theme="dark"] .app-view { --ui-base:#111216; --ui-rail:#111216; --ui-sidebar:#191a1f; --ui-main:#1c1d22; --ui-raised:#28292f; background:#1c1d22; }
:root[data-theme="dark"] .app-rail { background:#111216; }
:root[data-theme="dark"] .app-sidebar,:root[data-theme="dark"] .settings-nav { background:#191a1f; }
:root[data-theme="dark"] .app-content,:root[data-theme="dark"] .settings-page { background:#1c1d22; }
:root[data-theme="dark"] .content-header,:root[data-theme="dark"] .settings-header { background:rgba(28,29,34,.96); }
:root[data-theme="dark"] .search-box { background:#111216; }
:root[data-theme="dark"] .chat-item:hover { background:#222329; }
:root[data-theme="dark"] .chat-item.active { background:#2a2b31; }
:root[data-theme="dark"] .welcome-card { background:#222329; border-color:rgba(255,255,255,.07); }
:root[data-theme="dark"] .voice-dock { background:rgba(22,23,28,.97); }
:root[data-theme="dark"] .voice-dock.is-connected { background:rgba(20,27,28,.98); }
:root[data-theme="dark"] .account-card { background:#111216; }
.dock-button { display:inline-flex; align-items:center; justify-content:center; gap:7px; }
.dock-button .line-icon { width:18px; height:18px; flex:0 0 18px; }
.dock-button#voice-leave-button { color:#f28b91; }
.message-composer #send-message-button { display:inline-flex; align-items:center; justify-content:center; gap:7px; }
.message-composer #send-message-button .line-icon { width:17px; height:17px; }
@media (max-width:680px) {
  .message-composer:not([data-has-content="true"]) #send-message-button { display:none; }
  .message-composer #send-message-button { width:40px; height:40px; min-height:40px; flex:0 0 40px; padding:0; border-radius:12px; }
  .message-composer #send-message-button .send-message-label { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
  .voice-dock { min-height:56px; gap:5px; overflow-x:auto; overscroll-behavior-x:contain; padding:6px 8px max(6px,env(safe-area-inset-bottom)); }
  .voice-dock .voice-status-dot { flex:0 0 8px; }
  .voice-dock .voice-status-copy { min-width:0; max-width:110px; flex:0 1 110px; }
  .voice-dock .voice-status-copy strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:10px; }
  .voice-dock .voice-status-copy small { display:none; }
  .voice-dock .dock-button { width:38px; height:38px; min-height:38px; flex:0 0 38px; gap:0; padding:0; border-radius:11px; }
  .voice-dock .dock-button .line-icon { width:19px; height:19px; }
  .voice-dock .dock-label { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
  .app-view[data-voice-connected="true"] .voice-dock .dock-button:not(.hidden) { background:#292a30; }
  .app-view[data-voice-connected="true"] .voice-dock #voice-camera-button:not(.hidden) { background:#292a30; }
  .app-view[data-voice-connected="true"] .voice-dock #voice-leave-button:not(.hidden) { background:rgba(237,66,69,.14); color:#f28b91; }
}
.app-view[data-voice-connected="false"] .voice-dock { display:none !important; }
.voice-channel-item { align-items:center; }
.voice-channel-item .channel-kind-icon { align-self:center; padding-top:0; }
.voice-channel-item .chat-item-copy { gap:5px; }
.voice-channel-members { display:flex; flex-direction:column; gap:5px; margin:4px 0 1px 3px; }
.voice-channel-member { display:flex; min-width:0; align-items:center; gap:7px; color:#b5bac1; }
.voice-member-avatar { display:grid; width:20px; height:20px; flex:0 0 20px; place-items:center; border-radius:50%; background:#313338; color:#dbdee1; font-size:9px; font-weight:700; }
.voice-member-name { min-width:0; flex:1; overflow:hidden; font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.voice-member-state { display:flex; flex:0 0 auto; align-items:center; gap:4px; color:#4cdb82; }
.voice-member-mic,.voice-member-deafened { display:inline-flex; width:14px; height:14px; color:#4cdb82; }
.voice-member-mic svg,.voice-member-deafened svg { display:block; width:14px; height:14px; }
.voice-member-mic.is-muted,.voice-member-deafened.is-muted { color:#ed4245; }
.voice-channel-member.is-speaking .voice-member-avatar { background:rgba(76,219,130,.2); color:#9cf0b5; box-shadow:0 0 0 2px rgba(76,219,130,.34); }
.voice-channel-member.is-speaking .voice-member-name { color:#f2f3f5; }
@media (max-width:680px) {
  .voice-channel-item { align-items:flex-start; }
  .voice-channel-item .channel-kind-icon { width:25px; flex-basis:25px; }
  .voice-channel-member { gap:6px; }
  .voice-member-name { font-size:10px; }
}

/* Settings share the same graphite surfaces as the workspace instead of a second visual theme. */
.settings-page { scrollbar-color: #4a4c52 #232428; scrollbar-width: thin; }
.settings-layout { grid-template-columns: 220px minmax(0,1fr); }
@media (min-width:761px) {
  .settings-nav .settings-link > span:not(.line-icon) {
    display:-webkit-box; overflow:hidden; text-overflow:clip; white-space:normal;
    overflow-wrap:normal; word-break:normal; line-height:1.25;
    -webkit-box-orient:vertical; -webkit-line-clamp:2;
  }
}
.settings-search { width: calc(100% - 4px); min-width: 0; flex: 0 0 38px; }
.settings-link { flex-wrap: nowrap; }
.settings-link > span:not(.line-icon) { display: block; min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-link > .line-icon { flex: 0 0 19px; }
.settings-sub-link { margin-left: 8px; padding-left: 18px; }
.settings-sub-link > span { width: auto; color: inherit; font-size: inherit; text-align: left; }
.settings-link.settings-sub-link > span:first-child { width: auto; flex: 1 1 auto; color: inherit; font-size: inherit; text-align: left; }
.settings-body { justify-self: center; width: min(100%, 920px); padding: 36px clamp(26px,4vw,58px); }
.app-view:not(.hidden) { position: fixed; inset: 0; }
body:has(.app-view:not(.hidden)) { overflow: hidden; }
.settings-body > .eyebrow { color: #aeb5ff; letter-spacing: .13em; }
.settings-body h3 { color: #f2f3f5; font-size: 23px; letter-spacing: -.025em; }
.settings-intro { max-width: 660px; color: #b5bac1; font-size: 12px; }
.settings-subheading { color: #f2f3f5; }
.device-grid { gap: 16px 18px; margin: 20px 0 17px; }
.device-grid > :nth-child(1) { grid-column: 1; grid-row: 1; }
.device-grid > :nth-child(2) { grid-column: 2; grid-row: 1; }
.device-grid > :nth-child(4) { grid-column: 1; grid-row: 2; }
.device-grid > :nth-child(5) { grid-column: 2; grid-row: 2; }
.device-grid > :nth-child(3) { grid-column: 1; grid-row: 3; }
.device-field,.device-level { color: #dbdee1; font-size: 12px; }
.device-field select,.keybind-button { min-height: 44px; border: 1px solid rgba(255,255,255,.1); border-radius: 8px; background: #1e1f22; color: #f2f3f5; }
.device-field select { height: 44px; }
.device-level input,.range-control input { accent-color: #5865f2; }
.device-level input[type="range"] { height: 18px; margin: 0; appearance: none; background: transparent; cursor: pointer; }
.device-level input[type="range"]::-webkit-slider-runnable-track { height: 5px; border-radius: 99px; background: #4a4c52; }
.device-level input[type="range"]::-webkit-slider-thumb { width: 15px; height: 15px; margin-top: -5px; appearance: none; border: 0; border-radius: 50%; background: #7380ff; box-shadow: 0 0 0 3px rgba(88,101,242,.15); }
.device-level input[type="range"]::-moz-range-track { height: 5px; border-radius: 99px; background: #4a4c52; }
.device-level input[type="range"]::-moz-range-thumb { width: 15px; height: 15px; border: 0; border-radius: 50%; background: #7380ff; box-shadow: 0 0 0 3px rgba(88,101,242,.15); }
.device-level output,.range-control output,.keybind-button span { color: #aeb5ff; }
.device-test-row .primary-button,.device-test-row .secondary-button { min-height: 39px; border-radius: 8px; }
.device-test-row .primary-button { background: #5865f2; box-shadow: none; }
.device-test-row .secondary-button { border-color: rgba(255,255,255,.1); background: #383a40; color: #dbdee1; }
.mic-level { height: 7px; background: #1e1f22; }
.device-status { color: #949ba4; font-size: 11px; }
.settings-divider { margin: 25px 0; background: rgba(255,255,255,.09); }
.voice-mode-list { gap: 8px; }
.voice-mode-card { min-height: 70px; padding: 14px 15px; border: 1px solid rgba(255,255,255,.07); border-radius: 9px; background: #2b2d31; }
.voice-mode-card:hover { border-color: rgba(174,181,255,.35); background: #303238; }
.voice-mode-card:has(input:checked) { border-color: rgba(114,125,255,.78); background: rgba(88,101,242,.15); box-shadow: inset 0 0 0 1px rgba(88,101,242,.17); }
.mode-radio { border-color: #858b94; }
.voice-mode-card input:checked + .mode-radio { border-color: #7380ff; }
.voice-mode-card input:checked + .mode-radio::after { background: #7380ff; }
.mode-copy strong { color: #f2f3f5; font-size: 13px; }
.mode-copy small { color: #b5bac1; font-size: 11px; }
.setting-row { border-color: rgba(255,255,255,.08); }
.setting-row strong { color: #f2f3f5; font-size: 12px; }
.setting-row small { color: #aeb5bd; font-size: 11px; }
.keybind-button { padding-inline: 10px; }
.keybind-button kbd { border-color: rgba(255,255,255,.11); border-radius: 6px; background: #383a40; color: #f2f3f5; }
.voice-processing-options { border-color: rgba(255,255,255,.09); border-radius: 10px; }
.setting-toggle { border-color: rgba(255,255,255,.075); }
.setting-toggle strong { color: #f2f3f5; font-size: 12px; }
.setting-toggle small { color: #b5bac1; font-size: 11px; }
.setting-toggle i { background: #4a4c52; }
.setting-toggle input:checked + i { background: #5865f2; }
.settings-note { border-color: rgba(174,181,255,.16); border-radius: 9px; background: rgba(88,101,242,.08); }
.settings-note > span:first-child { background: rgba(88,101,242,.2); color: #c9ccff; }
.settings-note p { color: #c0c4d4; font-size: 11px; }
.theme-choice-card { border-color: rgba(255,255,255,.08); border-radius: 10px; background: #2b2d31; }
.theme-choice-card:has(input:checked) { border-color: rgba(114,125,255,.72); background: rgba(88,101,242,.13); }
.theme-choice-card strong { color: #f2f3f5; font-size: 13px; }
.theme-choice-card small { color: #b5bac1; font-size: 11px; }
.settings-link.signout-link { margin-top: 14px; }
:root[data-theme="light"] .settings-body h3,:root[data-theme="light"] .settings-subheading,:root[data-theme="light"] .mode-copy strong,:root[data-theme="light"] .setting-row strong,:root[data-theme="light"] .setting-toggle strong,:root[data-theme="light"] .theme-choice-card strong { color: #232428; }
:root[data-theme="light"] .settings-intro,:root[data-theme="light"] .mode-copy small,:root[data-theme="light"] .setting-row small,:root[data-theme="light"] .setting-toggle small,:root[data-theme="light"] .theme-choice-card small,:root[data-theme="light"] .device-status,:root[data-theme="light"] .settings-note p { color: #5c6068; }
:root[data-theme="light"] .device-field select,:root[data-theme="light"] .keybind-button,:root[data-theme="light"] .keybind-button kbd { background: #fff; color: #232428; border-color: rgba(35,36,40,.15); }
:root[data-theme="light"] .voice-mode-card,:root[data-theme="light"] .theme-choice-card { background: #f2f3f5; border-color: rgba(35,36,40,.1); }
:root[data-theme="light"] .voice-mode-card:has(input:checked),:root[data-theme="light"] .theme-choice-card:has(input:checked) { background: rgba(88,101,242,.1); border-color: rgba(88,101,242,.48); }
:root[data-theme="light"] .voice-processing-options { border-color: rgba(35,36,40,.12); }
:root[data-theme="light"] .setting-toggle { border-color: rgba(35,36,40,.1); }
:root[data-theme="light"] .settings-note { background: rgba(88,101,242,.07); }
:root[data-theme="light"] .settings-window { border-color: rgba(35,36,40,.12); background: #fff; box-shadow: 0 28px 90px rgba(30,45,80,.2); }
:root[data-theme="light"] .settings-header { border-color: rgba(35,36,40,.1); background: #fff; }
:root[data-theme="light"] .settings-header h2 { color: #232428; }
:root[data-theme="light"] .settings-nav { border-color: rgba(35,36,40,.1); background: #f2f3f5; }
:root[data-theme="light"] .settings-profile-copy strong { color: #202638; }
:root[data-theme="light"] .settings-profile-copy small { color: #5c6068; }
:root[data-theme="light"] .settings-search { border-color: rgba(35,36,40,.15); background: #fff; color: #5c6068; }
:root[data-theme="light"] .settings-search input { color: #232428; }
:root[data-theme="light"] .settings-content { background: #fff; scrollbar-color: #b8becb #f2f3f5; }
:root[data-theme="light"] .settings-note { border-color: rgba(52,78,144,.18); background: #eef2fb; color: #34415e; }
:root[data-theme="light"] .settings-note > span:first-child { background: #dfe7fb; color: #344a7b; }
:root[data-theme="light"] .conversation-dialog { border-color: rgba(35,36,40,.12); background: #fff; color: #232428; box-shadow: 0 25px 90px rgba(30,45,80,.2); }
:root[data-theme="light"] .danger-button { border-color: rgba(164,32,49,.25); background: #fff0f2; color: #8b1c2b; }
:root[data-theme="light"] .danger-button:hover:not(:disabled) { background: #ffe5e9; }
.message-row.is-continuation { margin-top: -11px; }
.message-row.is-continuation .message-avatar { visibility: hidden; }
.message-row.is-continuation .message-head { position: static; height: 0; min-height: 0; }
.message-row.is-continuation .message-head strong,
.message-row.is-continuation .message-head time { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.message-row.is-continuation .message-head time { left: 0; top: 4px; text-align: center; }
.message-row.is-continuation:hover .message-head time,
.message-row.is-continuation:focus-within .message-head time { width: 34px; height: auto; overflow: visible; clip-path: none; color: var(--ui-muted); font-size: 9px; }
.message-row.is-continuation .message-action-toolbar { top: -7px; right: 2px; }
.message-row.is-continuation .message-body,
.message-row.is-continuation .message-attachments { padding-right: 30px; }
.message-date-divider { display: flex; align-items: center; gap: 12px; margin: 5px 0 1px; color: var(--ui-muted); font-size: 10px; font-weight: 700; white-space: nowrap; }
.message-date-divider::before,.message-date-divider::after { height: 1px; flex: 1 1 auto; background: var(--ui-line); content: ''; }
@media (max-width: 680px) {
  .settings-layout { grid-template-columns: minmax(0,1fr); }
  .settings-body { width: 100%; padding: 25px 17px; }
  .device-grid > * { grid-column: auto !important; grid-row: auto !important; }
  .image-preview-dialog { width:calc(100vw - 20px); max-height:calc(100dvh - 20px); padding:12px; }
  .image-preview-stage,.image-preview-stage img { max-height:72dvh; }
}

/* Desktop type scale: keep chat labels readable at full-size windows; phones have their own compact scale below. */
@media (min-width: 681px) {
  .search-box input { font-size: 14px; }
  .sidebar-section-title { font-size: 12px; }
  .section-count { font-size: 11px; }
  .chat-item-copy strong { font-size: 14px; }
  .chat-item-copy small { font-size: 12px; }
  .list-empty strong { font-size: 14px; }
  .list-empty > span:last-child { font-size: 12px; }
  .account-copy strong { font-size: 13px; }
  .account-copy small { font-size: 11px; }
  .content-header h2 { font-size: 17px; }
  .welcome-card > p:not(.eyebrow) { font-size: 15px; }
  .welcome-actions .primary-button,.welcome-actions .secondary-button { font-size: 13px; }
  .voice-status-copy strong { font-size: 13px; }
  .voice-status-copy small { font-size: 11px; }
  .dock-button { font-size: 12px; }
  .message-head strong { font-size: 14px; }
  .message-head time { font-size: 11px; }
  .message-body { font-size: 15px; line-height: 1.55; }
  .message-composer textarea { font-size: 14px; }
  .message-composer .primary-button { font-size: 13px; }
  .settings-link { font-size: 13px; }
  .setting-row strong,.setting-toggle strong { font-size: 13px; }
  .setting-row small,.setting-toggle small { font-size: 12px; }
.dialog-field { font-size: 13px; }
}

/* Give server shortcuts recognizable, deterministic identities without requiring custom artwork. */
.server-shortcut:not(.active) { background: hsl(var(--server-hue, 230) 35% 25%); color: #f4f5f7; font-size: 13px; letter-spacing: .02em; }
.server-shortcut:not(.active):hover { background: hsl(var(--server-hue, 230) 42% 33%); }
.server-shortcut img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.server-profile-avatar { display:grid; width:40px; height:40px; flex:0 0 40px; place-items:center; overflow:hidden; border-radius:12px; color:#fff; font-size:13px; font-weight:800; }
.server-profile-avatar img { width:100%; height:100%; object-fit:cover; }
.server-dialog-tabs,.server-settings-tabs { display:flex; gap:5px; margin:16px 0 8px; padding:4px; border:1px solid var(--line); border-radius:11px; background:var(--panel); }
.server-dialog-tabs [role="tab"],.server-settings-tabs [role="tab"] { flex:1; min-height:36px; padding:0 8px; border:0; border-radius:8px; background:transparent; color:var(--muted); cursor:pointer; font:inherit; font-size:11px; font-weight:650; }
.server-dialog-tabs [role="tab"].active,.server-settings-tabs [role="tab"][aria-selected="true"] { background:var(--panel-raised); color:var(--text); }
.server-discovery-panel { display:grid; gap:12px; margin-top:14px; }
.server-friends-filter { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:12px; }
.server-friends-filter input { width:16px; height:16px; margin:0; }
.server-discovery-results { display:grid; gap:8px; max-height:min(42vh,320px); overflow:auto; }
.server-discovery-result { display:flex; align-items:center; gap:10px; padding:9px; border:1px solid var(--line); border-radius:11px; background:var(--panel); }
.server-discovery-copy { display:grid; flex:1; min-width:0; gap:3px; }
.server-discovery-copy strong { overflow:hidden; color:var(--text); font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.server-discovery-copy small { color:var(--muted); font-size:10px; }
.server-discovery-join { min-height:34px; padding:0 11px; border:0; border-radius:8px; background:var(--blue); color:#fff; cursor:pointer; font:inherit; font-size:11px; font-weight:700; }
.server-discovery-more { width:100%; }
.server-discovery-description { overflow:hidden; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; white-space:normal; }
.server-description-preview { display:block; max-width:250px; margin-top:3px; overflow:hidden; color:var(--text-muted); font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.server-settings-avatar-preview { width:76px; height:76px; border-radius:20px; object-fit:cover; }
.server-avatar-picker { display:inline-flex; width:max-content; align-items:center; justify-content:center; cursor:pointer; }
.server-item .chat-item-avatar { background: hsl(var(--server-hue, 230) 38% 30%); font-size: 13px; letter-spacing: .02em; }

/* The current client requires this roster shell even while it is closed. */
#server-members-toggle { display:none; }
.app-view[data-page="servers"][data-open-chat="true"] #server-members-toggle { display:grid; }
#server-members-toggle[aria-pressed="true"] { background:rgba(82,109,255,.22); color:#e5e7ff; }
.server-members-panel { display:flex; min-width:0; min-height:0; flex-direction:column; overflow:hidden; border-left:1px solid var(--line); background:var(--panel); color:var(--text); }
.server-members-panel-header { display:flex; min-height:58px; flex:0 0 auto; align-items:center; gap:8px; padding:10px 12px; border-bottom:1px solid var(--line); }
.server-members-panel-header > div { display:flex; min-width:0; flex:1; align-items:baseline; gap:7px; }
.server-members-panel-header h3 { overflow:hidden; margin:0; font-size:13px; font-weight:750; text-overflow:ellipsis; white-space:nowrap; }
#server-members-count { flex:0 0 auto; color:var(--muted); font-size:10px; }
.server-members-refresh,.server-members-close { display:grid; min-height:32px; flex:0 0 auto; place-items:center; padding:0 8px; border:0; border-radius:8px; background:transparent; color:var(--muted); cursor:pointer; font:inherit; font-size:10px; }
.server-members-refresh:hover,.server-members-close:hover { background:var(--panel-raised); color:var(--text); }
.server-members-close { display:none; width:32px; padding:0; }
.server-members-search { display:flex; min-height:36px; flex:0 0 auto; align-items:center; gap:8px; margin:12px; padding:0 9px; border:1px solid var(--line); border-radius:8px; background:var(--bg); color:var(--muted); }
.server-members-search .line-icon { width:15px; height:15px; flex:0 0 15px; }
.server-members-search input { width:100%; min-width:0; height:34px; padding:0; border:0; outline:0; background:transparent; color:var(--text); font-size:11px; }
.server-members-list { display:flex; min-height:0; flex:1 1 auto; flex-direction:column; gap:2px; overflow:auto; padding:2px 8px 10px; }
.server-member-row { display:flex; min-width:0; min-height:42px; align-items:center; gap:9px; padding:5px 7px; border-radius:7px; color:var(--text); }
.server-member-avatar { display:grid; width:30px; height:30px; flex:0 0 30px; place-items:center; overflow:hidden; border-radius:50%; background:linear-gradient(145deg,#526dff,#7a84ff); color:#fff; font-size:11px; font-weight:750; }
.server-member-avatar img { display:block; width:100%; height:100%; object-fit:cover; border-radius:inherit; }
.server-member-copy { display:flex; min-width:0; flex:1; flex-direction:column; gap:2px; }
.server-member-copy strong { overflow:hidden; font-size:11px; font-weight:650; text-overflow:ellipsis; white-space:nowrap; }
.server-member-copy small,.server-members-status { color:var(--muted); font-size:10px; }
.server-members-status { min-height:15px; flex:0 0 auto; margin:0; padding:0 12px 9px; }
@media (min-width:1101px) {
  .app-content:has(.server-members-panel:not(.hidden)) { display:grid; grid-template-columns:minmax(0,1fr) 252px; grid-template-rows:auto minmax(0,1fr); overflow:hidden; }
  .app-content:has(.server-members-panel:not(.hidden)) > .content-header { grid-column:1 / -1; grid-row:1; min-width:0; }
  .app-content:has(.server-members-panel:not(.hidden)) > .content-stage { grid-column:1; grid-row:2; min-width:0; min-height:0; overflow:hidden; }
  .app-content:has(.server-members-panel:not(.hidden)) > .server-members-panel { grid-column:2; grid-row:2; width:252px; height:auto; flex:none; }
}
@media (max-width:1100px) {
  .app-content:has(.server-members-panel:not(.hidden)) { position:relative; display:flex; overflow:hidden; }
  .server-members-backdrop:not(.hidden) { position:absolute; z-index:19; inset:64px 0 0; display:block; border:0; background:rgba(0,0,0,.36); cursor:pointer; }
  .server-members-panel { position:absolute; z-index:20; top:64px; right:0; bottom:0; width:min(292px,84vw); border-left:1px solid var(--line); box-shadow:-14px 0 35px rgba(0,0,0,.24); }
  .server-members-close { display:grid; }
}

/* Keep the selected palette visible on the floating voice controls on desktop and phones. */
:root[data-theme="black"] .voice-dock { background:#101010; }
:root[data-theme="amethyst"] .voice-dock { background:rgba(37,33,43,.98); }
:root[data-theme="amethyst"] .voice-dock.is-connected { background:rgba(34,27,45,.99); }
:root[data-theme="ocean"] .voice-dock { background:rgba(29,42,48,.98); }
:root[data-theme="ocean"] .voice-dock.is-connected { background:rgba(23,43,44,.99); }

@media (max-width:680px) {
  :root[data-theme="dark"] .app-rail { background:rgba(17,18,22,.98); }
  :root[data-theme="black"] .app-rail { background:rgba(5,5,5,.98); }
  :root[data-theme="light"] .app-rail { background:rgba(227,229,232,.98); }
  :root[data-theme="amethyst"] .app-rail { background:rgba(26,23,31,.98); }
  :root[data-theme="ocean"] .app-rail { background:rgba(19,30,35,.98); }
  :root[data-theme="dark"] .voice-dock { background:rgba(22,23,28,.98); }
  :root[data-theme="black"] .voice-dock { background:rgba(9,9,9,.98); }
  :root[data-theme="light"] .voice-dock { background:rgba(242,243,245,.98); }
  :root[data-theme="amethyst"] .voice-dock { background:rgba(37,33,43,.98); }
  :root[data-theme="ocean"] .voice-dock { background:rgba(29,42,48,.98); }
  :root[data-theme="dark"] .voice-dock.is-connected { background:rgba(20,27,28,.99); }
  :root[data-theme="black"] .voice-dock.is-connected { background:rgba(8,8,8,.99); }
  :root[data-theme="light"] .voice-dock.is-connected { background:rgba(235,238,243,.99); }
  :root[data-theme="amethyst"] .voice-dock.is-connected { background:rgba(34,27,45,.99); }
  :root[data-theme="ocean"] .voice-dock.is-connected { background:rgba(23,43,44,.99); }
}

@media (min-width: 681px) {
  .app-view[data-voice-connected="true"] .app-toast { top: 22px; right: 22px; bottom: auto; }
}

/* Keep connected voice controls with the account/navigation column on desktop,
   as in Discord, instead of reserving or covering chat-canvas space. */
@media (min-width: 901px) {
  .voice-dock {
    position: fixed; right: auto; bottom: 12px; left: 76px;
    display: grid; width: 300px; min-height: 72px;
    grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: 18px 36px;
    gap: 4px 3px; padding: 8px 12px;
    border: 1px solid var(--ui-line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.2);
  }
  .voice-dock .voice-status-dot { grid-column: 1; grid-row: 1; align-self: center; }
  .voice-dock .voice-status-copy { grid-column: 2 / -1; grid-row: 1; min-width: 0; }
  .voice-dock .voice-status-copy strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
  .voice-dock .voice-status-copy small { display: none; }
  .voice-dock .dock-button { width: 36px; height: 34px; min-height: 34px; justify-self: center; gap: 0; padding: 0; border-radius: 9px; }
  .voice-dock #voice-camera-button { grid-column: 1; grid-row: 2; }
  .voice-dock #voice-screen-button { grid-column: 2; grid-row: 2; }
  .voice-dock #voice-leave-button,.voice-dock #voice-join-button { grid-column: 3; grid-row: 2; }
  .voice-dock [data-settings-open-tab="voice"] { grid-column: 4; grid-row: 2; }
  .voice-dock .dock-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  .app-view[data-voice-connected="true"]:has(.voice-dock.is-connected:not(.hidden))[data-settings="closed"] .app-sidebar { padding-bottom: 98px; }
  .app-view[data-voice-connected="false"] .app-sidebar,
  .app-view[data-settings="open"] .app-sidebar { padding-bottom: 12px; }
  .app-content { padding-bottom: 0; }
}

@media (min-width: 681px) and (max-width: 900px) {
  .voice-dock {
    position: fixed; right: auto; bottom: 12px; left: 62px;
    display: grid; width: 255px; min-height: 72px;
    grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: 18px 36px;
    gap: 4px 2px; padding: 8px 10px;
    border: 1px solid var(--ui-line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.2);
  }
  .voice-dock .voice-status-dot { grid-column: 1; grid-row: 1; align-self: center; }
  .voice-dock .voice-status-copy { grid-column: 2 / -1; grid-row: 1; min-width: 0; }
  .voice-dock .voice-status-copy strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .voice-dock .voice-status-copy small { display: none; }
  .voice-dock .dock-button { width: 34px; height: 32px; min-height: 32px; justify-self: center; gap: 0; padding: 0; border-radius: 9px; }
  .voice-dock #voice-camera-button { grid-column: 1; grid-row: 2; }
  .voice-dock #voice-screen-button { grid-column: 2; grid-row: 2; }
  .voice-dock #voice-leave-button,.voice-dock #voice-join-button { grid-column: 3; grid-row: 2; }
  .voice-dock [data-settings-open-tab="voice"] { grid-column: 4; grid-row: 2; }
  .voice-dock .dock-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  .app-view[data-voice-connected="true"]:has(.voice-dock.is-connected:not(.hidden))[data-settings="closed"] .app-sidebar { padding-bottom: 98px; }
  .app-view[data-voice-connected="false"] .app-sidebar,
  .app-view[data-settings="open"] .app-sidebar { padding-bottom: 12px; }
  .app-content { padding-bottom: 0; }
}

@media (min-width: 681px) and (max-width: 900px) and (max-height: 600px) {
  .app-sidebar { min-height: 0; }
  .chat-list { min-height: 0; }
}

/* Compact, Discord-like navigation rail: one DM home, then round server icons. */
.app-rail {
  gap: 8px;
  padding: 14px 12px;
  background: var(--ui-rail, #1e1f22);
}
.rail-home,
.rail-button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #313338;
  box-shadow: none;
}
.rail-home {
  position: relative;
  margin: 0 0 12px;
  border-radius: 16px;
}
.rail-home::after {
  position: absolute;
  right: 8px;
  bottom: -11px;
  left: 8px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255,255,255,.09);
  content: '';
}
.rail-home.active,
.rail-button.active {
  border-radius: 16px;
  background: #5865f2;
  box-shadow: none;
}
.rail-home.active,
.rail-button.active { position: relative; }
.server-shortcuts { gap: 8px; }
.server-shortcut {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
  border-radius: 50%;
  border-color: transparent;
  background: hsl(var(--server-hue, 230) 35% 25%);
  transition: border-radius .16s, background .16s, color .16s;
}
.server-shortcut:hover,
.server-shortcut.active {
  border-radius: 16px;
  background: hsl(var(--server-hue, 230) 42% 33%);
}
.server-shortcut.active::before { left: -13px; }
.rail-add-server {
  border: 0;
  background: #313338;
  color: #23a55a;
}
.rail-add-server:hover {
  border-radius: 16px;
  background: #23a55a;
  color: #fff;
}

@media (max-width: 680px) {
  .app-rail { padding: max(10px,env(safe-area-inset-top)) 7px max(10px,env(safe-area-inset-bottom)); }
}
@media (max-width: 390px) {
  .app-rail { padding-inline: 5px; }
  .rail-home,
  .rail-button { width: 44px; height: 44px; }
  .server-shortcut { width: 44px; height: 44px; flex-basis: 44px; }
}

/* Shared icon geometry: normalize drawing, stroke, and button centering across the client. */
.line-icon {
  display: block;
  flex: 0 0 auto;
  overflow: visible;
  shape-rendering: geometricPrecision;
}
.line-icon use { vector-effect: non-scaling-stroke; }
.rail-home,.rail-button,.icon-button,.account-voice-button,.attachment-button,.mobile-chat-back {
  line-height: 0;
}
.rail-home,.rail-button,.icon-button,.account-voice-button,.attachment-button,.mobile-chat-back {
  display: inline-grid;
  place-items: center;
}
.voice-quick-settings { display: flex; align-items: center; gap: 8px; }
.voice-quick-settings .line-icon { width: 16px; height: 16px; flex: 0 0 16px; }
.secure-icon .line-icon { width: 14px; height: 14px; flex: 0 0 14px; }
.account-device-button .line-icon { width: 12px; height: 12px; flex: 0 0 12px; }
.welcome-actions .primary-button,.friends-page-add-button,.friends-directory-add { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.welcome-actions .primary-button .line-icon,.friends-page-add-button .line-icon,.friends-directory-add .line-icon { width: 16px; height: 16px; flex: 0 0 16px; }
.voice-channel-item { align-items: center; }
.voice-channel-item .channel-kind-icon { align-self: center; padding-top: 0; }

/* Keep setting labels legible at tablet widths; avoid the narrow two-column word wrapping. */
@media (max-width:760px) {
  .settings-layout { grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(0,1fr); }
  .settings-nav { display:grid; height:auto; min-height:0; flex:initial; grid-template-columns:minmax(0,1fr); gap:3px; overflow:visible; }
  .settings-profile,.settings-search { grid-column:1; }
  .settings-link { width:100%; justify-content:flex-start; min-height:40px; font-size:11px; }
  .settings-link > span:not(.line-icon) { white-space:nowrap; }
  .settings-header .mobile-context { display:none; }
}

/* On phones the channel list is replaced by the channel view. Fade its speaker
   glyph in at its fixed header size so selecting a voice channel feels steady. */
@keyframes mobile-voice-channel-icon-enter { from { opacity: 0; } to { opacity: 1; } }
@media (max-width:680px) and (prefers-reduced-motion: no-preference) {
  .app-view[data-page="servers"][data-open-chat="true"][data-voice-channel-selected="true"] .content-channel-icon {
    animation: mobile-voice-channel-icon-enter 120ms ease-out both;
  }
}

/* Selecting a voice room must not leave the old disconnected voice-panel slot
   under the account row. The dock is only shown for an active connection. */
@media (max-width:680px) {
  .voice-dock { right:auto; width:calc(100% - 64px); }
  .app-view[data-open-chat="true"] .voice-dock { left:0; width:100%; }
  .app-view[data-open-chat="false"] .app-content { padding-bottom:0; }
  .app-view[data-voice-connected="true"]:has(.voice-dock.is-connected:not(.hidden))[data-open-chat="false"][data-settings="closed"] .app-sidebar {
    padding-bottom:calc(72px + env(safe-area-inset-bottom));
  }
}
@media (max-width:390px) {
  .voice-dock { left:58px; width:calc(100% - 58px); }
  .app-view[data-open-chat="true"] .voice-dock { left:0; width:100%; }
}

/* Server member roster: a real, searchable right column on desktop and a
   drawer on narrower screens so the conversation never gets crushed. */
#server-members-toggle { display:none; }
.app-view[data-page="servers"][data-open-chat="true"] #server-members-toggle { display:grid; }
#server-members-toggle[aria-pressed="true"] { background:rgba(88,101,242,.22); color:#e5e7ff; }
.server-members-panel { display:flex; min-width:0; min-height:0; flex-direction:column; overflow:hidden; border-left:1px solid var(--ui-line,rgba(255,255,255,.08)); background:var(--ui-sidebar,#191a1f); color:var(--ui-text,#f2f3f5); }
.server-members-panel-header { display:flex; min-height:58px; flex:0 0 auto; align-items:center; gap:8px; padding:10px 12px; border-bottom:1px solid var(--ui-line,rgba(255,255,255,.07)); }
.server-members-panel-header > div { display:flex; min-width:0; flex:1; align-items:baseline; gap:7px; }
.server-members-panel-header h3 { overflow:hidden; margin:0; font-size:13px; font-weight:750; text-overflow:ellipsis; white-space:nowrap; }
#server-members-count { flex:0 0 auto; color:var(--ui-muted,#949ba4); font-size:10px; font-variant-numeric:tabular-nums; }
.server-members-refresh,.server-members-close { display:grid; min-height:32px; flex:0 0 auto; place-items:center; padding:0 8px; border:0; border-radius:8px; background:transparent; color:var(--ui-muted,#b5bac1); cursor:pointer; font:inherit; font-size:10px; }
.server-members-refresh:hover,.server-members-close:hover { background:var(--ui-raised,#2b2d31); color:var(--ui-text,#f2f3f5); }
.server-members-close { display:none; width:32px; padding:0; }
.server-members-close .line-icon { width:17px; height:17px; }
.server-members-search { display:flex; min-height:36px; flex:0 0 auto; align-items:center; gap:8px; margin:12px 12px 8px; padding:0 9px; border:1px solid var(--ui-line,rgba(255,255,255,.08)); border-radius:8px; background:var(--ui-base,#111216); color:var(--ui-muted,#b5bac1); }
.server-members-search .line-icon { width:15px; height:15px; flex:0 0 15px; }
.server-members-search input { width:100%; min-width:0; border:0; outline:0; background:transparent; color:var(--ui-text,#f2f3f5); font:inherit; font-size:11px; }
.server-members-search input::placeholder { color:var(--ui-muted,#949ba4); }
.server-members-list { display:flex; min-height:0; flex:1 1 auto; flex-direction:column; gap:2px; overflow:auto; padding:2px 8px 10px; overscroll-behavior:contain; }
.server-member-row { display:flex; min-width:0; min-height:42px; align-items:center; gap:9px; padding:5px 7px; border-radius:7px; color:var(--ui-text,#f2f3f5); }
.server-member-row:hover { background:color-mix(in srgb,var(--ui-text,#f2f3f5) 6%,transparent); }
.server-member-avatar { display:grid; width:30px; height:30px; flex:0 0 30px; place-items:center; overflow:hidden; border-radius:50%; background:linear-gradient(145deg,#5865f2,#7a84ff); color:#fff; font-size:11px; font-weight:750; }
.server-member-avatar img { display:block; width:100%; height:100%; object-fit:cover; border-radius:inherit; }
.server-member-copy { display:flex; min-width:0; flex:1; flex-direction:column; gap:2px; }
.server-member-copy strong { overflow:hidden; font-size:11px; font-weight:650; text-overflow:ellipsis; white-space:nowrap; }
.server-member-copy small { color:var(--ui-muted,#949ba4); font-size:9px; }
.server-members-status { min-height:15px; flex:0 0 auto; margin:0; padding:0 12px 9px; color:var(--ui-muted,#949ba4); font-size:10px; line-height:1.4; }
@media (min-width:1101px) {
  .app-content:has(.server-members-panel:not(.hidden)) { display:grid; grid-template-columns:minmax(0,1fr) 252px; grid-template-rows:auto minmax(0,1fr); overflow:hidden; }
  .app-content:has(.server-members-panel:not(.hidden)) > .content-header { grid-column:1 / -1; grid-row:1; min-width:0; }
  .app-content:has(.server-members-panel:not(.hidden)) > .content-stage { grid-column:1; grid-row:2; min-width:0; min-height:0; overflow:hidden; }
  .app-content:has(.server-members-panel:not(.hidden)) > .server-members-panel { grid-column:2; grid-row:2; width:252px; height:auto; flex:none; }
}
@media (max-width:1100px) {
  .app-content:has(.server-members-panel:not(.hidden)) { position:relative; display:flex; overflow:hidden; }
  .server-members-backdrop:not(.hidden) { position:absolute; z-index:19; inset:64px 0 0; display:block; border:0; background:rgba(0,0,0,.36); cursor:pointer; }
  .server-members-panel { position:absolute; z-index:20; top:64px; right:0; bottom:0; width:min(292px,84vw); border-left:1px solid var(--ui-line,rgba(255,255,255,.1)); box-shadow:-14px 0 35px rgba(0,0,0,.24); }
  .server-members-close { display:grid; }
}
@media (max-width:680px) {
  .content-header:has(#server-members-toggle[aria-pressed="true"]) { position:relative; z-index:21; }
  .server-members-panel-header { min-height:54px; }
  .server-members-list { padding-inline:7px; }
}

.sidebar-heading #message-search-open { flex:0 0 40px; }
.message-search-dialog { width:min(660px,calc(100vw - 32px)); max-height:min(80dvh,760px); }
.message-search-form { display:grid; gap:7px; }
.message-search-form > label { margin:0; color:var(--ui-text); font-size:12px; }
.message-search-filters { padding:8px 10px; border:1px solid var(--ui-line); border-radius:9px; color:var(--ui-muted); font-size:11px; }
.message-search-filters summary { cursor:pointer; color:var(--ui-text); font-weight:700; }
.message-search-filter-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; margin-top:10px; }
.message-search-filter-grid > label { display:grid; min-width:0; gap:4px; margin:0; color:var(--ui-muted); font-size:10px; }
.message-search-filter-grid input:not([type="checkbox"]) { min-width:0; height:38px; padding-inline:9px; }
.message-search-filter-grid input[type="checkbox"] { width:18px; height:18px; margin:0; accent-color:var(--ui-accent); }
.message-search-filter-grid .message-search-attachments { display:flex; align-items:center; gap:8px; grid-column:1/-1; }
.message-search-controls { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:9px; align-items:center; }
.message-search-controls input { min-width:0; }
.message-search-controls .primary-button { min-height:42px; margin:0; padding-inline:18px; }
#message-search-results { max-height:min(52dvh,480px); margin-top:12px; overflow:auto; }
#message-search-results:empty { display:none; }
#message-search-dialog .dialog-form { gap:12px; }
@media (max-width:430px) {
  .message-search-filter-grid { grid-template-columns:minmax(0,1fr); }
  .message-search-controls { grid-template-columns:minmax(0,1fr); }
}

@media (max-width:680px) {
  .message-action-menu { max-height:min(42dvh,320px); }
  .message-reaction-picker { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); justify-content:stretch; }
  .emoji-picker { max-height:min(38dvh,290px); }
}

.public-profile-form { display:grid; gap:10px; max-width:620px; margin-top:24px; padding-top:20px; border-top:1px solid var(--ui-line,rgba(255,255,255,.08)); }
.public-profile-form .settings-intro { margin:0; }

.message-thread-dialog { width:min(560px,calc(100vw - 28px)); }
.message-thread-root { display:grid; gap:6px; }
.message-thread-root strong,.message-thread-reply strong { color:var(--ui-text,#eef1f8); font-size:12px; }
.message-thread-root p,.message-thread-reply p { margin:0; color:var(--ui-text,#eef1f8); font-size:12px; line-height:1.5; white-space:pre-wrap; overflow-wrap:anywhere; }
.message-thread-replies { display:grid; gap:8px; max-height:min(42dvh,360px); margin:12px 0; overflow:auto; overscroll-behavior:contain; }
.message-thread-reply { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px 8px; min-width:0; padding:10px 12px; border:1px solid var(--ui-line,rgba(255,255,255,.08)); border-radius:9px; background:rgba(255,255,255,.025); }
.message-thread-reply time { color:var(--ui-muted,#8f99ad); font-size:10px; }
.message-thread-reply p { grid-column:1/-1; }
.mention-notification { width:100%; font:inherit; cursor:pointer; }
#message-mentions-open[data-has-unread="true"] { color:var(--ui-accent); background:var(--ui-raised); }
.notification-center-trigger { position:relative; }
.notification-center-count { position:absolute; top:-3px; right:-3px; min-width:16px; height:16px; padding:0 4px; display:grid; place-items:center; border:2px solid var(--ui-sidebar); border-radius:999px; background:#ed4245; color:#fff; font-size:9px; line-height:1; font-weight:800; }
.notification-center-toolbar { display:flex; justify-content:flex-end; gap:8px; flex-wrap:wrap; }
.notification-center-toolbar .secondary-button { min-height:32px; padding:6px 10px; font-size:11px; }
.notification-center-content > .settings-intro { margin:0; }
#notification-unread-toggle[aria-pressed="true"] { border-color:var(--ui-accent); color:var(--ui-text); }
