:root {
  --bg: #101418;
  --panel: #171d22;
  --panel-2: #20282f;
  --line: #303b44;
  --text: #f4f7f8;
  --muted: #9eaab2;
  --accent: #00b894;
  --danger: #ff4d5d;
  --warn: #f5b942;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  width: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.brand {
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #06110e;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.tool-nav {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.nav-item {
  display: grid;
  gap: 6px;
  min-height: 66px;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}

.nav-item.active,
.nav-item:hover {
  background: var(--panel-2);
  color: var(--text);
}

[data-icon] {
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
}

[data-icon] svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.panel {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 18px;
}

.panel.active {
  display: block;
}

.panel-head,
.section-title,
.topbar,
.control-deck {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  letter-spacing: 0;
}

h2 {
  font-size: 15px;
}

.source-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 16px 0;
}

.source-actions button,
#copyInviteBtn,
.inspector button,
.comment-compose button,
.overlay-compose button,
#clearCommentBtn,
.broadcast-actions button,
#recordBtn,
#liveBtn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-weight: 700;
}

.source-actions button:hover,
#copyInviteBtn:hover,
.broadcast-actions button:hover,
.layout-btn:hover,
.icon-button:hover {
  filter: brightness(1.14);
}

.source-list,
.recording-list,
.scene-list,
.comment-list,
.overlay-list,
.relay-status-list,
.guest-grid {
  display: grid;
  gap: 10px;
}

.source-card {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11171b;
}

.source-card.selected-source {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}

.inspector,
.comment-compose,
.overlay-compose,
.scene-editor {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11171b;
}

.inspector h2 {
  margin-bottom: 10px;
}

.inspector button,
.comment-compose button,
.overlay-compose button,
.scene-editor button,
#clearCommentBtn {
  width: 100%;
  margin-top: 12px;
}

.source-card.hidden-source {
  opacity: 0.5;
}

.thumb {
  position: relative;
  overflow: hidden;
  width: 68px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: #050708;
}

.thumb video,
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.source-meta {
  min-width: 0;
}

.source-meta strong,
.source-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-meta span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.source-controls {
  display: flex;
  gap: 4px;
}

.icon-button,
.layout-btn {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--panel-2);
}

.layout-btn.active {
  background: var(--accent);
  color: #06110e;
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: #10161a;
  color: var(--text);
  padding: 11px 12px;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field input[type="color"] {
  height: 42px;
  padding: 4px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--text);
  font-size: 14px;
}

.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.hint,
.empty {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.destination-list {
  margin-top: 8px;
}

.stage-area {
  display: grid;
  min-width: 0;
  min-height: 0;
  height: 100dvh;
  grid-template-rows: auto minmax(0, 1fr) auto minmax(0, 140px);
  gap: 10px;
  padding: 16px 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(0, 184, 148, 0.12), transparent 30%),
    #0d1114;
}

.eyebrow {
  margin-bottom: 3px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-strip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 29, 34, 0.72);
  font-size: 13px;
  font-weight: 700;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
}

.status-dot.live {
  background: var(--danger);
  box-shadow: 0 0 0 7px rgba(255, 77, 93, 0.16);
}

.program-wrap {
  position: relative;
  display: grid;
  min-height: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  place-items: center;
}

.browser-overlay-layer {
  position: absolute;
  inset: auto;
  width: min(100%, calc((100vh - 330px) * 16 / 9));
  max-width: 100%;
  aspect-ratio: 16 / 9;
  justify-self: center;
  align-self: center;
  pointer-events: none;
}

.browser-overlay-layer iframe {
  position: absolute;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  transform-origin: top left;
}

#programCanvas {
  width: min(100%, calc((100vh - 330px) * 16 / 9));
  height: auto;
  max-height: calc(100vh - 330px);
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #050708;
  box-shadow: var(--shadow);
}

.program-empty {
  position: absolute;
  display: grid;
  gap: 8px;
  place-items: center;
  pointer-events: none;
  color: var(--muted);
  text-align: center;
}

.program-empty strong {
  color: var(--text);
  font-size: clamp(18px, 3vw, 32px);
}

.program-empty.hidden {
  display: none;
}

.control-deck {
  min-height: 58px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 29, 34, 0.82);
}

.layout-controls,
.broadcast-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

#recordBtn.recording {
  background: var(--danger);
}

#liveBtn {
  background: var(--accent);
  color: #06110e;
}

#liveBtn.live {
  background: var(--danger);
  color: #fff;
}

.guest-row {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.guest-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  margin-top: 10px;
}

.guest-tile {
  position: relative;
  overflow: hidden;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #172229, #22282e);
}

.guest-tile video,
.guest-tile img {
  width: 100%;
  height: 100%;
  min-height: 104px;
  object-fit: cover;
}

.guest-label {
  position: absolute;
  left: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  overflow: hidden;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.58);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
}

.recording-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11171b;
}

.relay-status-list {
  margin-top: 14px;
}

.relay-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11171b;
}

.relay-card strong,
.relay-card span,
.relay-card p {
  display: block;
}

.relay-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

.relay-card p {
  margin-top: 8px;
  color: var(--warn);
  font-size: 12px;
  line-height: 1.4;
}

