:root {
  color-scheme: dark;
  --bg: #111318;
  --pane: #191d24;
  --pane-2: #202631;
  --line: #303844;
  --text: #eef3f8;
  --muted: #9eabb8;
  --cyan: #4cc9f0;
  --green: #80ed99;
  --yellow: #ffd166;
  --red: #ef476f;
  --ink: #0d1015;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: #151922;
  border-bottom: 1px solid var(--line);
}

.brand,
.join-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand strong,
.join-brand h1 {
  display: block;
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
}

.brand span:not(.brand-mark),
.join-brand p,
.pane-header span,
.empty-state,
.field-label {
  color: var(--muted);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #25313f;
  color: var(--green);
  font-weight: 800;
  border: 1px solid #3f4c5c;
}

.top-actions,
.button-row,
.effect-row,
.youtube-bar,
.sticker-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.meter-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #10141b;
  color: var(--muted);
  white-space: nowrap;
}

.online-menu-wrap {
  position: relative;
}

.online-pill {
  gap: 4px;
}

.online-pill:hover,
.online-pill[aria-expanded="true"] {
  border-color: #526171;
  background: #17202b;
  color: var(--text);
}

.online-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: min(280px, calc(100vw - 24px));
  max-height: min(430px, calc(100vh - 92px));
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #151a22;
  box-shadow: var(--shadow);
}

.online-list {
  display: grid;
  gap: 8px;
}

.online-empty {
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
}

.online-user {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101820;
}

.online-user .presence-avatar {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.online-user .presence-avatar.benchmark-trigger {
  cursor: pointer;
}

.online-user .presence-avatar.benchmark-trigger:hover,
.online-user .presence-avatar.benchmark-trigger:focus-visible {
  border-color: var(--yellow);
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.18);
}

.online-user-name {
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-user-meta {
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
}

.online-user .ghost-button {
  grid-column: 2;
  justify-self: start;
  min-height: 28px;
  margin-top: 5px;
  padding: 0 10px;
  font-size: 12px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(460px, 1fr) minmax(310px, 390px);
  gap: 12px;
  height: calc(100vh - 68px);
  padding: 12px;
  overflow: hidden;
}

.main-stage {
  display: grid;
  grid-template-rows: minmax(560px, 1.16fr) minmax(720px, 1.8fr) minmax(760px, 1.35fr) minmax(420px, 1fr);
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.tool-pane {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--pane);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.pane-header {
  min-height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: #171c24;
}

.pane-header h2 {
  margin: 0 0 4px;
  font-size: 15px;
  line-height: 1.15;
}

.pane-header span {
  display: block;
  font-size: 12px;
}

.primary-button,
.ghost-button,
.icon-button,
.filter-tabs button {
  min-height: 36px;
  border-radius: 7px;
  border: 1px solid transparent;
  color: var(--text);
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.primary-button {
  background: #227d5a;
  border-color: #33a576;
  padding: 0 14px;
  font-weight: 700;
}

.primary-button:hover {
  background: #2b966c;
}

.ghost-button,
.filter-tabs button {
  background: #111820;
  border-color: var(--line);
  padding: 0 12px;
}

.ghost-button:hover,
.filter-tabs button:hover {
  background: #202936;
}

.ghost-button:disabled,
.primary-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.compact {
  min-height: 32px;
}

.icon-button {
  width: 42px;
  height: 42px;
  padding: 0;
  background: #242d39;
  border-color: var(--line);
  font-size: 24px;
  line-height: 1;
}

.text-icon {
  font-size: 12px;
  font-weight: 900;
}

.chat-pane,
.storage-pane {
  min-height: 0;
}

.chat-pane {
  position: relative;
}

.chat-header-actions .ghost-button {
  white-space: nowrap;
}

.chat-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #151a22;
}

.chat-tab-button {
  min-width: 0;
  min-height: 34px;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #101820;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-tab-button:hover,
.chat-tab-button.active {
  border-color: #526171;
  background: #202b38;
  color: var(--text);
}

.chat-tab-button.active {
  box-shadow: inset 0 -2px 0 var(--green);
}

.chat-window {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #10141a;
}

.chat-slideshow-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 700ms ease;
}

.chat-slideshow-layer.active {
  opacity: 1;
}

.chat-slideshow-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(rgba(10, 14, 20, 0.28), rgba(10, 14, 20, 0.42)),
    radial-gradient(circle at 50% 18%, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.58));
}

