@font-face {
  font-family: "IBM Plex Sans Condensed";
  src: url("vendor/ibm-plex-sans-condensed-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans Condensed";
  src: url("vendor/ibm-plex-sans-condensed-600.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans Condensed";
  src: url("vendor/ibm-plex-sans-condensed-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("vendor/ibm-plex-mono-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("vendor/ibm-plex-mono-600.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  --bg-0: #07090a;
  --bg-1: #0d1012;
  --surface-1: #121619;
  --surface-2: #181e22;
  --surface-3: #20272b;
  --ink-strong: #f4f2e9;
  --ink: #d8dbd6;
  --muted: #9aa2a4;
  --faint: #687174;
  --live: #ff5148;
  --signal: #58d4c2;
  --warning: #e7b84b;
  --info: #7ab7e8;
  --focus: #a7f3e7;
  --line: rgba(244, 242, 233, 0.14);
  --line-strong: rgba(244, 242, 233, 0.3);
  --shadow-overlay: 0 16px 48px rgba(0, 0, 0, 0.44);
  --ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-state: cubic-bezier(0.2, 0, 0, 1);
  --ease-exit: cubic-bezier(0.4, 0, 1, 1);
  --topbar-height: 56px;
  --mobile-nav-height: 56px;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

html {
  color-scheme: dark;
  background: var(--bg-0);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: "IBM Plex Sans Condensed", "Source Han Sans SC", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-0);
}

.ambient-shell {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(244, 242, 233, 0.035) 31px 32px),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(244, 242, 233, 0.035) 31px 32px),
    repeating-linear-gradient(135deg, transparent 0 11px, rgba(244, 242, 233, 0.014) 11px 12px),
    var(--bg-0);
  pointer-events: none;
}

.ambient-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(244, 242, 233, 0.13) 0.45px, transparent 0.65px);
  background-size: 5px 5px;
  opacity: 0.2;
}