.scene-card,
.comment-card,
.overlay-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11171b;
}

.scene-card-actions,
.overlay-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.scene-picker-block {
  margin-top: 14px;
}

.picker-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.picker-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10161a;
  font-size: 13px;
}

.picker-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.scene-card strong,
.scene-card span,
.comment-card strong,
.comment-card span,
.comment-card p,
.overlay-card strong,
.overlay-card span {
  display: block;
}

.scene-card span,
.comment-card span,
.overlay-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  text-transform: capitalize;
}

.comment-card p {
  margin-top: 8px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.scene-card button,
.comment-card button,
.overlay-card button,
.template-chip {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--accent);
  color: #06110e;
  font-weight: 800;
}

.overlay-grid-controls {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.template-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.template-chip {
  background: var(--panel-2);
  color: var(--text);
}

.panel-subhead {
  margin: 14px 0 10px;
}

.comment-card.active-comment {
  border-color: var(--accent);
}

.recording-item a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(300px, 38dvh) minmax(0, 1fr);
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .sidebar {
    min-height: 0;
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    padding: 14px 18px;
  }

  .tool-nav {
    grid-template-columns: repeat(7, minmax(74px, 1fr));
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 10px;
    scrollbar-width: thin;
  }

  .nav-item {
    min-height: 56px;
    gap: 4px;
    font-size: 10px;
  }

  .panel {
    max-height: none;
  }

  .stage-area {
    height: auto;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) auto minmax(0, 120px);
  }

  #programCanvas {
    width: min(100%, calc((62dvh - 300px) * 16 / 9));
    height: auto;
    max-width: 100%;
    max-height: calc(62dvh - 300px);
  }

  .browser-overlay-layer {
    width: min(100%, calc((62dvh - 300px) * 16 / 9));
    height: auto;
    max-width: 100%;
    max-height: calc(62dvh - 300px);
  }
}

@media (max-width: 560px) {
  .brand,
  .topbar,
  .control-deck,
  .section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .tool-nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .source-actions {
    grid-template-columns: 1fr;
  }

  .stage-area {
    padding: 12px;
  }

  .broadcast-actions button,
  #copyInviteBtn {
    flex: 1;
  }
}

/* StreamMaster Pro redesign */
:root {
  --bg: #0b0e11;
  --panel: #15191c;
  --panel-2: #1c2023;
  --panel-3: #262a2e;
  --line: rgba(255, 255, 255, 0.06);
  --text: #e0e3e7;
  --muted: #9ca3af;
  --accent: #bbc3ff;
  --accent-strong: #3d5afe;
  --tertiary: #00e475;
  --danger: #ffb4ab;
  --warn: #ffdad7;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
}

body {
  background: var(--bg);
  font-family: Geist, Inter, system-ui, sans-serif;
}

.view-hidden {
  display: none !important;
}

.home-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #191919;
  color: #f7f7fb;
}

.home-sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px 20px 14px;
  background: #050505;
  color: #f5f7ff;
}

.home-account,
.home-workspace,
.home-invite,
.home-nav button,
.home-workspace-head,
.home-sidebar-foot {
  display: flex;
  align-items: center;
}

.home-account {
  gap: 10px;
  margin-bottom: 26px;
}

.home-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #2d2d31;
  font-size: 13px;
  font-weight: 700;
}

.home-account-copy {
  min-width: 0;
}

.home-account-copy strong,
.home-account-copy span {
  display: block;
}