.chat-slideshow-image {
  position: absolute;
  left: -8%;
  top: -8%;
  width: 116%;
  height: 116%;
  object-fit: cover;
  opacity: 0.48;
  filter: saturate(1.08) contrast(0.95);
  animation: chat-slideshow-pan 20s linear forwards;
}

@keyframes chat-slideshow-pan {
  from {
    transform: translate(var(--pan-from-x, -2%), var(--pan-from-y, -1%)) scale(1.02);
  }
  to {
    transform: translate(var(--pan-to-x, 2%), var(--pan-to-y, 1%)) scale(1.02);
  }
}

.storage-pane {
  position: relative;
}

.messages {
  position: relative;
  z-index: 2;
  flex: 1;
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 9px;
  align-items: start;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #071016;
  font-weight: 800;
}

.message-body {
  min-width: 0;
  width: fit-content;
  max-width: 100%;
  padding: 8px 9px;
  border: 1px solid rgba(48, 56, 68, 0.76);
  border-radius: 8px;
  background: rgba(11, 16, 23, 0.74);
  backdrop-filter: blur(2px);
}

.message-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 3px;
}

.message-meta strong {
  font-size: 13px;
}

.message-meta time {
  color: var(--muted);
  font-size: 11px;
}

.message-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.38;
  font-size: 14px;
}

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

.attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  background: #111820;
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}

.image-attachment {
  display: block;
  padding: 0;
  overflow: hidden;
}

.image-attachment img {
  width: 100%;
  max-height: 520px;
  height: auto;
  object-fit: cover;
  display: block;
  border-radius: 7px;
}

.chat-form {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #151a22;
}

.chat-form textarea {
  min-height: 42px;
  max-height: 118px;
  resize: vertical;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #0f141b;
  color: var(--text);
  padding: 10px 11px;
  outline: none;
}

.chat-form textarea:focus,
input:focus,
select:focus {
  border-color: var(--cyan);
  outline: none;
}

.pending-files {
  padding: 0 12px 12px;
  color: var(--muted);
  font-size: 12px;
}

.sticker-panel {
  border-top: 1px solid var(--line);
  padding: 12px;
  background: #151a22;
}

.sticker-search input {
  min-height: 36px;
  flex: 1;
  min-width: 140px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #0f141b;
  color: var(--text);
  padding: 0 10px;
}

.sticker-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  margin-top: 10px;
}

.sticker-result {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f141b;
  padding: 6px;
}

.sticker-result img {
  width: 100%;
  height: 86px;
  object-fit: contain;
  display: block;
}

.sticker-notice {
  grid-column: 1 / -1;
  color: var(--muted);
  padding: 10px;
  border: 1px dashed #3c4654;
  border-radius: 8px;
}

.avatar-picker {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 12px;
}

.avatar-preview,
.profile-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #3f4c5c;
  background: #25313f;
  color: var(--green);
  font-weight: 800;
}

.avatar-preview {
  width: 58px;
  height: 58px;
}

.avatar-preview img,
.profile-avatar img,
.message-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.call-main {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--pane);
}

.video-grid {
  --video-cols: 1;
  --video-row-height: minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(var(--video-cols), minmax(0, 1fr));
  grid-auto-rows: var(--video-row-height);
  align-content: start;
  gap: 12px;
  padding: 12px;
  overflow: hidden;
  background: #10141a;
}

.video-grid.has-extra-videos {
  overflow-y: auto;
  overflow-x: hidden;
}

.video-grid.is-empty {
  grid-template-columns: 1fr;
  grid-auto-rows: minmax(160px, 1fr);
  overflow: hidden;
}