[hidden] {
  display: none !important;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

button svg,
.switch-row svg,
.toast svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  pointer-events: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3,
button,
.meter-text,
.member-name {
  font-family: "IBM Plex Sans Condensed", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

h1 {
  color: var(--ink-strong);
  font-size: 25px;
  font-weight: 700;
  line-height: 1;
}

h2 {
  color: var(--ink-strong);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

h3 {
  color: var(--ink-strong);
  font-size: 15px;
  font-weight: 700;
}

p,
.meter-text {
  color: var(--muted);
  font-size: 12px;
}

.eyebrow {
  color: var(--signal);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  height: 100vh;
  height: 100dvh;
  min-height: 620px;
  display: grid;
  grid-template-rows: auto var(--topbar-height) minmax(0, 1fr);
  padding: 8px;
}

.topbar {
  grid-row: 2;
  position: relative;
  z-index: 20;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(260px, 1fr) auto;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: rgba(7, 9, 10, 0.96);
}

.signal-spine {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  overflow: hidden;
  background: var(--faint);
  transition: background 140ms var(--ease-state), box-shadow 200ms var(--ease-state);
}

.signal-spine span {
  position: absolute;
  inset: -35% 0 auto;
  height: 32%;
  background: var(--warning);
  opacity: 0;
}

body[data-connection="connecting"] .signal-spine,
body[data-connection="reconnecting"] .signal-spine {
  background: rgba(231, 184, 75, 0.32);
}

body[data-connection="connecting"] .signal-spine span,
body[data-connection="reconnecting"] .signal-spine span {
  opacity: 1;
  animation: signal-travel 1.4s linear infinite;
}

body[data-connection="online"] .signal-spine {
  background: var(--signal);
  box-shadow: 0 0 12px rgba(88, 212, 194, 0.34);
}

body[data-connection="error"] .signal-spine,
body[data-connection="offline"] .signal-spine {
  background: var(--live);
}

.brand-block {
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 16px;
}

.brand-mark {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  color: var(--bg-0);
  background: var(--ink-strong);
}

.brand-mark::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 12px;
  height: 12px;
  background: var(--live);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.brand-mark b {
  font-size: 18px;
  line-height: 1;
}

.brand-mark i {
  position: absolute;
  top: 3px;
  right: 4px;
  color: var(--bg-0);
  font-family: "IBM Plex Mono", monospace;
  font-size: 7px;
  font-style: normal;
  font-weight: 600;
}

.brand-copy {
  min-width: 0;
}

.brand-copy .eyebrow {
  margin-bottom: 2px;
}

.room-status {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.room-copy {
  min-width: 0;
}

.room-copy h2,
.room-copy p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-copy h2 {
  font-size: 18px;
}

.connection-pill {
  min-width: 78px;
  height: 30px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-1);
  font-size: 12px;
  font-weight: 600;
}

.connection-pill[data-state="online"],
.connection-pill[data-state="在线"] {
  border-color: rgba(88, 212, 194, 0.48);
  color: var(--signal);
}

.connection-pill[data-state="connecting"],
.connection-pill[data-state="reconnecting"],
.connection-pill[data-state="连接中"],
.connection-pill[data-state="重连中"] {
  border-color: rgba(231, 184, 75, 0.48);
  color: var(--warning);
}

.connection-pill[data-state="offline"],
.connection-pill[data-state="error"],
.connection-pill[data-state="离线"],
.connection-pill[data-state="连接异常"] {
  border-color: rgba(255, 81, 72, 0.42);
  color: var(--live);
}

.top-actions,
.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-actions {
  justify-self: end;
  padding-right: 8px;
}

.entry-panel,
.workspace {
  grid-row: 3;
  min-height: 0;
  border: 1px solid var(--line);
  background: rgba(7, 9, 10, 0.9);
}

.entry-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(420px, 560px);
  align-items: stretch;
  overflow: hidden;
}

.entry-visual {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(0deg, transparent 0 47px, rgba(244, 242, 233, 0.04) 47px 48px),
    repeating-linear-gradient(90deg, transparent 0 47px, rgba(244, 242, 233, 0.04) 47px 48px),
    var(--bg-0);
}

.entry-visual::before,
.entry-visual::after {
  content: "";
  position: absolute;
  background: var(--line);
}

.entry-visual::before {
  width: 1px;
  height: 62%;
}

.entry-visual::after {
  width: 62%;
  height: 1px;
}

.entry-index {
  position: absolute;
  left: 20px;
  bottom: 18px;
  color: var(--faint);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
}

.join-terminal {
  align-self: center;
  min-width: 0;
  display: grid;
  gap: 16px;
  margin: 24px 32px;
  padding: 28px 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.join-copy {
  display: grid;
  gap: 5px;
}

.join-copy h2 {
  font-size: 28px;
}

.field-label {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

input {
  min-width: 0;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0 12px;
  outline: none;
  color: var(--ink-strong);
  background: var(--bg-0);
  transition: border-color 140ms var(--ease-state), background 140ms var(--ease-state), box-shadow 140ms var(--ease-state);
}

input:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: #0a0d0e;
}

input:focus-visible,
button:focus-visible,
.video-tile:focus-visible,
.switch-row:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.primary-button,
.ghost-button,
.danger-button,
.icon-button,
.inspector-button,
.segmented button,
.view-toggle button,
.mobile-switcher button,
.unread-button,
.tile-audio-button {
  position: relative;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  transition:
    color 140ms var(--ease-state),
    background 140ms var(--ease-state),
    border-color 140ms var(--ease-state),
    opacity 140ms var(--ease-state),
    transform 90ms var(--ease-state);
}

.is-pressing,
button:active:not(:disabled) {
  transform: translateY(1px);
}

.primary-button {
  min-width: 96px;
  padding: 0 16px;
  color: var(--bg-0);
  background: var(--signal);
  border-color: var(--signal);
  font-weight: 700;
}

.primary-button:not(:disabled):hover {
  background: var(--focus);
  border-color: var(--focus);
}

.ghost-button {
  min-width: 88px;
  padding: 0 15px;
  color: var(--ink);
  background: var(--surface-1);
  border-color: var(--line);
  font-weight: 600;
}

.ghost-button:not(:disabled):hover,
.icon-button:not(:disabled):hover {
  color: var(--ink-strong);
  background: var(--surface-3);
  border-color: var(--line-strong);
}

.danger-button {
  min-width: 84px;
  padding: 0 15px;
  color: #ffb0ab;
  background: rgba(255, 81, 72, 0.08);
  border-color: rgba(255, 81, 72, 0.34);
  font-weight: 700;
}

.danger-button:not(:disabled):hover {
  color: var(--ink-strong);
  background: rgba(255, 81, 72, 0.2);
  border-color: var(--live);
}

.icon-button {
  width: 42px;
  min-width: 42px;
  padding: 0;
  color: var(--muted);
  background: var(--surface-1);
  border-color: var(--line);
}

.join-button {
  justify-self: start;
  min-width: 156px;
}

.workspace {
  display: none;
  grid-template-columns: 224px minmax(0, 1fr) 344px;
  overflow: hidden;
}

body[data-joined="true"] .entry-panel {
  display: none;
}

body[data-joined="true"] .workspace {
  display: grid;
}

.side-panel,
.chat-panel,
.stage-panel {
  min-width: 0;
  min-height: 0;
}

.side-panel,
.chat-panel {
  background: rgba(13, 16, 18, 0.96);
}

.side-panel {
  overflow: auto;
  border-right: 1px solid var(--line);
}

.panel-section {
  min-height: 100%;
  padding: 16px 12px;
}

.section-head {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-head h2 {
  margin-top: 3px;
}

.member-list,
.message-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.member-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.member-item {
  position: relative;
  min-height: 60px;
  padding: 9px 8px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 1px solid transparent;
  border-left-color: var(--line);
  background: transparent;
  transition: background 140ms var(--ease-state), border-color 140ms var(--ease-state), transform 140ms var(--ease-enter);
}

.member-item:hover {
  border-color: var(--line);
  background: var(--surface-1);
  transform: translateX(2px);
}

.member-item.self {
  border-color: rgba(122, 183, 232, 0.32);
}

.member-item.owner::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 12px;
  height: 12px;
  background: var(--warning);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.member-item.streaming {
  border-left-color: var(--live);
  background: rgba(255, 81, 72, 0.05);
}

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--ink-strong);
  background: var(--surface-3);
  border: 1px solid var(--line);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 600;
}

.member-item:nth-child(6n + 1) .avatar { border-bottom-color: var(--signal); }
.member-item:nth-child(6n + 2) .avatar { border-bottom-color: var(--info); }
.member-item:nth-child(6n + 3) .avatar { border-bottom-color: var(--warning); }
.member-item:nth-child(6n + 4) .avatar { border-bottom-color: #c3a4d8; }
.member-item:nth-child(6n + 5) .avatar { border-bottom-color: #8ec99a; }
.member-item:nth-child(6n) .avatar { border-bottom-color: #d59b7a; }

.member-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.member-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.member-name {
  min-width: 0;
  overflow: hidden;
  flex: 1 1 auto;
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-badges {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.member-sub {
  overflow: hidden;
  color: var(--muted);
  font-family: "IBM Plex Mono", "PingFang SC", monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.self-badge,
.owner-badge,
.live-badge {
  display: inline-flex;
  align-items: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-family: "IBM Plex Mono", "PingFang SC", monospace;
  font-size: 9px;
  font-weight: 600;
}

.self-badge {
  color: var(--info);
}

.owner-badge {
  color: var(--warning);
}

.live-badge {
  color: var(--live);
  animation: live-marker 1.8s ease-in-out infinite;
}

.member-status {
  width: 8px;
  height: 8px;
  border: 1px solid var(--faint);
  background: transparent;
}

.empty-list {
  min-height: 56px;
  display: grid;
  place-items: center;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
  color: var(--muted);
  font-size: 12px;
}

.stage-panel {
  position: relative;
  overflow: hidden;
  background: #050708;
}

.stage-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(244, 242, 233, 0.025) 31px 32px),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(244, 242, 233, 0.025) 31px 32px);
  pointer-events: none;
}

.stage-panel::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 8;
  width: 3px;
  background: var(--signal);
  opacity: 0.55;
  pointer-events: none;
}

.stage-hud {
  position: absolute;
  z-index: 12;
  transition: opacity 280ms var(--ease-state), transform 280ms var(--ease-enter);
}

.stage-panel[data-hud-idle="true"] .stage-hud {
  opacity: 0.56;
}

.stage-panel:hover .stage-hud,
.stage-panel:focus-within .stage-hud {
  opacity: 1;
}

.stage-toolbar {
  top: 8px;
  left: 12px;
  right: 12px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 8px 7px 12px;
  border: 1px solid var(--line);
  background: rgba(7, 9, 10, 0.88);
  backdrop-filter: blur(10px);
}

.stage-heading {
  min-width: 0;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: baseline;
  gap: 9px;
}

.stage-heading h2,
.stage-heading p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-toggle,
.segmented {
  height: 38px;
  display: grid;
  padding: 3px;
  border: 1px solid var(--line);
  background: var(--bg-0);
}

.view-toggle {
  grid-template-columns: repeat(2, minmax(72px, 1fr));
}

.segmented {
  grid-template-columns: repeat(3, minmax(58px, 1fr));
}

.view-toggle button,
.segmented button {
  min-height: 30px;
  height: 30px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
}

.view-toggle button.active,
.segmented button.active {
  color: var(--bg-0);
  background: var(--ink-strong);
  font-weight: 700;
}

.video-grid {
  position: absolute;
  inset: 0;
  z-index: 2;
  min-height: 0;
  padding: 64px 10px 72px;
  overflow: hidden;
}

.stage-layout {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.focus-layout {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
}

.grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  grid-auto-rows: minmax(158px, 1fr);
  gap: 8px;
  overflow: auto;
}

.focus-main {
  min-height: 0;
}

.focus-main > .video-tile {
  width: 100%;
  height: 100%;
}

.thumbnail-rail {
  min-height: 102px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 224px);
  gap: 8px;
  overflow-x: auto;
}

.thumbnail-rail:empty {
  display: none;
}

.video-tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #000;
  outline: none;
  transition: border-color 140ms var(--ease-state), box-shadow 140ms var(--ease-state), opacity 140ms var(--ease-state);
}

.video-tile::before,
.video-tile::after {
  content: "";
  position: absolute;
  z-index: 5;
  width: 20px;
  height: 20px;
  border-color: transparent;
  pointer-events: none;
  transition: border-color 140ms var(--ease-state), width 140ms var(--ease-enter), height 140ms var(--ease-enter);
}

.video-tile::before {
  top: 7px;
  left: 7px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.video-tile::after {
  right: 7px;
  bottom: 7px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.video-tile:hover,
.video-tile:focus-visible,
.video-tile.active {
  border-color: rgba(167, 243, 231, 0.72);
}

.video-tile:hover::before,
.video-tile:hover::after,
.video-tile:focus-visible::before,
.video-tile:focus-visible::after,
.video-tile.active::before,
.video-tile.active::after {
  width: 30px;
  height: 30px;
  border-color: var(--focus);
}

.video-tile.active {
  box-shadow: inset 3px 0 0 var(--signal);
}

.video-tile video,
.pending-video {
  width: 100%;
  height: 100%;
  min-height: 100%;
  display: grid;
  place-items: center;
  object-fit: contain;
  color: var(--muted);
  background: #000;
}

.video-tile video {
  animation: video-ready 180ms ease-out both;
}

.pending-video {
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(244, 242, 233, 0.03) 31px 32px),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(244, 242, 233, 0.03) 31px 32px),
    #050708;
  font-family: "IBM Plex Mono", "PingFang SC", monospace;
  font-size: 12px;
}

.video-tile.grid {
  min-height: 158px;
}

.video-tile.thumb {
  min-height: 102px;
}

.tile-live,
.tile-label,
.tile-meta,
.tile-stats,
.tile-audio-button {
  position: absolute;
  z-index: 6;
  max-width: calc(100% - 20px);
  overflow: hidden;
  border-radius: 2px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-live {
  top: 10px;
  left: 10px;
  min-height: 24px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 81, 72, 0.48);
  color: #ffb0ab;
  background: rgba(7, 9, 10, 0.84);
  font-family: "IBM Plex Mono", "PingFang SC", monospace;
  font-size: 10px;
  font-weight: 600;
}

.video-tile:not(.waiting-frame):not(.pending) .tile-live {
  color: var(--ink-strong);
  background: var(--live);
  border-color: var(--live);
}

.tile-audio-button {
  top: 10px;
  right: 10px;
  min-height: 30px;
  max-width: min(132px, calc(100% - 92px));
  padding: 0 9px;
  color: var(--ink);
  background: rgba(7, 9, 10, 0.86);
  border-color: var(--line);
  font-size: 11px;
  font-weight: 600;
}

.tile-audio-button:hover,
.tile-audio-button:focus-visible {
  border-color: var(--signal);
  color: var(--signal);
}

.tile-stats {
  top: 10px;
  right: 10px;
  min-height: 24px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  background: rgba(7, 9, 10, 0.82);
  border: 1px solid var(--line);
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
}

.tile-audio-button + .tile-stats {
  top: 46px;
}

.tile-label {
  left: 10px;
  bottom: 34px;
  padding: 5px 8px;
  color: var(--ink-strong);
  background: rgba(7, 9, 10, 0.86);
  font-size: 12px;
  font-weight: 600;
}

.tile-meta {
  left: 10px;
  bottom: 9px;
  padding: 4px 7px;
  color: var(--muted);
  background: rgba(7, 9, 10, 0.82);
  font-family: "IBM Plex Mono", "PingFang SC", monospace;
  font-size: 10px;
}

.video-tile.play-blocked {
  border-color: var(--warning);
}

.video-tile.waiting-frame::after {
  width: auto;
  height: auto;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  content: "同步画面中";
  color: var(--muted);
  background: rgba(7, 9, 10, 0.56);
  font-family: "IBM Plex Mono", "PingFang SC", monospace;
  font-size: 12px;
  pointer-events: none;
}

.empty-state {
  width: 100%;
  height: 100%;
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  color: var(--muted);
  text-align: center;
}

.empty-state h2 {
  font-size: 18px;
}

.broadcast-aperture {
  position: relative;
  width: 86px;
  height: 86px;
  margin-bottom: 6px;
}

.broadcast-aperture-large {
  z-index: 1;
  width: 180px;
  height: 180px;
}

.aperture-ring,
.aperture-core {
  position: absolute;
  inset: 50% auto auto 50%;
  display: block;
  transform: translate(-50%, -50%);
}

.aperture-ring {
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.ring-a {
  width: 100%;
  height: 100%;
  border-top-color: var(--signal);
  border-right-color: transparent;
  animation: aperture-spin 6s linear infinite;
}

.ring-b {
  width: 70%;
  height: 70%;
  margin-left: -6%;
  border-bottom-color: var(--info);
  border-left-color: transparent;
  animation: aperture-spin-reverse 4.8s linear infinite;
}

.ring-c {
  width: 42%;
  height: 42%;
  margin-top: 5%;
  border-right-color: var(--warning);
  border-bottom-color: transparent;
  animation: aperture-spin 3.8s linear infinite;
}

.aperture-core {
  width: 10px;
  height: 10px;
  background: var(--live);
  box-shadow: 0 0 0 7px rgba(255, 81, 72, 0.1);
}

.control-bar {
  left: 12px;
  right: 12px;
  bottom: 8px;
  min-height: 52px;
  display: grid;
  grid-template-columns: auto minmax(210px, 320px) minmax(180px, auto) auto;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border: 1px solid var(--line);
  background: rgba(7, 9, 10, 0.9);
  backdrop-filter: blur(10px);
}

.control-group,
.stream-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stream-actions button {
  min-height: 40px;
}

.quality-group .segmented {
  width: 100%;
}

.switch-row {
  position: relative;
  min-width: 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: color 140ms var(--ease-state), opacity 140ms var(--ease-state);
}

.switch-row:hover:not(.disabled) {
  color: var(--ink-strong);
}

.switch-row input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  width: 32px;
  height: 18px;
  padding: 2px;
  flex: 0 0 32px;
  border: 1px solid var(--line-strong);
  background: var(--bg-0);
  transition: background 140ms var(--ease-state), border-color 140ms var(--ease-state);
}

.switch-track span {
  display: block;
  width: 12px;
  height: 12px;
  background: var(--faint);
  transition: transform 140ms var(--ease-enter), background 140ms var(--ease-state);
}

.switch-row input:checked + .switch-track {
  border-color: var(--signal);
  background: rgba(88, 212, 194, 0.12);
}

.switch-row input:checked + .switch-track span {
  background: var(--signal);
  transform: translateX(14px);
}

.switch-row.disabled {
  color: var(--faint);
  cursor: not-allowed;
}

.audio-status-text {
  min-width: 0;
  max-width: 92px;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector-button {
  min-width: 126px;
  min-height: 40px;
  padding: 0 9px;
  justify-content: flex-start;
  color: var(--muted);
  background: var(--surface-1);
  border-color: var(--line);
}

.inspector-button:hover,
body[data-settings-open="true"] .inspector-button {
  color: var(--ink-strong);
  border-color: var(--signal);
}

.inspector-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
  text-align: left;
}

.inspector-copy small {
  color: var(--muted);
  font-size: 9px;
}

.inspector-copy strong {
  color: var(--ink-strong);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
}

.inspector-chevron {
  margin-left: auto;
  transition: transform 140ms var(--ease-enter);
}

body[data-settings-open="true"] .inspector-chevron {
  transform: rotate(180deg);
}

.control-inspector {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: min(360px, calc(100vw - 48px));
  padding: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(13, 16, 18, 0.98);
  box-shadow: var(--shadow-overlay);
}

.inspector-head,
.dialog-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inspector-head {
  margin-bottom: 14px;
}

.bitrate-control,
.dialog-bitrate-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 70px auto;
  align-items: center;
  gap: 8px;
}

input[type="range"] {
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--signal);
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--surface-3);
  border: 1px solid var(--line);
}