.home-account-copy strong {
  overflow: hidden;
  max-width: 134px;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-account-copy span {
  margin-top: 3px;
  color: #fafafa;
  font-size: 12px;
}

.home-icon-button,
.home-workspace-head button {
  margin-left: auto;
  background: transparent;
  color: #aab0ba;
}

.home-icon-button .material-symbols-outlined {
  font-size: 18px;
}

.home-invite {
  gap: 10px;
  width: 100%;
  min-height: 30px;
  margin-bottom: 20px;
  background: transparent;
  color: #f1f4ff;
  font-size: 14px;
}

.home-invite .material-symbols-outlined,
.home-nav .material-symbols-outlined {
  width: 20px;
  font-size: 19px;
}

.home-workspace-head {
  justify-content: space-between;
  margin-bottom: 12px;
  color: #dce6ff;
  font-size: 12px;
  font-weight: 700;
}

.home-workspace-head button {
  color: #e2e7f3;
  font-size: 12px;
}

.home-workspace {
  gap: 10px;
  width: 100%;
  min-height: 22px;
  margin-bottom: 12px;
  background: transparent;
  color: #eaf0ff;
  font-size: 14px;
  text-align: left;
}

.home-workspace > span:first-child {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 4px;
  background: #202124;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.home-workspace .material-symbols-outlined {
  margin-left: auto;
  color: #9aa1ac;
  font-size: 18px;
}

.home-nav {
  display: grid;
  gap: 2px;
}

.home-nav button {
  position: relative;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 0 26px;
  border-radius: 7px;
  background: transparent;
  color: #e8eefc;
  font-size: 14px;
  text-align: left;
}

.home-nav button.active,
.home-nav button:hover {
  background: #202020;
  color: #fff;
}

.home-nav small {
  display: grid;
  width: 20px;
  height: 20px;
  margin-left: auto;
  place-items: center;
  border-radius: 5px;
  background: #5a2f2f;
  color: #ffdad7;
  font-size: 11px;
  font-weight: 800;
}

.home-sidebar-foot {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: auto;
  color: #8c929e;
  font-size: 12px;
}

.home-sidebar-foot a {
  color: inherit;
  text-decoration: none;
}

.home-main {
  position: relative;
  min-width: 0;
  padding: 20px 82px 0 88px;
  overflow: hidden;
  background: #1a1a1a;
}

.home-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.home-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.home-tabs button {
  min-height: 31px;
  padding: 0 11px;
  border-radius: 18px;
  background: transparent;
  color: #dfe8f9;
  font-size: 14px;
  font-weight: 700;
}

.home-tabs button.active {
  background: #444446;
  color: #fff;
}

.new-stream-btn {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 4px;
  padding: 0 16px 0 12px;
  border-radius: 20px;
  background: #434343;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.new-stream-btn:hover {
  background: #505050;
}

.new-stream-btn .material-symbols-outlined {
  font-size: 19px;
  font-weight: 700;
}

.streams-table {
  min-width: 0;
}

.streams-head,
.stream-row {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 150px 150px 210px;
  align-items: center;
  gap: 0;
}

.streams-head {
  min-height: 34px;
  border-bottom: 1px solid #272727;
  color: #aab0ba;
  font-size: 14px;
}

.streams-list {
  display: grid;
}

.stream-row {
  min-height: 92px;
  border-bottom: 1px solid #242424;
  background: transparent;
  color: #fff;
  text-align: left;
}

.stream-row:hover {
  background: #1f1f1f;
}

.stream-title-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.stream-thumb {
  position: relative;
  display: grid;
  width: 125px;
  height: 70px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 3px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 40%),
    radial-gradient(circle at 70% 35%, rgba(255, 255, 255, 0.16), transparent 14%),
    linear-gradient(150deg, #030303, #1c1c1c 55%, #080808);
}

.stream-thumb .material-symbols-outlined {
  color: #d8dce6;
  font-size: 22px;
}

.stream-thumb small {
  position: absolute;
  right: 7px;
  bottom: 6px;
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 4px;
  background: #202020;
  color: #b8bfca;
}

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

.stream-copy strong,
.stream-copy span {
  display: block;
}

.stream-copy strong {
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.stream-copy span {
  margin-top: 6px;
  color: #dbe9ff;
  font-size: 13px;
}

.stream-status {
  justify-self: start;
  padding: 4px 7px;
  border-radius: 4px;
  background: #24242a;
  color: #9397a2;
  font-size: 12px;
}

.stream-channel {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 2px solid #d8dbe4;
  border-radius: 50%;
  background: #f8fafc;
  color: #111;
  font-size: 13px;
  font-weight: 900;
}

.stream-edited {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  color: #b9caff;
  font-size: 13px;
}

.stream-menu {
  color: #aeb4be;
  font-size: 20px;
}

.empty-streams {
  padding: 40px 8px;
  color: #9aa1ac;
  font-size: 14px;
}

.help-bubble {
  position: fixed;
  right: 16px;
  bottom: 20px;
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 50%;
  background: #2b2b2b;
  color: #d8d8d8;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.prejoin-shell {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #1a1a1a;
  color: #f7f7fb;
}

.prejoin-brand {
  position: absolute;
  top: 32px;
  left: 26px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 21px;
  z-index: 2;
}

.prejoin-brand strong {
  font-weight: 900;
}

.prejoin-brand span {
  color: #f4f4f4;
  font-weight: 400;
}

.prejoin-main {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 500px;
  gap: 84px;
  width: min(960px, calc(100% - 72px));
  height: 100%;
  margin: 0 auto;
  align-items: center;
}

.prejoin-info {
  display: grid;
  justify-items: center;
  text-align: center;
}

.prejoin-orb {
  width: 76px;
  height: 76px;
  margin-bottom: 116px;
  border-radius: 50%;
  background: #2d5f62;
}

.prejoin-host-line {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 18px;
  color: #fff;
  font-size: 15px;
}

.prejoin-host-line span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: #333;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.prejoin-host-line strong {
  font-weight: 900;
}

.prejoin-info h1 {
  max-width: 440px;
  margin-bottom: 26px;
  color: #f3f3f3;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
}

.prejoin-copy {
  display: inline-flex;
  min-width: 200px;
  min-height: 37px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 7px;
  background: #333;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.prejoin-copy .material-symbols-outlined {
  font-size: 20px;
}

.prejoin-card {
  width: 500px;
  padding: 26px 28px 28px;
  border-radius: 24px;
  background: #f7f8fa;
  color: #061b3f;
}

.prejoin-card h2 {
  margin-bottom: 20px;
  text-align: center;
  color: #06224f;
  font-size: 22px;
  font-weight: 900;
}

.prejoin-preview {
  position: relative;
  height: 250px;
  overflow: hidden;
  border-radius: 4px;
  background: #1b1b1b;
}

.prejoin-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prejoin-preview video.mirrored,
.settings-preview video.mirrored {
  transform: scaleX(-1);
}

.prejoin-avatar-preview {
  position: absolute;
  top: 64px;
  left: 50%;
  display: none;
  width: 124px;
  height: 124px;
  place-items: center;
  transform: translateX(-50%);
  border: 5px solid #a4a6aa;
  border-radius: 50%;
  color: #fff;
  font-size: 40px;
  font-weight: 900;
}

.prejoin-avatar-preview.active {
  display: grid;
}

.prejoin-preview-copy {
  position: absolute;
  left: 18px;
  bottom: 17px;
  display: grid;
  gap: 3px;
  color: #fff;
  text-align: left;
}

.prejoin-preview-copy strong {
  font-size: 16px;
  font-weight: 900;
}

.prejoin-preview-copy span {
  font-size: 12px;
  font-weight: 700;
}

.prejoin-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px 0 22px;
}