.video-grid .empty-state {
  grid-column: 1 / -1;
}

.video-tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  background: #07090d;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.video-tile video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #07090d;
}

body.call-popout-body {
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

body.call-popout-body .call-main,
.call-main.is-popped-out {
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.call-main.is-popped-out {
  background: var(--pane);
}

.video-avatar {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: #0c121a;
}

.video-avatar .profile-avatar {
  width: min(160px, 46%);
  aspect-ratio: 1;
  font-size: 42px;
}

.video-tile.camera-off video {
  opacity: 0;
}

.video-tile.camera-off .video-avatar {
  display: grid;
}

.speaking-dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #536171;
  border: 2px solid rgba(5, 7, 10, 0.8);
  box-shadow: 0 0 0 rgba(128, 237, 153, 0);
}

.video-tile.speaking .speaking-dot,
.presence-chip.speaking .presence-speaking {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(128, 237, 153, 0.16);
}

.remote-volume {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 118px;
  display: grid;
  gap: 3px;
  padding: 6px;
  border-radius: 7px;
  background: rgba(5, 7, 10, 0.78);
  color: var(--muted);
  font-size: 10px;
}

.remote-volume input {
  width: 100%;
}

.video-label {
  position: absolute;
  left: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(5, 7, 10, 0.76);
  color: var(--text);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  min-height: 160px;
  display: grid;
  place-items: center;
  border: 1px dashed #3c4654;
  border-radius: 8px;
  text-align: center;
}

.presence-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: #151a22;
}

.presence-chip {
  flex: 0 0 auto;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #101820;
  font-size: 12px;
}

.presence-avatar {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #25313f;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}

.presence-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.presence-chip.live .presence-dot {
  background: var(--green);
}

.presence-speaking {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #536171;
}

.soundboard-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #151a22;
}

.soundboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.soundboard-head strong {
  font-size: 13px;
}

.soundboard-head span,
.sound-effect-hint {
  color: var(--muted);
  font-size: 12px;
}

.soundboard-upload {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto auto;
  gap: 8px;
}

.sound-effect-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 7px;
  max-height: 160px;
  overflow: auto;
}

.sound-effect-button {
  min-height: 36px;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #101820;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sound-effect-list .empty-state {
  min-height: 42px;
  grid-column: 1 / -1;
}

.watch-stack {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 12px;
}

.watch-block {
  display: grid;
  gap: 8px;
}

.subhead {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

#videoPlayer {
  width: 100%;
  min-height: 240px;
  background: #05070b;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.youtube-bar {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #151a22;
}

.youtube-bar input,
.effect-row select,
.join-panel input,
.soundboard-upload input {
  min-height: 36px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #0f141b;
  color: var(--text);
  padding: 0 10px;
}

.youtube-bar input {
  min-width: 180px;
  flex: 1;
}

.youtube-frame {
  position: relative;
  min-height: 380px;
  background: #05070b;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.youtube-block.audio-only .youtube-frame {
  min-height: 74px;
  display: grid;
  place-items: center;
}

.youtube-block.audio-only .youtube-frame::before {
  content: "Audio only";
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.youtube-frame iframe,
iframe.youtube-frame {
  width: 100%;
  height: 100%;
  min-height: 380px;
  display: block;
  border: 0;
}

.youtube-block.audio-only .youtube-frame iframe,
.youtube-block.audio-only iframe.youtube-frame {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px;
  opacity: 0;
  pointer-events: none;
}

.youtube-block.audio-only iframe.youtube-frame {
  position: static;
}

#youtubeAudioOnlyButton[aria-pressed="true"] {
  border-color: #5de0a2;
  color: var(--green);
}

#audioPlayer {
  width: calc(100% - 24px);
  margin: 12px;
}

.bass-button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 12px 0;
}

.bass-button {
  min-height: 64px;
  border-radius: 8px;
  color: #fff5f7;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nice-bass-button {
  border: 1px solid #5de0a2;
  background: #123728;
  color: #effff6;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 26px rgba(128, 237, 153, 0.18);
}