input[type="range"]::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -7px;
  border: 2px solid var(--bg-0);
  border-radius: 0;
  background: var(--signal);
  box-shadow: 0 0 0 1px var(--signal);
  appearance: none;
  transition: transform 90ms var(--ease-state), background 140ms var(--ease-state);
}

input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(0.86);
  background: var(--focus);
}

.bitrate-input {
  width: 70px;
  height: 38px;
  padding: 0 8px;
  font-family: "IBM Plex Mono", monospace;
  text-align: right;
}

.meter-unit {
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
}

.inspector-note {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  line-height: 1.45;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-left: 1px solid var(--line);
}

.chat-head {
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--line);
}

.message-wrap {
  position: relative;
  min-height: 0;
}

.message-list {
  height: 100%;
  min-height: 0;
  padding: 10px 14px 14px;
  overflow: auto;
  scroll-behavior: smooth;
}

.message {
  padding: 9px 0;
}

.message.grouped {
  padding-top: 2px;
}

.message.grouped .message-meta {
  display: none;
}

.message-meta {
  min-height: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-family: "IBM Plex Mono", "PingFang SC", monospace;
  font-size: 10px;
}

.message-meta strong {
  max-width: 190px;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-bubble {
  width: fit-content;
  max-width: 92%;
  margin-top: 4px;
  padding: 8px 10px;
  border-left: 2px solid var(--info);
  color: var(--ink-strong);
  background: rgba(244, 242, 233, 0.04);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  transition: background 140ms var(--ease-state), border-color 140ms var(--ease-state);
}

.message:hover .message-bubble {
  background: rgba(244, 242, 233, 0.07);
}

.message.mine {
  display: grid;
  justify-items: end;
}

.message.mine .message-meta {
  width: 100%;
}

.message.mine .message-bubble {
  border-left: 0;
  border-right: 2px solid var(--signal);
  background: rgba(88, 212, 194, 0.07);
}

.time-separator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  color: var(--faint);
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
}