.prejoin-controls button {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid #e4e8ef;
  border-radius: 50%;
  background: #fff;
  color: #0d2a56;
}

.prejoin-controls button.off {
  color: #ff5d42;
}

.prejoin-controls .material-symbols-outlined {
  font-size: 22px;
}

.prejoin-fields label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.prejoin-fields span {
  color: #526489;
  font-size: 13px;
  font-weight: 800;
}

.prejoin-fields small {
  color: #8d98ae;
  font-weight: 500;
}

.prejoin-fields input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #aeb9cf;
  border-radius: 10px;
  background: #fff;
  color: #061b3f;
  padding: 0 16px;
}

.prejoin-fields input:focus,
.settings-field select:focus {
  border-color: #2e6bf5;
  outline: 0;
  box-shadow: 0 0 0 1px #2e6bf5;
}

.prejoin-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr);
  gap: 8px;
}

.enter-studio-btn {
  width: 100%;
  min-height: 49px;
  margin-top: 20px;
  border-radius: 10px;
  background: #2f6df6;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
}

.prejoin-login-line {
  position: absolute;
  right: calc(50% - 462px);
  bottom: 118px;
  color: #c7c7c7;
  font-size: 15px;
}

.prejoin-login-line strong {
  color: #fff;
}

.prejoin-login-line button {
  padding: 0;
  background: transparent;
  color: #e7e7e7;
  text-decoration: underline;
}

.prejoin-copyright {
  position: absolute;
  left: 16px;
  bottom: 18px;
  color: #8e8e8e;
  font-size: 14px;
}

.prejoin-settings-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
}

.prejoin-settings-modal[hidden] {
  display: none;
}

.prejoin-settings-card {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  width: min(800px, calc(100vw - 48px));
  max-height: min(614px, calc(100dvh - 48px));
  overflow: auto;
  border-radius: 9px;
  background: #fff;
  color: #11264b;
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.48);
}

.prejoin-settings-nav {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 26px 12px 24px 12px;
}

.prejoin-settings-head h2 {
  margin: 0 0 10px 12px;
  color: #192d50;
  font-size: 22px;
  font-weight: 900;
}

.prejoin-settings-nav button {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 16px;
  gap: 8px;
  min-height: 40px;
  align-items: center;
  padding: 0 12px;
  border-radius: 7px;
  background: transparent;
  color: #203559;
  font-size: 15px;
  text-align: left;
}

.prejoin-settings-nav button.active {
  background: #dbe8ff;
  color: #071f49;
  font-weight: 900;
}

.prejoin-settings-nav button .material-symbols-outlined {
  font-size: 20px;
}

.prejoin-settings-nav .embed-stream-btn {
  grid-template-columns: 20px minmax(0, 1fr);
  width: max-content;
  margin-top: auto;
  border: 1px solid #1c65ff;
  color: #075eff;
  font-weight: 800;
}

.prejoin-settings-main {
  position: relative;
  padding: 66px 68px 42px 42px;
}

.prejoin-settings-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  color: #9aa4b3;
}

.settings-preview {
  position: relative;
  height: 248px;
  margin-bottom: 18px;
  overflow: hidden;
  border-radius: 5px;
  background: #1b1b1b;
}

.settings-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.settings-avatar-preview {
  position: absolute;
  top: 64px;
  left: 50%;
  display: none;
  width: 122px;
  height: 122px;
  place-items: center;
  transform: translateX(-50%);
  border: 5px solid #a4a6aa;
  border-radius: 50%;
  color: #fff;
  font-size: 38px;
  font-weight: 900;
}

.settings-avatar-preview.active {
  display: grid;
}

.settings-field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.settings-field span {
  color: #8490a8;
  font-size: 14px;
}

.settings-field small,
.settings-toggle small {
  color: #96a0b5;
  font-size: 12px;
}

.settings-field select {
  width: 100%;
  min-height: 43px;
  padding: 0 12px;
  border: 1px solid #aab5c9;
  border-radius: 4px;
  background: #fff;
  color: #12294f;
}

.settings-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #24385d;
  font-size: 14px;
}

.settings-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-toggle span {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #c8d0dc;
}

.settings-toggle span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.settings-toggle input:checked + span {
  background: #0f63f6;
}

.settings-toggle input:checked + span::after {
  transform: translateX(16px);
}

.compact-hidden-field {
  display: none;
}