.nice-bass-button.active {
  background: #176544;
  border-color: #8bf4b8;
  box-shadow: 0 0 34px rgba(128, 237, 153, 0.36);
}

.extreme-bass-button {
  border: 1px solid #ff5f7d;
  background: #4a1020;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 28px rgba(239, 71, 111, 0.22);
}

.extreme-bass-button.active {
  background: #8f1230;
  border-color: #ff8aa0;
  box-shadow: 0 0 34px rgba(239, 71, 111, 0.42);
}

.eq-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(70px, 1fr));
  gap: 8px;
  padding: 0 12px 12px;
}

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

.eq-grid input {
  width: 100%;
}

.effect-row {
  padding: 0 12px 12px;
}

.effect-row select {
  flex: 1 1 170px;
}

.speed-control {
  min-height: 36px;
  flex: 1 1 150px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #0f141b;
  color: var(--muted);
  font-size: 12px;
}

.speed-control input {
  min-width: 90px;
  flex: 1;
}

.music-visualizer {
  height: clamp(260px, 34vh, 340px);
  flex: 0 0 clamp(260px, 34vh, 340px);
  margin: 0 12px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #070a0f;
  overflow: hidden;
}

.music-visualizer canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.queue-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 12px 12px;
  display: grid;
  align-content: start;
  gap: 7px;
  scrollbar-color: #526171 #101820;
}

.queue-item,
.file-row {
  border: 1px solid var(--line);
  background: #101820;
  border-radius: 8px;
}

.queue-item {
  min-height: 38px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: var(--muted);
  overflow: hidden;
  position: relative;
}

.queue-item.draggable {
  grid-template-columns: 22px minmax(0, 1fr);
  cursor: grab;
}

.queue-item.dragging {
  opacity: 0.55;
}

.queue-item.drop-before::before,
.queue-item.drop-after::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  height: 2px;
  border-radius: 999px;
  background: var(--yellow);
}

.queue-item.drop-before::before {
  top: -5px;
}

.queue-item.drop-after::after {
  bottom: -5px;
}

.queue-handle {
  width: 18px;
  height: 22px;
  display: grid;
  align-content: center;
  gap: 3px;
}

.queue-handle span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: #7e8b99;
}

.queue-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.youtube-queue {
  min-height: 120px;
  max-height: 260px;
}

.youtube-saved-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 10, 14, 0.78);
}

.youtube-saved-modal[hidden] {
  display: none;
}

.youtube-saved-panel {
  width: min(760px, 100%);
  max-height: min(840px, calc(100vh - 36px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--pane);
  box-shadow: var(--shadow);
}

.youtube-saved-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.youtube-saved-head strong,
.youtube-saved-head span {
  display: block;
}

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

.youtube-favorites-list {
  min-height: min(420px, calc(100vh - 220px));
  max-height: calc(100vh - 170px);
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 7px;
}

.youtube-favorite-row {
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101820;
}

.youtube-favorite-title {
  grid-column: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
}

.youtube-favorite-meta {
  grid-column: 1;
  color: var(--muted);
  font-size: 11px;
}

.youtube-favorite-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  grid-column: 2;
  grid-row: 1 / span 2;
}

.youtube-favorite-actions button,
.youtube-favorite-actions a {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid var(--line);
  color: var(--text);
  background: #151d26;
  text-decoration: none;
  font-size: 12px;
}

.youtube-favorite-actions .danger {
  border-color: rgba(239, 71, 111, 0.55);
  color: #ff9db4;
}

#queueList {
  min-height: 130px;
  max-height: 290px;
}

.screen-pane {
  min-height: 420px;
}

.screen-share-stage {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(240px, 0.62fr) minmax(280px, 1fr);
  grid-template-rows: auto 1fr;
  gap: 12px;
  padding: 12px;
  overflow: auto;
}