.time-separator::before,
.time-separator::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.system-message {
  margin: 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  font-family: "IBM Plex Mono", "PingFang SC", monospace;
  font-size: 10px;
}

.system-message::before,
.system-message::after {
  content: "";
  width: 16px;
  height: 1px;
  background: var(--warning);
}

.chat-empty {
  margin-top: 12px;
}

.unread-button {
  position: absolute;
  left: 50%;
  bottom: 10px;
  min-height: 36px;
  padding: 0 12px;
  color: var(--bg-0);
  background: var(--warning);
  border-color: var(--warning);
  font-size: 12px;
  font-weight: 700;
  transform: translateX(-50%);
  box-shadow: var(--shadow-overlay);
}

.unread-button.is-pressing,
.unread-button:active {
  transform: translate(-50%, 1px);
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
}

.send-button {
  min-width: 44px;
  width: 44px;
  padding: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(8px);
  transition: opacity 140ms var(--ease-state);
}

.modal-backdrop.is-open {
  opacity: 1;
}

.modal-backdrop.is-closing {
  opacity: 0;
}

.share-modal {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface-1);
  box-shadow: var(--shadow-overlay);
  transform: translateY(8px);
  opacity: 0;
  transition: transform 200ms var(--ease-enter), opacity 140ms var(--ease-state);
}