.studio-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-rows: 64px minmax(0, 1fr) 72px;
  grid-template-areas:
    "top top"
    "stage tools"
    "controls tools";
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 35% 30%, rgba(61, 90, 254, 0.12), transparent 28%),
    radial-gradient(circle at 80% 70%, rgba(0, 228, 117, 0.08), transparent 30%),
    var(--bg);
}

.studio-topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: #101417;
  z-index: 5;
}

.studio-topbar .brand {
  padding: 0;
  border: 0;
}

.studio-topbar .brand strong {
  color: var(--accent);
  font-size: 20px;
  letter-spacing: -0.01em;
}

.studio-topbar .brand span {
  color: #c5c5d9;
}

.brand-mark {
  border-radius: 8px;
  background: #00d395;
  color: #001d10;
}

.topbar-center {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 180px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-3);
  color: var(--muted);
  font-size: 13px;
}

.topbar-center .material-symbols-outlined,
.material-button .material-symbols-outlined,
.tools-header .material-symbols-outlined,
.stage-meta .material-symbols-outlined {
  font-size: 20px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.material-button,
.profile-chip {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
}

.material-button:hover {
  background: var(--panel-3);
  color: var(--accent);
}

.profile-chip {
  background: var(--panel-3);
  border: 1px solid var(--line);
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 700;
}

.auth-modal,
.device-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 7, 8, 0.68);
  backdrop-filter: blur(12px);
}

.auth-modal.active,
.device-modal.active {
  display: flex;
}

.auth-card,
.device-card {
  width: min(420px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #15191c;
  box-shadow: var(--shadow);
}

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

.auth-head h2 {
  font-size: 22px;
}

.auth-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

#authSubmitBtn,
#authModeToggle,
#deviceSetupSubmitBtn {
  display: inline-flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  border-radius: 8px;
  font-weight: 800;
}

#authSubmitBtn,
#deviceSetupSubmitBtn {
  background: var(--accent-strong);
  color: #f1f0ff;
}

#authModeToggle {
  background: var(--panel-2);
  color: var(--text);
}

.status-strip {
  min-height: 36px;
  border-color: var(--line);
  border-radius: 6px;
  background: var(--panel-3);
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
}

.status-dot.live {
  background: #ff4d5d;
}

.go-live {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 6px;
  background: #ffb4ab;
  color: #690005;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.go-live.live {
  background: #93000a;
  color: #ffdad6;
}

.stage-area {
  grid-area: stage;
  display: grid;
  height: auto;
  min-height: 0;
  padding: 12px 16px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
  background: transparent;
}

.stage-content {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  height: 100%;
  align-items: center;
  container-type: size;
  overflow: hidden;
}

.stage-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stage-heading h1 {
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.eyebrow {
  color: #00e475;
  font-family: "JetBrains Mono", monospace;
}

.stage-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(28, 32, 35, 0.75);
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.program-wrap {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 0;
  border-radius: 8px;
  aspect-ratio: 16 / 9;
  width: min(100%, calc(100cqh * 16 / 9));
  height: auto;
  max-height: 100%;
  align-self: center;
  justify-self: center;
  overflow: hidden;
}

#programCanvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(187, 195, 255, 0.35);
}

.browser-overlay-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  pointer-events: none;
  display: none;
}

.guest-row {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  padding-right: 0;
  overflow: hidden;
}

.guest-row .section-title {
  align-items: center;
  min-height: 36px;
}

.guest-row .section-title h2 {
  font-size: 15px;
}

.guest-row #copyInviteBtn {
  width: 34px;
  min-height: 34px;
  padding: 0;
}

.guest-grid {
  grid-template-columns: 1fr;
  align-content: start;
  min-height: 0;
  margin-top: 8px;
  overflow: hidden;
}

.guest-tile {
  min-height: 88px;
  max-height: 98px;
}

.guest-tile video,
.guest-tile img {
  min-height: 88px;
}

.guest-label {
  bottom: 6px;
  font-size: 11px;
}

.speaking-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.66);
  color: var(--tertiary);
  transition: opacity 0.15s ease;
}

.speaking-badge svg {
  width: 15px;
  height: 15px;
}

.audio-mixer {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: #101417;
}

.program-meter,
.audio-row {
  display: grid;
  gap: 8px;
}

.program-meter span,
.audio-row-main {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.meter-track,
.audio-mini-meter {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.meter-fill,
.audio-mini-meter div {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #00e475, #ffdad7, #ff4d5d);
  transition: width 0.08s linear;
}

.audio-mixer-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.audio-row {
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.audio-row-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.audio-row input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.section-title h2,
.panel-head h2,
.tools-header h2 {
  font-size: 16px;
  font-weight: 700;
}

.sidebar {
  grid-area: tools;
  position: relative;
  width: auto;
  min-height: 0;
  border-right: 0;
  border-left: 1px solid var(--line);
  background: #15191c;
}

.tools-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.tools-header p {
  display: none;
}

.tool-nav {
  display: flex;
  flex: 0 0 auto;
  overflow-x: auto;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid var(--line);
}

.nav-item {
  flex: 1 0 auto;
  min-width: 78px;
  min-height: 54px;
  border-radius: 0;
  color: #c5c5d9;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
}

.nav-item.active {
  color: var(--accent);
  background: rgba(61, 90, 254, 0.09);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.panel {
  padding: 12px;
}

.compact-hint {
  font-size: 12px;
  line-height: 1.35;
}

.source-actions {
  gap: 8px;
}

.source-actions button,
#copyInviteBtn,
#refreshDevicesBtn,
.settings-actions button,
.inspector button,
.comment-compose button,
.overlay-compose button,
.scene-editor button,
#clearCommentBtn,
.broadcast-actions button,
#recordBtn {
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
}

.settings-drawer {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: none;
  min-height: 0;
  flex-direction: column;
  background: #15191c;
  border-left: 1px solid var(--line);
}

.settings-drawer.active {
  display: flex;
}

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
}

.settings-head h2 {
  font-size: 18px;
}

.settings-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
}

.settings-group {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: #101417;
}

.settings-group h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 14px;
}