.screen-preview,
.screen-grid {
  min-height: 260px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.screen-preview {
  grid-row: 1 / span 2;
}

.screen-view-bar {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.screen-view-control {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0f141b;
  color: var(--muted);
  font-size: 12px;
}

.screen-view-control select {
  min-height: 28px;
  min-width: 170px;
}

.screen-preview video,
.screen-tile video {
  width: 100%;
  min-height: 220px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #05070b;
  object-fit: contain;
}

.screen-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  overflow: auto;
}

.screen-grid.focused {
  grid-template-columns: minmax(260px, 1fr);
}

.screen-grid.focused .screen-tile {
  display: none;
}

.screen-grid.focused .screen-tile.selected {
  display: block;
}

.screen-tile {
  position: relative;
  min-height: 220px;
  border-radius: 8px;
  overflow: hidden;
  background: #05070b;
}

.usage-bar {
  height: 10px;
  margin: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #0d1117;
  border: 1px solid #27313d;
}

.usage-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--green);
}

.storage-breadcrumbs {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px 12px;
  color: var(--muted);
  overflow-x: auto;
}

.storage-breadcrumbs button {
  min-height: 28px;
  max-width: 160px;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #101820;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.storage-breadcrumbs button.active {
  border-color: #4f6175;
  color: var(--green);
}

.storage-breadcrumbs span {
  flex: 0 0 auto;
  color: #677482;
  font-size: 12px;
}

.storage-tabs-menu {
  position: relative;
  padding: 0 12px 12px;
}

.storage-tabs-toggle {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.storage-tabs-toggle span {
  color: var(--muted);
}

.storage-tabs-toggle strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-tabs {
  position: absolute;
  top: 40px;
  left: 12px;
  right: 12px;
  z-index: 9;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101820;
  box-shadow: var(--shadow);
}

.filter-tabs[hidden] {
  display: none;
}

.filter-tabs button {
  min-height: 32px;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 10px;
  color: var(--muted);
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-tabs button.active {
  color: var(--ink);
  background: var(--yellow);
  border-color: #f7c84e;
  font-weight: 800;
}

.file-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 12px 12px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.file-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px;
}

.file-title {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.file-kind {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #24313f;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.folder-kind {
  background: #2a3142;
  color: var(--yellow);
}

.file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta {
  color: var(--muted);
  font-size: 12px;
}

.file-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.file-actions button,
.file-actions a {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid var(--line);
  color: var(--text);
  background: #151d26;
  text-decoration: none;
  font-size: 12px;
}

.file-actions .danger {
  border-color: rgba(239, 71, 111, 0.55);
  color: #ff9db4;
}

.folder-row {
  background: #121c25;
  cursor: pointer;
}

.storage-pane.is-drop-target {
  border-color: rgba(76, 201, 240, 0.75);
}

.folder-row.is-drop-target {
  border-color: var(--yellow);
  background: #1e2630;
}

.storage-drop-overlay {
  position: absolute;
  inset: 72px 12px 12px;
  z-index: 5;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(76, 201, 240, 0.8);
  border-radius: 8px;
  background: rgba(10, 15, 21, 0.76);
  color: var(--text);
  font-weight: 800;
  pointer-events: none;
}

.storage-drop-overlay[hidden] {
  display: none;
}

.storage-move-modal {
  position: fixed;
  inset: 0;
  z-index: 29;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 10, 14, 0.78);
}

.storage-move-modal[hidden] {
  display: none;
}

.storage-move-panel {
  width: min(480px, 100%);
  max-height: min(680px, calc(100vh - 36px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--pane);
  box-shadow: var(--shadow);
}

.storage-move-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.storage-move-head strong,
.storage-move-head span {
  display: block;
}

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

.storage-move-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 7px;
}

.storage-move-destination {
  min-height: 46px;
  display: grid;
  gap: 2px;
  justify-items: start;
  padding: 8px 10px 8px calc(10px + (var(--folder-depth, 0) * 14px));
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #101820;
  color: var(--text);
  text-align: left;
}

.storage-move-destination:hover:not(:disabled) {
  border-color: #526171;
  background: #17202b;
}

.storage-move-destination span {
  max-width: 100%;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.storage-move-destination:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.sound-trim-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 10, 14, 0.78);
}