.modal-backdrop.is-open .share-modal {
  transform: translateY(0);
  opacity: 1;
}

.modal-backdrop.is-closing .share-modal {
  transform: translateY(6px);
  opacity: 0;
  transition-duration: 140ms;
  transition-timing-function: var(--ease-exit);
}

.modal-spine {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--signal);
}

.modal-head {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 12px 17px;
  border-bottom: 1px solid var(--line);
}

.share-summary {
  margin: 14px;
  padding: 12px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  background: var(--bg-1);
}

.summary-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(88, 212, 194, 0.42);
  color: var(--signal);
}

.share-summary > span:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.share-summary strong,
.share-summary small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-summary strong {
  color: var(--ink-strong);
}

.share-summary small,
.capture-note,
.dialog-label {
  color: var(--muted);
  font-size: 12px;
}

.dialog-section {
  margin: 14px;
  display: grid;
  gap: 8px;
}

.dialog-quality {
  grid-template-columns: repeat(3, 1fr);
}

.dialog-source {
  height: 44px;
  grid-template-columns: repeat(2, 1fr);
}

.dialog-source button {
  min-width: 0;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.dialog-source button svg {
  width: 16px;
  height: 16px;
}

.dialog-bitrate-row {
  grid-template-columns: minmax(120px, 1fr) 70px;
}

.dialog-switches {
  margin: 0 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dialog-switch {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: var(--bg-1);
}

.dialog-switch.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* OBS virtual camera carries video only. This single-layer control surface is
   reserved for an explicit virtual-audio input; script owns permission and the
   device lifecycle so the UI never implies that a microphone was auto-picked. */
.obs-audio-panel {
  margin: 12px 14px 0;
  padding: 12px 0 0;
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
}

.obs-audio-label {
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.obs-audio-controls {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.obs-audio-controls select {
  min-width: 0;
  height: 44px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  outline: none;
  color: var(--ink-strong);
  background: var(--bg-0);
  font: inherit;
  text-overflow: ellipsis;
  transition: border-color 140ms var(--ease-state), background 140ms var(--ease-state);
}

.obs-audio-controls select:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: #0a0d0e;
}

.obs-audio-controls select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.obs-audio-refresh {
  min-width: 188px;
  height: 44px;
  white-space: nowrap;
}

.obs-audio-device-status {
  min-height: 18px;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.5;
}

.capture-note {
  margin: 10px 14px 0;
  line-height: 1.5;
}

.capability-note {
  padding: 9px 10px;
  border-left: 2px solid var(--info);
  background: rgba(122, 183, 232, 0.08);
}

.modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: var(--surface-1);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  width: min(380px, calc(100vw - 36px));
  min-height: 48px;
  padding: 9px 12px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--info);
  border-radius: 4px;
  color: var(--ink-strong);
  background: var(--surface-1);
  box-shadow: var(--shadow-overlay);
  transform: translateY(14px);
  opacity: 0;
  pointer-events: none;
  transition: transform 200ms var(--ease-enter), opacity 140ms var(--ease-state);
}

.toast[data-type="success"] { border-left-color: var(--signal); }
.toast[data-type="warning"] { border-left-color: var(--warning); }
.toast[data-type="error"] { border-left-color: var(--live); }

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--info);
}