.settings-group .field:first-of-type,
.settings-group .toggle:first-of-type {
  margin-top: 0;
}

#refreshDevicesBtn {
  width: 100%;
  margin-top: 12px;
}

.settings-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  flex: 0 0 auto;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: rgba(21, 25, 28, 0.96);
}

.settings-actions button {
  min-height: 42px;
}

#saveSettingsBtn {
  background: var(--accent-strong);
  color: #f1f0ff;
}

.field input,
.field textarea,
.field select {
  border-color: rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: #0f1417;
}

.source-card,
.scene-card,
.comment-card,
.overlay-card,
.inspector,
.comment-compose,
.overlay-compose,
.scene-editor,
.recording-item,
.relay-card {
  border-color: rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: #101417;
}

.source-card.selected-source,
.comment-card.active-comment {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(187, 195, 255, 0.22), 0 0 18px rgba(61, 90, 254, 0.14);
}

.scene-card button,
.comment-card button,
.overlay-card button,
.template-chip {
  border-radius: 7px;
  background: var(--accent-strong);
  color: #f1f0ff;
}

.control-deck {
  grid-area: controls;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 0;
  margin: 0;
  padding: 8px 380px 8px 16px;
  border-width: 1px 0 0;
  border-radius: 0;
  background: rgba(38, 42, 46, 0.86);
  backdrop-filter: blur(14px);
  z-index: 4;
}

.layout-controls,
.broadcast-actions {
  align-items: center;
  justify-content: center;
}

.layout-btn,
.icon-button {
  border-radius: 8px;
  background: var(--panel-2);
}

.layout-btn.active {
  background: var(--accent-strong);
  color: #f1f0ff;
  box-shadow: 0 0 12px rgba(61, 90, 254, 0.35);
}

#recordBtn.recording {
  background: #93000a;
  color: #ffdad6;
}

.studio-shell {
  grid-template-columns: 160px minmax(0, 1fr) 80px;
  grid-template-rows: 55px minmax(0, 1fr) 140px;
  grid-template-areas:
    "top top top"
    "scenes stage rail"
    "scenes controls rail";
  background: #1a1a1a;
}

.studio-topbar {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(260px, 1fr) auto minmax(360px, 1fr);
  gap: 8px;
  padding: 0 10px 0 14px;
  background: #1b1b1b;
}

.studio-topbar .brand,
.topbar-center {
  display: none;
}

.studio-stream-title,
.studio-stream-title button,
.studio-orientation-tabs,
.studio-orientation-tabs button,
.stream-quality,
.quality-btn,
.topbar-actions {
  display: flex;
  align-items: center;
}

.studio-stream-title {
  gap: 32px;
  min-width: 0;
  color: #b5bdc8;
  font-size: 14px;
  font-weight: 800;
}

