:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #ecedf0;
  background: #17181c;
  font-synthesis: none;
  --bg: #23252b;
  --panel: #1b1d22;
  --surface: #2d3038;
  --line: #363943;
  --muted: #a6aab5;
  --accent: #79a1ff;
  --green: #53d69a;
  --red: #ff7c85;
  --yellow: #f1c46c;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  color: inherit;
  cursor: pointer;
  border: 0;
  background: transparent;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button:not(:disabled):hover {
  filter: brightness(1.12);
}
button,
input,
select,
textarea {
  border-radius: 6px;
}
input,
select {
  background: #17191e;
  border: 1px solid #464a57;
  color: #ecedf0;
  padding: 12px 14px;
  min-width: 0;
  width: 100%;
  caret-color: #a8bdff;
}
input::placeholder {
  color: #989da9;
}
textarea::placeholder { color: #989da9; }
textarea:focus-visible { outline: 2px solid #b4caff; outline-offset: 3px; }
input[type="range"] {
  accent-color: #8aaaff;
  cursor: pointer;
  padding: 0;
  border: 0;
  background: transparent;
  width: 100%;
  min-height: 28px;
}
input[type="checkbox"] {
  accent-color: #8aaaff;
  width: 17px;
  height: 17px;
  margin: 0;
}
label {
  font-size: 13px;
  color: #d1d4dc;
}
svg {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}
[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.primary,
.secondary,
.text-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  min-height: 42px;
  padding: 10px 16px;
}
.primary {
  background: #728fe8;
  color: #101a35;
}
.secondary {
  background: #353942;
}
.text-button {
  color: #b6c8ff;
  padding: 8px;
}
.danger-button {
  background: #482e35;
  color: #ff9ca2;
}
.wide {
  width: 100%;
}
.icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 7px;
  color: #b8bdca;
}
.icon-button:hover,
.dock-button:hover {
  background: #343740;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
.file-label:focus-within {
  outline: 2px solid #b4caff;
  outline-offset: 3px;
}
::selection {
  background: #4c629d;
  color: #fff;
}
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-thumb {
  background: #515561;
  border-radius: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 18px;
  font-weight: 650;
}
h2 {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
h3 {
  font-size: 15px;
  font-weight: 600;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 850;
  font-size: 29px;
  letter-spacing: -0.04em;
  color: #fff;
}
.brand-dot {
  width: 7px;
  height: 7px;
  background: #75a3ff;
  border-radius: 50%;
  align-self: flex-end;
  margin-bottom: 8px;
}
.auth-screen {
  min-height: 100dvh;
  max-width: 1100px;
  margin: auto;
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 90px;
  align-items: center;
  padding: 70px 50px;
}
.auth-brand .wordmark {
  font-size: 72px;
}
.auth-brand .brand-dot {
  width: 12px;
  height: 12px;
  margin-bottom: 16px;
}
.auth-brand > p {
  color: #b0b5c2;
  font-size: 20px;
  margin-top: 20px;
}
.auth-art {
  height: 150px;
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 65px;
}
.auth-art span {
  display: block;
  width: 14px;
  background: #6279b9;
  border-radius: 7px;
  height: 30px;
}
.auth-art span:nth-child(2),
.auth-art span:nth-child(8) {
  height: 55px;
}
.auth-art span:nth-child(3),
.auth-art span:nth-child(7) {
  height: 95px;
}
.auth-art span:nth-child(4),
.auth-art span:nth-child(6) {
  height: 68px;
  background: #96b5ff;
}
.auth-art span:nth-child(5) {
  height: 130px;
  background: #96b5ff;
}
.auth-panel {
  background: #24262d;
  padding: 36px;
  border-radius: 14px;
}
.auth-panel h1 {
  font-size: 26px;
}
.auth-panel > p {
  color: var(--muted);
  font-size: 14px;
  margin-top: 10px;
}
.auth-tabs,
.settings-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  margin: 26px 0 24px;
  gap: 26px;
}
.auth-tabs button,
.settings-tabs button {
  position: relative;
  font-size: 14px;
  padding: 0 0 14px;
  min-height: 38px;
  color: var(--muted);
  border-radius: 0;
}
.auth-tabs button[aria-selected="true"],
.settings-tabs button[aria-selected="true"] {
  color: #c1d0ff;
}
.auth-tabs button[aria-selected="true"]:after,
.settings-tabs button[aria-selected="true"]:after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #9db8ff;
}
form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
form > label:not(:first-child) {
  margin-top: 12px;
}
.form-error {
  color: #ff9da4;
  font-size: 13px;
  line-height: 1.6;
}
.form-error:empty {
  display: none;
}
.auth-panel .primary {
  margin-top: 12px;
}
.auth-panel > .auth-foot {
  font-size: 12px;
  text-align: center;
  margin-top: 22px;
  color: #b0b5c0;
}
.app {
  height: 100dvh;
  display: grid;
  grid-template-columns: 252px 1fr;
  grid-template-rows: minmax(0, 1fr) 78px;
}
.sidebar {
  background: #1b1d22;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid #30333b;
}
.side-brand {
  height: 80px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-home {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 10px 14px 18px;
  padding: 13px;
  background: #30394e;
  color: #d6e1ff;
  font-size: 14px;
  text-align: left;
}
.side-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 24px;
  color: #a6acb9;
  font-size: 12px;
}
.side-rooms {
  padding: 5px 12px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.side-room {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 11px 12px;
  gap: 10px;
  min-height: 44px;
  color: #aeb4c2;
  text-align: left;
  margin-bottom: 4px;
}
.side-room:hover {
  background: #282b33;
}
.side-room.active {
  background: #373d50;
  color: #ebeeff;
}
.side-room > span.name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  flex: 1;
}
.side-room small {
  font-size: 11px;
  color: #aeb4c2;
}
.side-room svg {
  width: 18px;
  height: 18px;
}
.side-empty {
  font-size: 12px;
  color: #9299a8;
  padding: 14px 12px;
  line-height: 1.7;
}
.side-bottom {
  display: flex;
  align-items: center;
  padding: 14px 12px;
  background: #17191e;
  gap: 4px;
}
.user-profile {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 1;
  min-width: 0;
  text-align: left;
}
.user-profile > span:last-child {
  min-width: 0;
}
.user-profile strong {
  font-size: 13px;
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 133px;
}
.user-profile small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
  max-width: 133px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.workspace {
  position: relative;
  min-width: 0;
  overflow-y: auto;
  background: radial-gradient(ellipse at 20% 0%, #2b3141 0, #25272e 52%);
}
.topbar {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 22px 32px;
  border-bottom: 1px solid #363942;
  min-height: 84px;
  position: sticky;
  top: 0;
  background: #25272e;
  z-index: 2;
}
.channel-icon {
  color: #a6adbe;
}
.topbar > div {
  min-width: 0;
}
.topbar h1 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50vw;
}
.topbar > div > span {
  font-size: 11px;
  color: #aeb4c0;
  display: block;
  margin-top: 5px;
}
.topbar > .text-button {
  margin-left: auto;
  font-size: 12px;
  white-space: nowrap;
}
.topbar .text-button svg {
  width: 15px;
  height: 15px;
}
.lobby {
  padding: 42px 40px;
  max-width: 1250px;
  margin: auto;
}
.lobby-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.lobby-heading p {
  font-size: 14px;
  color: var(--muted);
  margin-top: 12px;
}
.join-code-form {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  max-width: 520px;
  margin: 32px 0 44px;
  background: #1e2026;
  border: 1px solid #414550;
  padding: 5px 8px 5px 15px;
  border-radius: 8px;
  color: #969eae;
}
.join-code-form > input {
  background: transparent;
  border: 0;
  padding: 9px 0;
  letter-spacing: 0.03em;
  font-size: 14px;
}
.join-code-form > button {
  font-size: 12px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 9px;
  color: #c6d5ff;
}
.join-code-form svg {
  width: 18px;
  height: 18px;
}
.room-table-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.room-table-title h3 {
  font-size: 14px;
}
.room-table-title button {
  font-size: 12px;
}
.room-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 84px;
  padding: 16px 4px;
  border-top: 1px solid #3a3e48;
}
.room-row .room-symbol {
  width: 44px;
  height: 44px;
  background: #343c53;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #bdcdff;
}
.room-row .room-text {
  flex: 1;
  min-width: 0;
}
.room-text strong {
  display: block;
  font-size: 15px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.room-text small {
  display: block;
  font-size: 12px;
  color: #a9b0bf;
  margin-top: 7px;
}
.room-row .online {
  font-size: 12px;
  min-width: 68px;
  color: #abb2c0;
}
.room-row > button {
  min-width: 70px;
}
.empty-state {
  text-align: center;
  padding: 70px 20px;
  color: #adb5c7;
}
.empty-state > [data-icon] {
  color: #7d91c5;
  background: #2d3446;
  padding: 20px;
  border-radius: 50%;
  margin-bottom: 24px;
}
.empty-state > [data-icon] svg {
  width: 36px;
  height: 36px;
}
.empty-state h3 {
  color: #dbe0ec;
  font-size: 18px;
}
.empty-state p {
  margin: 10px 0 18px;
  font-size: 13px;
}
.voice-room {
  padding: 30px 34px;
}
.room-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #aeb5c3;
  font-size: 12px;
  gap: 10px;
}
.room-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.room-meta svg {
  width: 16px;
  height: 16px;
}
.room-warning {
  padding: 12px 16px;
  background: #46343a;
  color: #ffb4ba;
  margin-top: 20px;
  font-size: 13px;
  border-radius: 6px;
  line-height: 1.7;
}
.room-warning.pending {
  background: #303b55;
  color: #c4d3ff;
}
.members {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 22px 14px;
  padding: 34px 0;
}
.member {
  border-radius: 10px;
  text-align: center;
  padding: 18px 8px;
  position: relative;
  min-height: 164px;
  min-width: 0;
}
.member:hover {
  background: #2c2f38;
}
.member.selected {
  background: #303649;
}
.member .avatar {
  margin: auto;
  width: 76px;
  height: 76px;
  font-size: 26px;
}
.member .avatar-ring {
  position: relative;
  display: inline-block;
  border-radius: 50%;
  padding: 4px;
  border: 2px solid transparent;
}
.member.speaking .avatar-ring {
  border-color: #53d69a;
}
.member .mic-state {
  position: absolute;
  right: 0;
  bottom: 2px;
  background: #1d2027;
  border-radius: 50%;
  padding: 5px;
  color: #aeb4c0;
}
.member .mic-state svg {
  width: 14px;
  height: 14px;
}
.member.mic-off .mic-state {
  color: #ff858e;
}
.member .member-name {
  display: block;
  font-size: 13px;
  margin-top: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.member .member-info {
  font-size: 11px;
  color: #aeb6c4;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  overflow: hidden;
  white-space: nowrap;
}
.member-info svg {
  width: 12px;
  height: 12px;
  color: #d2b77e;
}
.member.server-muted .avatar {
  filter: saturate(0.5);
}
.avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  background: #586f91;
  color: #fff;
  font-weight: 650;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  font-size: 16px;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.avatar.small {
  width: 36px;
  height: 36px;
  font-size: 14px;
}
.avatar.large {
  width: 80px;
  height: 80px;
  font-size: 28px;
}
.tone-0 {
  background: #655779;
}
.tone-1 {
  background: #466b78;
}
.tone-2 {
  background: #81634d;
}
.tone-3 {
  background: #6d657e;
}
.tone-4 {
  background: #506e66;
}
.tone-5 {
  background: #6c608c;
}
.dock {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  gap: 22px;
  position: relative;
  z-index: 5;
  padding: 10px 24px;
  background: #17191f;
  border-top: 1px solid #363a45;
}
.dock-voice {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
  max-width: 280px;
}
.voice-symbol {
  color: #9199a9;
}
.dock-voice strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}
.dock-voice small {
  display: block;
  font-size: 11px;
  color: #a5adbb;
  margin-top: 6px;
  max-width: 190px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.dock-voice.connected .voice-symbol,
.dock-voice.connected strong {
  color: #63dca4;
}
.network-button {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  min-height: 42px;
  min-width: 78px;
  color: #a9b2c3;
}
.network-button.good {
  color: #65dda5;
}
.network-button.fair {
  color: #f2cb80;
}
.network-button.poor {
  color: #ff8c94;
}
.network-button svg {
  width: 20px;
  height: 20px;
}
.dock-controls {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.dock-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 48px;
  min-height: 48px;
  padding: 10px 13px;
  border-radius: 8px;
  color: #cad0dd;
}
.dock-button svg {
  width: 22px;
  height: 22px;
}
.dock-button.off {
  background: #3d272e;
  color: #ff8993;
}
.control-label {
  font-size: 12px;
}
.leave-button {
  color: #ff8c94;
}
.monitor-badge {
  font-size: 11px;
  color: #9bbaff;
  white-space: nowrap;
}
.person-panel {
  position: fixed;
  top: 100px;
  right: 20px;
  bottom: 100px;
  overflow-y: auto;
  width: 300px;
  padding: 20px;
  background: #1b1e25;
  border: 1px solid #454b59;
  border-radius: 12px;
  z-index: 4;
  box-shadow: 0 10px 35px #0005;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.panel-heading h2 {
  font-size: 16px;
}
.person-panel > .avatar {
  display: grid;
  margin: 10px auto 16px;
}
.person-panel > h3,
.person-panel > p {
  text-align: center;
}
.person-panel > p {
  color: #b0b7c5;
  font-size: 12px;
  margin-top: 8px;
  margin-bottom: 24px;
}
.setting-label,
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  font-size: 13px;
}
.person-panel > .secondary {
  margin-top: 14px;
}
.person-panel > .setting-help {
  font-size: 11px;
  margin: 8px 0 0;
}
.moderation {
  margin-top: 24px;
  border-top: 1px solid #3a3f4a;
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.moderation h3 {
  font-size: 12px;
  color: #a6aebd;
  margin-bottom: 4px;
}
dialog {
  color: #eceef4;
  background: #24272f;
  border: 1px solid #444a58;
  border-radius: 12px;
  padding: 28px;
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  box-shadow: 0 16px 55px #0007;
}
dialog::backdrop {
  background: #080b12b5;
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.dialog-heading h2 {
  font-size: 21px;
}
.dialog-heading .icon-button {
  margin: -7px -7px -7px 0;
}
.settings-dialog {
  width: min(620px, calc(100vw - 28px));
  padding: 28px 32px;
}
.settings-tabs {
  margin-top: 0;
}
.device-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.device-heading h3 {
  font-size: 14px;
}
.device-heading .text-button {
  font-size: 12px;
}
.settings-dialog section > label:not(.check-label) {
  display: block;
  margin: 18px 0 9px;
}
.settings-dialog select {
  font-size: 13px;
}
.output-row {
  display: flex;
  gap: 8px;
}
.output-row select {
  flex: 1;
}
.output-row button {
  white-space: nowrap;
  font-size: 12px;
}
.setting-help {
  font-size: 12px;
  color: #b3bac8;
  line-height: 1.8;
  margin-top: 10px;
}
.setting-row {
  margin-top: 24px;
}
.setting-row output {
  font-size: 12px;
  color: #c8d4f0;
  font-variant-numeric: tabular-nums;
}
.meter-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  font-size: 11px;
  color: #a6afbf;
}
.meter-row meter {
  height: 9px;
  flex: 1;
  accent-color: #58d69e;
}
.setting-divider {
  height: 1px;
  background: #3d424e;
  margin: 26px 0 24px;
}
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}
.switch-row h3 {
  font-size: 14px;
}
.switch-row p {
  color: #aeb7c8;
  font-size: 12px;
  line-height: 1.8;
  margin-top: 7px;
}
.switch {
  position: relative;
  width: 48px;
  height: 44px;
  min-width: 48px;
  background: transparent;
  border-radius: 20px;
  padding: 0 6px;
  display: flex;
  align-items: center;
}
.switch::before {
  content: "";
  position: absolute;
  width: 42px;
  height: 24px;
  top: 10px;
  left: 3px;
  border-radius: 20px;
  background: #555b69;
}
.switch > span {
  position: relative;
  background: #eceff5;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transition: transform 0.15s;
}
.switch[aria-checked="true"]::before {
  background: #6f8ee8;
}
.switch[aria-checked="true"] > span {
  transform: translateX(18px);
}
.check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 25px;
  font-size: 13px;
}
.profile-avatar {
  width: 96px;
  height: 96px;
  font-size: 32px;
  margin: 16px auto;
  display: grid;
}
#profile-settings {
  text-align: center;
}
#profile-settings h3 {
  font-size: 20px;
  margin-top: 20px;
}
#profile-settings > p {
  color: #b4bed0;
  font-size: 13px;
  margin-top: 10px;
}
.file-label {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #3b4665;
  padding: 12px !important;
  cursor: pointer;
  margin: 28px auto 6px !important;
  width: 180px;
  border-radius: 7px;
}
#reset-avatar {
  font-size: 12px;
}
.network-status {
  font-size: 15px;
  color: #b4bdcf;
  margin-bottom: 24px;
}
.network-status.good,
.good {
  color: #65dda5;
}
.network-status.fair,
.fair {
  color: #f2cb80;
}
.network-status.poor,
.poor {
  color: #ff8c94;
}
dl {
  margin: 0;
}
dl > div {
  display: flex;
  justify-content: space-between;
  padding: 15px 0;
  border-bottom: 1px solid #3b4250;
  font-size: 13px;
}
dt {
  color: #aab4c6;
}
dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.network-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 10px;
  margin-top: 22px;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%);
  background: #ebeff8;
  color: #171c2a;
  padding: 13px 20px;
  border-radius: 8px;
  max-width: min(90vw, 660px);
  box-shadow: 0 6px 24px #0005;
  z-index: 99;
  font-size: 13px;
  line-height: 1.7;
}
#toast:empty {
  display: none;
}
.mobile-only {
  display: none;
}
[hidden] {
  display: none !important;
}
@media (max-width: 1050px) {
  .control-label {
    display: none;
  }
  .dock {
    gap: 14px;
  }
  .dock-voice {
    min-width: 170px;
  }
  .lobby {
    padding: 32px 26px;
  }
  .voice-room {
    padding: 26px;
  }
  .members {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}
@media (max-width: 760px) {
  .auth-screen {
    display: block;
    padding: 35px 20px;
    max-width: 480px;
  }
  .auth-brand {
    margin-bottom: 30px;
  }
  .auth-brand .wordmark {
    font-size: 36px;
  }
  .auth-brand .brand-dot {
    width: 7px;
    height: 7px;
    margin-bottom: 8px;
  }
  .auth-brand > p,
  .auth-art {
    display: none;
  }
  .auth-panel {
    padding: 26px;
  }
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .sidebar {
    display: none;
    position: fixed;
    top: 0;
    bottom: 78px;
    left: 0;
    width: 280px;
    z-index: 6;
    box-shadow: 10px 0 35px #0009;
  }
  .app.side-open .sidebar {
    display: flex;
  }
  .mobile-only {
    display: inline-grid;
  }
  .topbar {
    padding: 16px;
    gap: 10px;
    min-height: 76px;
  }
  .channel-icon {
    display: none;
  }
  .topbar h1 {
    font-size: 16px;
    max-width: 44vw;
  }
  .topbar > .text-button {
    font-size: 10px;
    padding: 5px;
    gap: 5px;
  }
  .lobby {
    padding: 28px 20px;
  }
  .lobby-heading {
    align-items: flex-start;
    gap: 14px;
  }
  .lobby-heading h2 {
    font-size: 22px;
    line-height: 1.5;
  }
  .lobby-heading p {
    font-size: 12px;
  }
  .lobby-heading > .primary {
    font-size: 12px;
    padding: 9px 11px;
    white-space: nowrap;
  }
  .join-code-form {
    margin: 26px 0 30px;
  }
  .room-row {
    gap: 10px;
  }
  .room-row .online {
    min-width: 45px;
    font-size: 10px;
  }
  .room-row .room-symbol {
    width: 36px;
    height: 36px;
  }
  .room-row > button {
    font-size: 12px;
    padding: 8px 10px;
    min-width: 50px;
  }
  .room-text strong {
    font-size: 13px;
  }
  .room-text small {
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .voice-room {
    padding: 22px 18px;
  }
  .members {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px 2px;
    padding-top: 26px;
  }
  .member {
    padding: 12px 3px;
    min-height: 145px;
  }
  .member .avatar {
    width: 60px;
    height: 60px;
    font-size: 22px;
  }
  .member .member-name {
    font-size: 12px;
  }
  .member .member-info {
    font-size: 10px;
  }
  .room-meta {
    font-size: 11px;
  }
  .dock {
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
    gap: 5px;
    flex-wrap: wrap;
  }
  .dock-voice {
    min-width: 0;
    max-width: none;
    flex: 1;
  }
  .dock-voice .voice-symbol {
    display: none;
  }
  .dock-voice strong {
    font-size: 11px;
  }
  .dock-voice small {
    font-size: 10px;
    max-width: 110px;
  }
  .network-button {
    min-width: 58px;
    gap: 4px;
    font-size: 10px;
  }
  .network-button svg {
    width: 17px;
    height: 17px;
  }
  .dock-controls {
    gap: 1px;
    margin-left: 0;
  }
  .dock-button {
    min-width: 44px;
    min-height: 44px;
    padding: 9px;
  }
  .dock-button svg {
    width: 20px;
    height: 20px;
  }
  .leave-button {
    margin-left: 0;
  }
  .monitor-badge {
    display: none;
  }
  #enable-audio {
    font-size: 11px;
    order: 10;
    padding: 3px 7px;
    min-height: 25px;
    width: 100%;
  }
  .person-panel {
    left: 16px;
    right: 16px;
    top: 94px;
    bottom: 100px;
    width: auto;
    max-width: 380px;
    margin-left: auto;
  }
  .settings-dialog {
    padding: 23px;
    max-height: calc(100dvh - 30px);
  }
  .settings-dialog input,
  .settings-dialog select {
    font-size: 14px;
  }
  .switch-row p {
    font-size: 11px;
  }
  .network-dialog {
    padding: 23px;
  }
}
@media (max-width: 370px) {
  .members {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dock-voice small {
    max-width: 80px;
  }
  .dock-voice strong {
    font-size: 10px;
  }
  .dock-button {
    min-width: 44px;
    padding: 7px;
  }
  .dock-controls {
    gap: 0;
  }
  .dock {
    gap: 3px;
    padding-left: 8px;
    padding-right: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* A quiet voice stage; bounded motion belongs to state changes, never a loop. */
:root { --ease-out: cubic-bezier(.16,1,.3,1); --fast: 120ms; --arrive: 220ms; }
.audio-bin { position: fixed; width: 1px; height: 1px; left: -10px; bottom: 0; overflow: hidden; pointer-events: none; }
#reconnect { margin-top: 12px; }
.room-access { display: flex; align-items: center; gap: 9px; color: #e3c386; }
.room-access .text-button { font-size: 12px; min-height: 44px; padding: 6px 8px; }
button { transition: background-color var(--fast), color var(--fast), opacity var(--fast); }
button:active:not(:disabled) { transform: scale(.97); }
.auth-panel { box-shadow: 0 20px 65px #0c0f1833; }
.auth-screen { background: radial-gradient(ellipse at 14% 34%, #28334a55, transparent 55%); }
.brand-dot { transition: background-color var(--fast); }
.topbar { background: #25272ef5; }
.voice-room { padding: 0; height: calc(100% - 84px); min-height: 0; }
.room-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; height: 100%; min-height: 0; }
.voice-stage { padding: 26px 28px; overflow: auto; min-width: 0; scrollbar-gutter: stable; }
.room-meta { flex-wrap: wrap; }
.room-meta #role-hint { margin-left: auto; }
#chat-open { display: none; font-size: 12px; padding: 6px 8px; min-height: 44px; }
.members { grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)); gap: 16px 10px; }
.member { contain: layout style; }
.member .avatar-ring { transition: border-color 120ms, background-color 120ms; }
.member.speaking .avatar-ring { background-color: #53d69a14; }
.member .avatar-ring { border-width: 3px; }
.member.speaking .avatar-ring { border-color: #70f6b2; background-color: #53d69a22; box-shadow: 0 0 0 4px #53d69a26; transition-duration: 55ms; }
.voice-activity { display: flex; align-items: center; justify-content: center; gap: 6px; color: #70f6b2; font-size: 11px; height: 18px; margin-top: 7px; visibility: hidden; }
.speaking .voice-activity { visibility: visible; }
.activity-bars { display: flex; align-items: center; gap: 2px; height: 14px; }
.activity-bars i { width: 3px; height: 12px; border-radius: 2px; background: currentColor; transform: scaleY(calc(.3 + var(--voice-level,0) * .7)); }
.activity-bars i:nth-child(2) { height: 16px; }
.member.speaking .member-name { color: #b7f7d7; }
.member .avatar { transition: transform 160ms var(--ease-out); }
.member.speaking .avatar { transform: scale(1.035); }
.stage-caption { display: flex; align-items: center; gap: 14px; color: #969eaf; font-size: 11px; max-width: 290px; margin: 15px auto 0; }
.stage-caption > span:not(.stage-line) { white-space: nowrap; }
.stage-line { height: 1px; background: #3d4351; flex: 1; }
.dock { box-shadow: 0 -8px 24px #10131a26; }
.dock-voice .voice-symbol { transition: color 150ms; }
.network-button { font-variant-numeric: tabular-nums; }
.chat-panel { display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative; background: #1e2129; border-left: 1px solid #363943; }
.chat-heading { display: flex; justify-content: space-between; align-items: center; padding: 22px 20px 18px; }
.chat-heading h2 { display: flex; align-items: center; gap: 9px; font-size: 14px; letter-spacing: 0; }
.chat-heading h2 svg { width: 18px; height: 18px; color: #aab8d7; }
.chat-heading p { color: #f1c46c; font-size: 11px; margin-top: 7px; }
.chat-heading p.ready { color: #91b5a4; }
.chat-heading p::before { content: ""; display: inline-block; width: 5px; height: 5px; background: currentColor; border-radius: 50%; margin: 0 6px 2px 0; }
#chat-close { display: none; min-width: 44px; height: 44px; }
.chat-messages { flex: 1; min-height: 0; overflow: auto; overflow-wrap: anywhere; overscroll-behavior: contain; padding: 4px 18px 18px; scrollbar-gutter: stable; }
.chat-empty { text-align: center; font-size: 12px; color: #a6aab5; line-height: 1.8; padding: 50px 8px; }
.chat-message { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0; contain: layout style; }
.chat-message .avatar { width: 30px; height: 30px; flex-shrink: 0; font-size: 13px; }
.chat-message-body { min-width: 0; flex: 1; }
.chat-message-head { display: flex; gap: 8px; align-items: baseline; margin: 0 0 6px; }
.chat-message-head strong { font-size: 12px; color: #c5cfe5; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-message.own .chat-message-head strong { color: #a9c1ff; }
.chat-message time { font-size: 10px; color: #a6aab5; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.chat-message p { white-space: pre-wrap; font-size: 13px; line-height: 1.8; color: #e1e4ed; }
.chat-form { gap: 8px; padding: 14px 16px 16px; border-top: 1px solid #363943; }
.chat-form textarea { width: 100%; min-height: 76px; max-height: 180px; resize: vertical; background: #292e39; color: #ecedf0; border: 1px solid #444c60; padding: 12px; font: inherit; font-size: 13px; line-height: 1.7; border-radius: 8px; caret-color: #b4caff; }
.chat-compose-foot { display: flex; align-items: center; justify-content: space-between; }
.chat-compose-foot > span { color: #a6aab5; font-size: 11px; font-variant-numeric: tabular-nums; }
.chat-compose-foot button { min-height: 40px; padding: 8px 14px; font-size: 12px; }
.chat-compose-foot svg { width: 16px; height: 16px; }
.chat-new { position: absolute; bottom: 180px; align-self: center; display: inline-flex; align-items: center; gap: 7px; background: #384b78; color: #dce6ff; padding: 12px 16px; font-size: 12px; box-shadow: 0 6px 18px #0b102747; }
.chat-new svg { width: 16px; height: 16px; transform: rotate(90deg); }
.chat-messages { position: relative; overflow-anchor: none; }
.chat-message { margin: 13px 0; gap: 11px; }
.chat-message p { font-size: 14px; line-height: 1.75; user-select: text; }
.chat-message.own .chat-message-body > p { background: #2c3853; padding: 9px 12px; border-radius: 8px; }
.chat-message a { color: #b4caff; text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.chat-message-head { min-height: 24px; margin-bottom: 3px; gap: 7px; }
.chat-message-head strong { flex: 1; }
.chat-copy { width: 28px; height: 28px; display: grid; place-items: center; opacity: 0; color: #b9c4db; }
.chat-copy svg { width: 15px; height: 15px; }
.chat-message:hover .chat-copy, .chat-copy:focus-visible, .chat-copy.copied { opacity: 1; }
.chat-copy.copied { color: #70f6b2; }
.chat-date { display: flex; align-items: center; gap: 12px; color: #a6aab5; font-size: 11px; padding: 16px 0 8px; }
.chat-date::before, .chat-date::after { content: ""; height: 1px; background: #343a47; flex: 1; }
.chat-new { position: static; min-height: 42px; margin: 4px 12px 10px; padding: 8px 14px; flex-shrink: 0; }
.chat-form { gap: 9px; }
.chat-form textarea { min-height: 48px; max-height: 160px; resize: none; }
.chat-compose-foot { gap: 8px; flex-wrap: wrap; }
#chat-key-help { font-size: 10px; }
#chat-count { margin-left: auto; }
.chat-delivery { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11px; color: #abb9d6; margin-top: 5px; }
.chat-delivery .delivery-label { flex: 1; }
.chat-delivery button { min-height: 36px; color: #b4caff; padding: 6px; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.failed-message .chat-delivery { color: #ff9ca2; }
.failed-message .chat-message-body > p { background: #3b2c36; }
.first-unread::before { content: "以下是新消息"; color: #b4caff; font-size: 11px; position: absolute; top: -17px; left: 40px; }
.first-unread { margin-top: 36px; position: relative; }
@media (min-width: 1101px) { .room-layout { grid-template-columns: minmax(0,1fr) 360px; } }
@media (min-width: 1600px) { .room-layout { grid-template-columns: minmax(0,1fr) 400px; } }
@media (max-width: 760px) {
  .chat-copy { width: 44px; height: 44px; opacity: 1; }
  .chat-message-head { margin-top: -7px; }
  .chat-delivery button { min-height: 44px; }
  #chat-key-help { display: none; }
  .chat-form textarea { min-height: 48px; }
  .voice-activity { font-size: 10px; }
}
.unread-count { background: #93afff; color: #14213f; min-width: 18px; padding: 2px 5px; border-radius: 5px; font-size: 11px; }
.noise-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.noise-heading h3 { display: flex; align-items: center; gap: 8px; }
.noise-heading svg { width: 18px; height: 18px; color: #a9bded; }
.noise-status { color: #a6aab5; font-size: 11px; }
.noise-status.active { color: #79d9ad; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
dialog[open] { animation: dialog-in 220ms var(--ease-out); }
@keyframes dialog-in { from { opacity: .7; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes chat-in { from { transform: translateX(16px); opacity: .65; } to { transform: none; opacity: 1; } }
@media (min-width: 1600px) { .room-layout { grid-template-columns: minmax(0, 1fr) 360px; } }
@media (max-width: 1100px) {
  .room-layout { display: block; }
  .voice-stage { height: 100%; }
  #chat-open { display: inline-flex; }
  .chat-panel { display: none; position: fixed; right: 0; top: 0; bottom: 78px; width: 350px; max-width: 100%; z-index: 4; box-shadow: -12px 0 35px #10131a66; }
  .chat-open .chat-panel { display: flex; animation: chat-in 220ms var(--ease-out); }
  #chat-close { display: inline-grid; }
}
@media (max-width: 760px) {
  .voice-room { height: calc(100% - 84px); }
  .voice-stage { padding: 20px 18px; }
  .members { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 2px; }
  .room-meta { gap: 8px; }
  .room-meta #role-hint { margin-left: 0; }
  #chat-open { margin-left: auto; font-size: 11px; }
  .chat-panel { position: absolute; top: 84px; left: 0; bottom: 0; width: 100%; border-left: 0; z-index: 3; }
  .chat-open .voice-stage { visibility: hidden; }
  .chat-heading { padding: 12px 18px; }
  .chat-form { padding-bottom: 14px; }
  .chat-form textarea { resize: none; min-height: 64px; font-size: 16px; }
  .chat-messages { padding: 0 18px 16px; }
  .chat-message p { font-size: 14px; }
  .chat-compose-foot button { min-height: 44px; }
}
@media (max-width: 370px) { .members { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  button:active:not(:disabled), .member.speaking .avatar { transform: none; }
}
/* Let the actual header and dock determine available chat height. */
.workspace { display: flex; flex-direction: column; overflow: hidden; }
.topbar { flex-shrink: 0; position: relative; }
.lobby { min-height: 0; overflow: auto; flex: 1; width: 100%; }
.voice-room { flex: 1; min-height: 0; height: auto; position: relative; }
@media (max-width: 1100px) { .chat-panel { position: absolute; top: 0; bottom: 0; } }
@media (min-width: 1600px) { .room-layout { grid-template-columns: minmax(0,1fr) 400px; } }
@media (max-width: 760px) { .chat-form textarea { min-height: 48px; } }

/* Profile and room names stay separate, with explicit scope near each editor. */
.profile-quick { display:flex;align-items:center;gap:9px;min-height:44px;flex-shrink:0;color:#d4dbea;font-size:12px;margin-left:auto;padding:5px 8px;border-radius:8px; }
.profile-quick:hover { background:#363d4d; }
.profile-quick .avatar { width:32px;height:32px;font-size:13px; }
.topbar > div { min-width:0; }
.topbar h1 { overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.profile-name-form { margin:24px 0; text-align:left; }
.name-field-row { display:flex;gap:8px;align-items:stretch; }
.name-field-row input { min-width:0;flex:1;margin:0; }
.name-field-row button { flex-shrink:0;padding-inline:14px; }
.nickname-actions { display:flex;justify-content:space-between;gap:16px;align-items:center;margin-top:20px; }
#person-name, #person-region, #nickname-context { overflow-wrap:anywhere; }
#person-nickname { margin-block:16px 20px; }
.embedded-help { margin:0 0 20px;padding:12px 14px;background:#2b3447;border-left:3px solid #9cbaff;border-radius:4px;color:#d0d9ed;font-size:12px;line-height:1.7; }
.embedded-help p { margin:6px 0;color:#c3cfe4; }
.embedded-help > div { display:flex;gap:12px;flex-wrap:wrap; }
.embedded-help button { min-height:44px;color:#b4caff; }
#recovery-status { display:block;color:#d0d9ed; }
#self-nickname { min-height:44px; }
@media (max-width:760px) {
  .profile-quick > span:last-child { display:none; }
  .profile-quick { padding:4px; }
  .name-field-row input, #nickname-input { font-size:16px; }
  .name-field-row button, .nickname-actions button, #person-nickname { min-height:44px; }
}