.toast[data-type="success"] .toast-icon { color: var(--signal); }
.toast[data-type="warning"] .toast-icon { color: var(--warning); }
.toast[data-type="error"] .toast-icon { color: var(--live); }

.update-banner {
  position: relative;
  grid-row: 1;
  justify-self: center;
  z-index: 140;
  min-height: 44px;
  width: min(520px, calc(100vw - 24px));
  margin-bottom: 6px;
  padding: 7px 8px 7px 12px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--warning);
  border-radius: 4px;
  color: var(--ink-strong);
  background: var(--surface-1);
  box-shadow: var(--shadow-overlay);
}

.update-banner[hidden] {
  display: none;
}

.update-banner > svg {
  color: var(--warning);
}

.update-banner button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--warning);
  border-radius: 2px;
  color: var(--bg-0);
  background: var(--warning);
  font-weight: 700;
}

.panel-scrim,
.mobile-only,
.mobile-switcher {
  display: none;
}

@keyframes signal-travel {
  from { transform: translateY(0); }
  to { transform: translateY(420%); }
}

@keyframes aperture-spin {
  from { transform: translate(-50%, -50%) rotate(0); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes aperture-spin-reverse {
  from { transform: translate(-50%, -50%) rotate(360deg); }
  to { transform: translate(-50%, -50%) rotate(0); }
}

@keyframes live-marker {
  0%, 100% { opacity: 0.72; }
  50% { opacity: 1; }
}

@keyframes video-ready {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 1439px) {
  .workspace {
    grid-template-columns: 208px minmax(0, 1fr) 320px;
  }

  .control-bar {
    grid-template-columns: auto minmax(190px, 280px) minmax(160px, auto) auto;
  }
}

@media (max-width: 1099px) and (min-width: 900px) {
  .workspace {
    grid-template-columns: 76px minmax(0, 1fr) 288px;
  }

  .side-panel .panel-section {
    padding-inline: 8px;
  }

  .side-panel .section-head > div:first-child,
  .side-panel .meter-text,
  .side-panel .member-copy,
  .side-panel .member-status,
  .side-panel .live-badge {
    display: none;
  }

  .side-panel .section-head {
    justify-content: center;
  }

  .member-item {
    min-height: 52px;
    grid-template-columns: 42px;
    justify-content: center;
    padding: 5px;
  }

  .avatar {
    width: 42px;
    height: 42px;
  }

  .control-bar {
    grid-template-columns: auto minmax(168px, 1fr) auto;
  }

  .audio-switch {
    display: none;
  }
}

@media (max-width: 899px) {
  :root {
    --topbar-height: 52px;
  }

  .app-shell {
    min-height: 0;
    padding: 0 0 calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    border-inline: 0;
  }

  .brand-block {
    padding-left: 10px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .brand-mark b {
    font-size: 15px;
  }

  .brand-copy {
    display: none;
  }

  .room-status {
    gap: 8px;
  }

  .connection-pill {
    min-width: 36px;
    width: 36px;
    height: 36px;
    padding: 0;
  }

  .connection-pill > span {
    display: none;
  }

  .room-copy h2 {
    font-size: 16px;
  }

  .room-copy p {
    display: none;
  }

  .top-actions {
    gap: 4px;
    padding-right: 6px;
  }

  .top-actions .icon-button {
    width: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  .mobile-only {
    display: inline-flex;
  }

  body[data-joined="false"] #mobileMembersButton,
  body[data-joined="false"] #mobileChatButton,
  body[data-joined="false"] .mobile-switcher {
    display: none;
  }

  .entry-panel {
    grid-template-columns: 1fr;
    border-inline: 0;
  }

  .entry-visual {
    position: absolute;
    inset: 0;
    opacity: 0.54;
  }

  .broadcast-aperture-large {
    width: 144px;
    height: 144px;
    transform: translateY(-92px);
  }

  .join-terminal {
    position: relative;
    z-index: 2;
    width: min(420px, calc(100% - 32px));
    justify-self: center;
    align-self: end;
    margin: 0 16px 24px;
    padding: 22px 0;
    background: rgba(7, 9, 10, 0.78);
  }

  .join-copy h2 {
    font-size: 24px;
  }

  .join-button {
    width: 100%;
  }

  .workspace {
    position: relative;
    grid-template-columns: 1fr;
    border-inline: 0;
    border-bottom: 0;
  }

  .stage-panel {
    grid-column: 1;
    grid-row: 1;
  }

  .drawer {
    position: fixed;
    top: var(--topbar-height);
    bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
    z-index: 60;
    width: min(92vw, 420px);
    display: grid;
    visibility: hidden;
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-overlay);
    transition: transform 280ms var(--ease-enter), visibility 280ms step-end;
  }

  .drawer-left {
    left: 0;
    transform: translateX(-102%);
  }

  .drawer-right {
    right: 0;
    transform: translateX(102%);
  }

  body[data-mobile-panel="members"] .drawer-left,
  body[data-mobile-panel="chat"] .drawer-right {
    visibility: visible;
    transform: translateX(0);
    transition: transform 280ms var(--ease-enter), visibility 0ms;
  }

  .panel-scrim {
    position: fixed;
    inset: var(--topbar-height) 0 calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
    z-index: 55;
    display: block;
    border: 0;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.45);
    animation: scrim-in 180ms ease-out both;
  }

  .panel-section {
    overflow: auto;
  }

  .stage-toolbar {
    top: 6px;
    left: 7px;
    right: 7px;
    min-height: 44px;
    padding: 5px 6px 5px 9px;
  }

  .stage-heading {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .stage-heading > p:last-child {
    display: none;
  }

  .view-toggle {
    grid-template-columns: repeat(2, 40px);
  }

  .view-toggle button {
    width: 40px;
    padding: 0;
  }

  .view-toggle button span {
    display: none;
  }

  .video-grid {
    padding: 56px 7px 116px;
  }

  .grid-layout {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(180px, 1fr);
  }

  .thumbnail-rail {
    grid-auto-columns: minmax(150px, 190px);
  }

  .control-bar {
    left: 7px;
    right: 7px;
    bottom: 6px;
    min-height: 104px;
    grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) 44px;
    grid-template-rows: 44px 44px;
    gap: 5px;
    padding: 5px;
  }

  .stream-actions {
    grid-column: 1;
    grid-row: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .stream-actions button {
    min-width: 0;
    width: 100%;
    gap: 5px;
    padding-inline: 8px;
    font-size: 12px;
    white-space: nowrap;
  }

  .quality-group {
    grid-column: 2 / 4;
    grid-row: 1;
  }

  .audio-switch {
    grid-column: 1 / 3;
    grid-row: 2;
    min-height: 40px;
    padding: 0 8px;
    border: 1px solid var(--line);
    background: var(--surface-1);
  }

  .inspector-button {
    grid-column: 3;
    grid-row: 2;
    min-width: 44px;
    width: 44px;
    padding: 0;
    justify-content: center;
  }

  .inspector-copy,
  .inspector-chevron {
    display: none;
  }

  .control-inspector {
    right: 0;
    bottom: calc(100% + 6px);
    width: min(360px, calc(100vw - 14px));
  }

  .mobile-switcher {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line-strong);
    background: rgba(7, 9, 10, 0.97);
  }

  .mobile-switcher button {
    min-height: 48px;
    display: grid;
    grid-template-columns: 20px auto;
    align-content: center;
    color: var(--muted);
    background: transparent;
  }

  .mobile-switcher button.active {
    color: var(--bg-0);
    background: var(--signal);
    font-weight: 700;
  }

  .toast {
    right: 10px;
    bottom: calc(var(--mobile-nav-height) + 10px + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 20px);
  }
}

@keyframes scrim-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 560px) {
  .stage-heading .eyebrow {
    display: none;
  }

  .stage-heading {
    grid-template-columns: minmax(0, 1fr);
  }

  .audio-status-text {
    margin-left: auto;
    max-width: 33vw;
  }

  .tile-label {
    bottom: 30px;
  }

  .tile-meta {
    max-width: calc(100% - 16px);
    font-size: 9px;
  }

  .message-bubble {
    max-width: 100%;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .share-modal {
    width: 100%;
    max-height: calc(100dvh - 12px);
    border-radius: 4px 4px 0 0;
  }

  .dialog-switches {
    grid-template-columns: 1fr;
  }

  .obs-audio-controls {
    grid-template-columns: 1fr;
  }

  .obs-audio-refresh {
    width: 100%;
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .modal-actions button {
    width: 100%;
  }
}

@media (orientation: landscape) and (max-height: 499px) and (max-width: 899px) {
  :root {
    --topbar-height: 44px;
    --mobile-nav-height: 52px;
  }

  .app-shell {
    padding-right: var(--mobile-nav-height);
    padding-bottom: 0;
  }

  .topbar {
    position: fixed;
    left: 0;
    right: var(--mobile-nav-height);
    top: 0;
    height: var(--topbar-height);
  }

  /* A pending update temporarily restores the normal grid flow so the status
     row, topbar, and stage remain distinct even on short landscape phones. */
  body[data-update-required="true"] .topbar {
    position: relative;
    inset: auto;
  }

  .workspace,
  .entry-panel {
    margin-top: var(--topbar-height);
  }

  body[data-update-required="true"] .workspace,
  body[data-update-required="true"] .entry-panel {
    margin-top: 0;
  }

  .mobile-switcher {
    left: auto;
    top: 0;
    width: var(--mobile-nav-height);
    height: 100dvh;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, 1fr);
    padding: 4px;
    border-top: 0;
    border-left: 1px solid var(--line-strong);
  }

  .mobile-switcher button {
    grid-template-columns: 1fr;
    place-items: center;
  }

  .mobile-switcher button span {
    display: none;
  }

  .drawer {
    top: var(--topbar-height);
    right: var(--mobile-nav-height);
    bottom: 0;
  }

  .drawer-left {
    right: auto;
  }

  .panel-scrim {
    inset: var(--topbar-height) var(--mobile-nav-height) 0 0;
  }

  .stage-toolbar {
    top: 4px;
  }

  .control-bar {
    left: 6px;
    right: 6px;
    bottom: 4px;
    min-height: 48px;
    grid-template-columns: auto minmax(180px, 1fr) auto auto;
    grid-template-rows: 40px;
  }

  .stream-actions,
  .quality-group,
  .audio-switch,
  .inspector-button {
    grid-column: auto;
    grid-row: 1;
  }

  .audio-switch {
    min-width: 42px;
    padding: 0 8px;
  }

  .audio-switch > span:not(.switch-track),
  .audio-switch > svg {
    display: none;
  }

  .video-grid {
    padding: 54px 6px 58px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
  }

  .drawer,
  .stage-hud,
  .share-modal,
  .toast,
  .switch-track span,
  .inspector-chevron,
  button,
  .member-item {
    transform: none !important;
    transition-duration: 80ms !important;
    transition-property: opacity, color, background, border-color !important;
  }

  .signal-spine span,
  .ring-a,
  .ring-b,
  .ring-c,
  .live-badge {
    animation: none !important;
  }
}