.studio-stream-title > span {
  overflow: hidden;
  max-width: 190px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-stream-title button,
.studio-orientation-tabs button,
.quality-btn {
  gap: 6px;
  background: transparent;
  color: #9aa4b0;
  font-size: 13px;
  font-weight: 800;
}

.studio-live-brand {
  justify-self: center;
  align-self: center;
  padding: 2px 6px;
  border-radius: 3px;
  background: #121212;
  color: #6f6f72;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.studio-live-brand span {
  padding: 1px 4px;
  border-radius: 2px;
  background: #383838;
  color: #bfbfbf;
  font-size: 13px;
}

.studio-orientation-tabs {
  position: absolute;
  top: 72px;
  left: 178px;
  z-index: 4;
  gap: 18px;
}

.studio-orientation-tabs .stream-channel {
  width: 31px;
  height: 31px;
}

.studio-orientation-tabs button.active {
  color: #fff;
}

.topbar-actions {
  justify-content: flex-end;
}

.go-pro-btn {
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid #7952d8;
  border-radius: 999px;
  background: #2b2444;
  color: #d9c9ff;
  font-size: 13px;
  font-weight: 900;
}

.stream-quality {
  display: grid;
  gap: 2px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
}

.stream-quality span {
  color: #a9b1bc;
  font-size: 10px;
}

.quality-btn {
  color: #a8b0bb;
}

.studio-topbar #studioSettingsBtn,
.studio-topbar .profile-chip,
.studio-topbar .status-strip {
  display: none;
}

.studio-topbar .go-live {
  min-width: 94px;
  border: 1px solid #8a3416;
  border-radius: 999px;
  background: #431706;
  color: #ff6c2c;
}

.restream-scene-rail {
  grid-area: scenes;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  padding: 16px 12px;
  border-right: 1px solid #2a2a2a;
  background: #191919;
}

.add-scene-btn {
  min-height: 37px;
  border-radius: 999px;
  background: #444;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.scene-mini {
  display: grid;
  gap: 7px;
}

.scene-mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 16px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.scene-mini.active .scene-mini-head {
  border-left: 3px solid #116dff;
  padding-left: 5px;
}

.scene-mini-thumb {
  position: relative;
  display: grid;
  height: 80px;
  place-items: center;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 8px;
  background:
    radial-gradient(circle at 40% 50%, rgba(255,255,255,.2), transparent 10%),
    linear-gradient(145deg, #050505, #202020 55%, #0d0d0d);
}

.scene-mini-thumb.camera-off {
  background: #171717;
}

.scene-mini-thumb.camera-off > .material-symbols-outlined {
  display: none;
}

.scene-mini-thumb.camera-off::before {
  content: "";
  position: absolute;
  inset: 20px 48px;
  border: 2px solid #9f9f9f;
  border-radius: 50%;
}

.scene-mini.active .scene-mini-thumb {
  border-color: #0f6bff;
  box-shadow: 0 0 0 1px rgba(15, 107, 255, 0.3);
}

.scene-mini-thumb .material-symbols-outlined {
  color: #b7bcc4;
}

.scene-mini-thumb small {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid #777;
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
}

.scene-mini-thumb.camera-off small {
  top: 50%;
  right: auto;
  left: 50%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}

.private-chat-btn {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: auto;
  border-radius: 999px;
  background: #252525;
  color: #e9e9e9;
  font-size: 14px;
}

.restream-right-rail {
  grid-area: rail;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 20px 10px;
  border-left: 1px solid #242424;
  background: #1a1a1a;
}

.restream-right-rail button {
  display: grid;
  gap: 5px;
  place-items: center;
  width: 62px;
  min-height: 42px;
  background: transparent;
  color: #e8e8e8;
  font-size: 11px;
  font-weight: 800;
}

.restream-right-rail .material-symbols-outlined {
  font-size: 23px;
}

.restream-right-rail .rail-avatar {
  width: 58px;
  height: 58px;
  min-height: 58px;
  border: 1px solid #333;
  border-radius: 50%;
  background: #020202;
}

.restream-right-rail .rail-avatar.small {
  position: relative;
  width: 56px;
  height: 56px;
  min-height: 56px;
  color: #fff;
}

.rail-avatar small {
  position: absolute;
  right: -2px;
  bottom: -7px;
  color: #fff;
}

.rail-spacer {
  flex: 1 1 auto;
}

.studio-shell .stage-area {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
  align-items: center;
  justify-content: center;
  padding: 60px clamp(24px, 4vw, 72px) 10px;
  overflow: hidden;
  background: #1a1a1a;
}

.studio-shell .stage-heading,
.studio-shell .guest-row {
  display: none;
}

.studio-shell .stage-content {
  display: flex;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  align-items: center;
  justify-content: center;
  overflow: visible;
  container-type: normal;
}

.studio-shell .program-wrap {
  position: relative;
  display: block;
  width: min(1208px, max(320px, calc(100vw - 340px)), calc((100dvh - 255px) * 16 / 9));
  min-width: min(100%, 320px);
  height: auto;
  min-height: 260px;
  aspect-ratio: 16 / 9;
  border: 1px solid #292929;
  border-radius: 8px;
  background: #1b1b1b;
  box-shadow: none;
  overflow: hidden;
}

.studio-shell #programCanvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 260px;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  border-radius: 8px;
  background: #1a1a1a;
  box-shadow: none;
}

.studio-shell .browser-overlay-layer {
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
}

.studio-shell .program-empty {
  inset: 0;
  z-index: 2;
  padding: 24px;
}

.studio-shell .program-wrap::before {
  content: "volume_off";
  position: absolute;
  top: 8px;
  left: 50%;
  z-index: 3;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  transform: translateX(-50%);
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  color: #d4d4d4;
  font-family: "Material Symbols Outlined";
  font-size: 21px;
}

.studio-shell .program-wrap::after {
  content: "fullscreen";
  position: absolute;
  right: 11px;
  bottom: 9px;
  z-index: 3;
  color: #f2f2f2;
  font-family: "Material Symbols Outlined";
  font-size: 25px;
}

.sidebar {
  position: fixed;
  top: 55px;
  right: 80px;
  bottom: 0;
  z-index: 8;
  display: block;
  width: 360px;
  min-height: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
}

.sidebar > .tools-header,
.sidebar > .tool-nav,
.sidebar > .panel:not(.settings-drawer) {
  display: none;
}

.settings-drawer {
  position: fixed;
  top: 55px;
  right: 80px;
  bottom: 0;
  left: auto;
  width: 360px;
  pointer-events: auto;
}

.control-deck {
  display: grid;
  grid-template-rows: 36px 56px;
  align-content: start;
  justify-content: center;
  gap: 12px;
  padding: 0 0 16px;
  border-top: 0;
  background: #1a1a1a;
}

.studio-layout-strip {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.studio-layout-strip button {
  width: 63px;
  height: 36px;
  border-radius: 5px;
  background: #2f2f2f;
  opacity: 0.86;
}

.studio-layout-strip button[data-layout-proxy="spotlight"] {
  background:
    linear-gradient(90deg, transparent 8%, #494949 8% 68%, transparent 68%),
    linear-gradient(#252525, #252525);
}

.studio-layout-strip button[data-layout-proxy="sidebar"] {
  background:
    linear-gradient(90deg, #444 0 48%, transparent 48% 54%, #383838 54% 100%),
    linear-gradient(#252525, #252525);
}

.studio-layout-strip button[data-layout-proxy="grid"] {
  background:
    linear-gradient(90deg, #444 0 48%, transparent 48% 52%, #444 52% 100%),
    linear-gradient(#252525, #252525);
}

.studio-layout-strip button[data-layout-proxy="pip"] {
  background:
    linear-gradient(90deg, #444 0 72%, transparent 72%),
    radial-gradient(circle at 84% 76%, #575757 0 16%, transparent 17%),
    linear-gradient(#252525, #252525);
}

.studio-layout-strip button.active {
  outline: 2px solid #0f6bff;
}

.layout-controls {
  display: none;
}

.broadcast-actions {
  gap: 12px;
  justify-content: center;
}

.broadcast-actions button,
#recordBtn {
  display: grid;
  width: 48px;
  height: 48px;
  min-height: 48px;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  background: #262626;
  color: #f5f5f5;
}

#muteBtn,
#studioCameraProxy {
  background: #fff1ee;
  color: #ff553c;
}

.broadcast-actions button span:not(.material-symbols-outlined):not([data-icon]) {
  display: none;
}

#recordBtn {
  display: none;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #313538;
  border-radius: 4px;
}

@media (max-width: 1180px) {
  .home-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .prejoin-main {
    grid-template-columns: minmax(300px, 1fr) minmax(420px, 500px);
    gap: 36px;
    width: calc(100% - 44px);
  }

  .prejoin-card {
    width: 100%;
  }

  .prejoin-login-line {
    right: 28px;
  }

  .home-main {
    padding-right: 34px;
    padding-left: 44px;
  }

  .streams-head,
  .stream-row {
    grid-template-columns: minmax(300px, 1fr) 120px 110px 170px;
  }

  .studio-shell {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .control-deck {
    padding-right: 340px;
  }

  .topbar-center {
    display: none;
  }
}

@media (max-width: 900px) {
  .home-shell {
    grid-template-columns: 1fr;
  }

  .prejoin-shell {
    overflow: auto;
  }

  .prejoin-brand {
    position: static;
    padding: 22px 20px;
  }

  .prejoin-main {
    grid-template-columns: 1fr;
    gap: 24px;
    width: min(520px, calc(100% - 32px));
    height: auto;
    padding-bottom: 120px;
  }

  .prejoin-orb {
    margin-bottom: 28px;
  }

  .prejoin-card {
    padding: 20px;
  }

  .prejoin-settings-card {
    grid-template-columns: 1fr;
    width: min(520px, calc(100vw - 28px));
  }

  .prejoin-settings-nav {
    padding: 18px 14px 8px;
  }

  .prejoin-settings-nav button:not(.active):not(.embed-stream-btn) {
    display: none;
  }

  .prejoin-settings-nav .embed-stream-btn {
    display: none;
  }

  .prejoin-settings-main {
    padding: 48px 18px 22px;
  }

  .settings-preview {
    height: 210px;
  }

  .prejoin-fields {
    grid-template-columns: 1fr;
  }

  .prejoin-login-line {
    position: static;
    margin: -88px 20px 64px;
    text-align: center;
  }

  .prejoin-copyright {
    position: static;
    display: block;
    margin: 0 20px 18px;
    text-align: center;
  }

  .home-sidebar {
    display: none;
  }

  .home-main {
    padding: 18px 18px 0;
  }

  .streams-head {
    display: none;
  }

  .stream-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px 0;
  }

  .stream-row > span:not(.stream-title-cell) {
    margin-left: 137px;
  }

  .studio-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 64px minmax(0, 1fr) minmax(240px, 36dvh) 72px;
    grid-template-areas:
      "top"
      "stage"
      "tools"
      "controls";
  }

  .studio-topbar {
    padding: 0 10px;
  }

  .topbar-actions .material-button,
  .profile-chip {
    display: none;
  }

  .sidebar {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

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

  .stage-content {
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 10px;
  }

  .guest-row {
    height: 100%;
  }

  .guest-row .section-title {
    min-height: 30px;
  }

  .guest-row .section-title h2 {
    font-size: 12px;
  }

  .guest-row #copyInviteBtn {
    width: 30px;
    min-height: 30px;
  }

  .guest-tile,
  .guest-tile video,
  .guest-tile img {
    min-height: 70px;
    max-height: 74px;
  }

  .browser-overlay-layer {
    width: 100%;
    height: 100%;
    max-height: 100%;
  }

  .control-deck {
    padding: 10px;
  }
}

@media (max-width: 620px) {
  .studio-topbar .brand span,
  .stage-meta,
  .status-strip {
    display: none;
  }

  .stage-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .go-live {
    padding: 0 10px;
  }

  .control-deck {
    gap: 10px;
  }
}