.sound-trim-modal[hidden] {
  display: none;
}

.sound-trim-panel {
  width: min(560px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--pane);
  box-shadow: var(--shadow);
}

.sound-trim-head,
.sound-trim-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.sound-trim-head strong,
.sound-trim-head span {
  display: block;
}

.sound-trim-head span,
.sound-trim-summary {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.sound-trim-panel audio {
  width: 100%;
}

.sound-trim-controls {
  display: grid;
  gap: 12px;
}

.sound-trim-controls label {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 92px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.sound-trim-controls input[type="range"] {
  min-width: 0;
}

.sound-trim-controls input[type="number"] {
  min-height: 34px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #0f141b;
  color: var(--text);
  padding: 0 9px;
}

.sound-trim-summary.is-invalid {
  color: #ff9db4;
}

.join-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(8, 10, 14, 0.88);
  padding: 18px;
}

.join-modal.hidden {
  display: none;
}

.join-panel {
  width: min(430px, 100%);
  display: grid;
  gap: 14px;
  padding: 22px;
  background: var(--pane);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.join-panel input {
  width: 100%;
}

.field-label {
  font-size: 12px;
  margin-bottom: -8px;
}

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
}

.upload-progress {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 31;
  width: min(390px, calc(100vw - 32px));
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111820;
  box-shadow: var(--shadow);
}

.upload-progress[hidden] {
  display: none;
}

.upload-progress-head,
.upload-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.upload-progress-head strong {
  font-size: 13px;
}

.upload-progress-head span,
.upload-progress-file,
.upload-progress-meta {
  color: var(--muted);
  font-size: 12px;
}

.upload-progress-file {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-progress-bar {
  height: 10px;
  border-radius: 999px;
  background: #0d1117;
  border: 1px solid #27313d;
  overflow: hidden;
}

.upload-progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
  transition: width 120ms ease;
}

.toast {
  padding: 11px 12px;
  border: 1px solid var(--line);
  background: #111820;
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13px;
}

.jumpscare {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  background: #030305;
  overflow: hidden;
}

.jumpscare.active {
  display: grid;
  animation: scare-flash 170ms steps(2, end) infinite;
}

.jumpscare-card {
  position: relative;
  width: min(720px, 90vw);
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  border: 3px solid #ff204e;
  background: #070508;
  box-shadow: 0 0 60px rgba(255, 32, 78, 0.48);
  transform: rotate(-1deg);
}

.scare-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.18) saturate(1.25);
}

.scare-lines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.08) 2px,
    transparent 2px,
    transparent 6px
  );
  pointer-events: none;
}

@keyframes scare-flash {
  from {
    filter: invert(0);
  }
  to {
    filter: invert(1);
  }
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(300px, 0.95fr) minmax(430px, 1.15fr);
  }

  .storage-pane {
    grid-column: 1 / -1;
    min-height: 320px;
  }
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace {
    height: auto;
    min-height: calc(100vh - 68px);
    overflow: visible;
    grid-template-columns: 1fr;
  }

  .main-stage {
    grid-template-rows: auto;
    order: 1;
  }

  .storage-pane {
    order: 2;
  }

  .chat-pane {
    order: 3;
  }

  .tool-pane {
    min-height: 360px;
  }

  .chat-pane {
    min-height: min(430px, 75vh);
  }

  .chat-pane .messages {
    max-height: 52vh;
  }

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

  .bass-button-row {
    grid-template-columns: 1fr;
  }

  .soundboard-upload {
    grid-template-columns: 1fr;
  }

  .screen-share-stage {
    grid-template-columns: 1fr;
  }

  .screen-preview {
    grid-row: auto;
  }

  .chat-form {
    grid-template-columns: auto auto 1fr;
  }

  .send-button {
    grid-column: 1 / -1;
  }
}
