/* X-style Spaces: Live list, preview modal, active room overlay */

#yi-spaces-root {
  position: relative;
  z-index: 5000;
  pointer-events: none;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

#yi-spaces-root > * {
  pointer-events: auto;
}

.x-live-space-row {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 8px 0;
  cursor: pointer;
}

.x-live-space-row:hover {
  opacity: 0.9;
}

.x-space-live-card,
.x-space-archive-card {
  cursor: pointer;
}

.x-space-live-card:hover,
.x-space-archive-card:hover {
  background: rgba(255, 255, 255, 0.03);
}


/* ── Sidebar: Live on Y ── */
#yi-live-panel {
  border: 1px solid #2f3336;
  border-radius: 16px;
  background: #000;
  overflow: hidden;
  margin-bottom: 16px;
  order: -1;
}

#yi-live-panel .yi-panel-head {
  padding: 12px 16px 8px;
  font-size: 1.25rem;
  font-weight: 800;
  color: #e7e9ea;
}

.yi-live-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-top: 1px solid #2f3336;
  background: transparent;
  color: #e7e9ea;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.yi-live-item:hover {
  background: #080808;
}

.yi-live-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.82rem;
  color: #71767b;
}

.yi-live-avatar-wrap {
  display: inline-flex;
  flex-shrink: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #1d9bf0;
  padding: 1px;
}

.yi-live-ring .yi-live-avatar,
.yi-live-ring .yi-live-avatar-fallback {
  display: block;
}

.yi-live-item.is-active-space {
  background: rgba(120, 86, 255, 0.12);
}

.yi-live-item.is-live-space,
.yi-browse-item.is-live-space {
  border: 2px solid #7856ff;
  box-shadow: 0 0 0 1px rgba(120, 86, 255, 0.28);
}

.yi-live-item.is-live-space.is-active-space,
.yi-browse-item.is-live-space.is-active-space {
  border-color: #9b7bff;
  box-shadow: 0 0 0 2px rgba(120, 86, 255, 0.45);
  background: rgba(120, 86, 255, 0.14);
}

.yi-live-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.yi-live-avatar-fallback {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.yi-live-host-name {
  color: #e7e9ea;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.yi-verified-badge {
  display: inline-block;
  vertical-align: text-bottom;
  width: 1em;
  height: 1em;
  margin-left: 2px;
  line-height: 1;
}

.yi-verified-badge svg {
  display: block;
  width: 100%;
  height: 100%;
}

.yi-verified {
  color: #1d9bf0;
  font-size: 0.75rem;
  line-height: 1;
}

.yi-live-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.yi-live-title {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  color: #e7e9ea;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.yi-live-pill {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px 4px 4px;
  border: 1px solid #2f3336;
  border-radius: 999px;
  min-width: 72px;
}

.yi-live-pill-avatars {
  display: flex;
  align-items: center;
}

.yi-live-pill-avatars img,
.yi-live-pill-avatars .yi-pill-av {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #000;
  margin-left: -6px;
  object-fit: cover;
}

.yi-live-pill-avatars img:first-child,
.yi-live-pill-avatars .yi-pill-av:first-child {
  margin-left: 0;
}

.yi-pill-av {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.45rem;
  font-weight: 700;
  color: #fff;
}

.yi-live-pill-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: #e7e9ea;
  white-space: nowrap;
}

.yi-show-more {
  display: block;
  width: 100%;
  border: 0;
  border-top: 1px solid #2f3336;
  background: transparent;
  color: #1d9bf0;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  font-size: 0.92rem;
}

.yi-show-more:hover {
  background: #080808;
}

.yi-live-empty {
  padding: 12px 16px 16px;
  color: #71767b;
  font-size: 0.88rem;
}

/* ── Shared overlay backdrop ── */
.yi-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 6000;
}

/* ── Preview modal (image 2) ── */
.yi-preview {
  width: min(420px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: #000;
  border-radius: 20px;
  border: 1px solid #2f3336;
  color: #e7e9ea;
  padding: 0 0 20px;
  display: flex;
  flex-direction: column;
}

.yi-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 8px;
}

.yi-preview-head button {
  border: 0;
  background: transparent;
  color: #e7e9ea;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
}

.yi-preview-head button:hover {
  background: #181818;
}

.yi-preview-actions {
  display: flex;
  gap: 4px;
}

.yi-rec-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0 16px 10px;
  padding: 3px 8px;
  border-radius: 4px;
  background: #2a1515;
  color: #f4212e;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.yi-rec-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f4212e;
}

.yi-preview-title {
  margin: 0 16px 16px;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.25;
}

.yi-speaker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px 6px;
  padding: 0 16px;
  margin-bottom: 16px;
}

.yi-speaker-card {
  text-align: center;
  min-width: 0;
}

.yi-speaker-av-wrap {
  position: relative;
  width: 32px;
  height: 32px;
  margin: 0 auto 6px;
}

.yi-speaker-av-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  background: #16181c;
}

.yi-speaker-av-wrap.yi-speaking-ring .yi-speaker-av-inner {
  box-shadow: 0 0 0 2px #e7e9ea;
}

.yi-speaker-av-inner img,
.yi-speaker-av-inner .yi-speaker-fallback,
.yi-speaker-av-wrap .yi-speaker-avatar,
.yi-speaker-av-wrap .yi-speaker-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.yi-speaker-av-wrap img,
.yi-speaker-av-wrap .yi-speaker-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.yi-speaker-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 0.82rem;
}

.yi-speaker-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: #e7e9ea;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  margin-top: 2px;
}

.yi-speaker-role {
  font-size: 0.68rem;
  color: #71767b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* X-style mic/volume equalizer next to a speaker's role. Idle = short static
   bars; while the person is actually talking (.is-speaking) the bars bounce. */
.yi-mic-wave {
  display: inline-flex;
  align-items: center;
  gap: 1.5px;
  height: 10px;
}
.yi-mic-wave i {
  display: block;
  width: 2px;
  height: 30%;
  border-radius: 1px;
  background: #8a63ff;
  transition: height 0.12s linear;
}
.yi-mic-wave i:nth-child(2) { height: 60%; }
.yi-mic-wave i:nth-child(3) { height: 45%; }
.yi-speaker-card.is-speaking .yi-mic-wave i {
  animation: yi-mic-eq 0.7s ease-in-out infinite;
}
.yi-speaker-card.is-speaking .yi-mic-wave i:nth-child(2) { animation-delay: 0.15s; }
.yi-speaker-card.is-speaking .yi-mic-wave i:nth-child(3) { animation-delay: 0.3s; }
.yi-speaker-card.is-speaking .yi-mic-wave i:nth-child(4) { animation-delay: 0.45s; }
@keyframes yi-mic-eq {
  0%, 100% { height: 25%; }
  50% { height: 95%; }
}

.yi-listeners-bar {
  margin: 0 16px 16px;
  padding: 12px 16px;
  border-radius: 999px;
  background: #16181c;
  text-align: center;
  color: #e7e9ea;
  font-size: 0.92rem;
}

.yi-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 0.95rem;
}

.yi-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #2f3336;
  border: 0;
  cursor: pointer;
  padding: 0;
}

.yi-toggle.on {
  background: #1d9bf0;
}

.yi-toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

.yi-toggle.on::after {
  transform: translateX(20px);
}

.yi-preview-note {
  margin: 0 16px 12px;
  text-align: center;
  color: #e7e9ea;
  font-size: 0.88rem;
  line-height: 1.4;
}

.yi-preview-join-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 16px 4px;
  margin-top: auto;
  flex-shrink: 0;
}

.yi-preview-join-btn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  flex-shrink: 0;
  line-height: 1.2;
  min-height: 48px;
}

.yi-preview-join-voice {
  border: 0;
  background: #eff3f4;
  color: #0f1419;
}

.yi-preview-join-voice:hover:not(:disabled) {
  background: #d7dbdc;
}

.yi-preview-join-video {
  border: 1px solid #536471;
  background: transparent;
  color: #e7e9ea;
}

.yi-preview-join-video:hover:not(:disabled) {
  background: rgba(231, 233, 234, 0.08);
  border-color: #71767b;
}

.yi-preview-join-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.yi-start-btn {
  display: block;
  width: calc(100% - 32px);
  margin: 0 16px;
  padding: 14px;
  border: 0;
  border-radius: 999px;
  background: #eff3f4;
  color: #0f1419;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.yi-start-btn:hover {
  background: #d7dbdc;
}

.yi-start-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ── Persistent live Space dock (top-middle-right, survives tab changes) ── */
#yi-live-dock-root {
  --yi-dock-top: clamp(64px, 12vh, 120px);
  position: fixed;
  top: var(--yi-dock-top);
  right: max(16px, calc((100vw - min(1280px, 100vw)) / 2 + 16px));
  width: min(380px, calc(100vw - 32px));
  /* Always fit between the top offset and the bottom of the screen so the
     control dock (mic/chat/etc.) is never pushed off the page. */
  max-height: calc(100vh - var(--yi-dock-top) - 20px);
  max-height: calc(100dvh - var(--yi-dock-top) - 20px);
  z-index: 8800;
  pointer-events: none;
}

#yi-live-dock-root[hidden] {
  display: none !important;
}

#yi-live-dock-root .yi-overlay.yi-overlay-live {
  position: static;
  inset: auto;
  top: auto;
  right: auto;
  left: auto;
  bottom: auto;
  width: 100%;
  max-height: calc(100vh - var(--yi-dock-top) - 20px);
  max-height: calc(100dvh - var(--yi-dock-top) - 20px);
  background: transparent;
  pointer-events: none;
  display: block;
  padding: 0;
  z-index: auto;
}

#yi-live-dock-root .yi-overlay.yi-overlay-live .yi-live-room {
  pointer-events: auto;
  width: 100%;
  max-height: calc(100vh - var(--yi-dock-top) - 20px);
  max-height: calc(100dvh - var(--yi-dock-top) - 20px);
  margin: 0;
  border-radius: 16px;
  border: 1px solid #2f3336;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  align-self: auto;
}

/* ── Active room overlay (expanded) ── */
.yi-live-room {
  width: 100%;
  max-height: min(92vh, 760px);
  margin: 0;
  background: #000;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.yi-live-room.minimized {
  width: auto;
  max-height: none;
  border-radius: 999px;
  margin: 0;
  padding: 10px 16px;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  border: 1px solid #2f3336;
  cursor: pointer;
}

.yi-host-absent-banner {
  background: #3d1818;
  color: #f4212e;
  text-align: center;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid #5c1a1a;
}

.yi-live-room-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #2f3336;
  flex-shrink: 0;
}

.yi-live-room-head button {
  border: 0;
  background: transparent;
  color: #e7e9ea;
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
}

.yi-live-room-head button:hover {
  background: #181818;
}

.yi-live-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.yi-cam-btn {
  font-size: 1.05rem !important;
  border-radius: 50% !important;
  opacity: 0.75;
}

.yi-cam-btn.on {
  opacity: 1;
  background: rgba(29, 155, 240, 0.2) !important;
  color: #1d9bf0 !important;
}

.yi-invite-top-btn {
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  border-radius: 999px !important;
  padding: 8px 14px !important;
  background: #1d9bf0 !important;
  color: #fff !important;
}

.yi-invite-top-btn:hover {
  background: #1a8cd8 !important;
}

/* Server-admin only: trigger a non-destructive audio refresh for all live Spaces. */
.yi-admin-refresh-btn {
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  border-radius: 999px !important;
  padding: 8px 12px !important;
  background: #2b3a44 !important;
  color: #ffd166 !important;
  border: 1px solid rgba(255, 209, 102, 0.45) !important;
}

.yi-admin-refresh-btn:hover {
  background: #34464f !important;
}

.yi-local-camera-wrap {
  margin: 8px 0 4px;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  max-height: 180px;
}

.yi-local-camera {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: cover;
}

.yi-live-room {
  position: relative;
}

.yi-live-room-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.yi-live-room.yi-chat-mode .yi-live-room-body {
  display: none;
}

.yi-live-room.yi-chat-mode .yi-space-chat {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  border-top: 0;
}

.yi-cam-pip {
  position: absolute;
  top: 52px;
  right: 12px;
  width: 108px;
  height: 148px;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  border: 2px solid #2f3336;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  z-index: 12;
  pointer-events: auto;
}

.yi-cam-pip .yi-local-camera {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
}

.yi-cam-pip-close {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.75rem;
  cursor: pointer;
  line-height: 1;
}

/* Remote participant video tiles (shown only when someone is on camera) */
.yi-video-stage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 10px 0 6px;
}

.yi-video-stage[hidden] {
  display: none;
}

.yi-remote-vtile {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  border: 1px solid #2f3336;
  aspect-ratio: 4 / 3;
}

.yi-remote-vtile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.yi-remote-vlabel {
  position: absolute;
  left: 6px;
  bottom: 6px;
  max-width: calc(100% - 12px);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yi-dj-locked {
  border-color: #3d3640;
  background: #12141a;
}

.yi-dj-locked-msg {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #8b98a5;
}

.yi-preview-invite-btn {
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  border-radius: 999px !important;
  padding: 10px 16px !important;
  min-height: 44px !important;
  background: #1d9bf0 !important;
  color: #fff !important;
  border: 0 !important;
  touch-action: manipulation;
}

.yi-preview-close-btn {
  font-size: 0.88rem;
  font-weight: 700;
  padding: 8px 14px;
  min-height: 44px;
  border-radius: 999px;
  background: #16181c;
  border: 1px solid #2f3336;
  color: #e7e9ea;
  cursor: pointer;
  touch-action: manipulation;
}

.yi-leave-btn {
  color: #f4212e !important;
  font-weight: 700;
  font-size: 0.88rem !important;
  border-radius: 999px !important;
  padding: 8px 14px !important;
}

.yi-end-space-btn {
  color: #fff !important;
  font-weight: 700;
  font-size: 0.88rem !important;
  border-radius: 999px !important;
  padding: 8px 14px !important;
  background: #f4212e !important;
  border: 0 !important;
}

.yi-minimized-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.yi-minimized-actions .yi-leave-btn,
.yi-minimized-actions .yi-end-space-btn {
  font-size: 0.75rem !important;
  padding: 6px 10px !important;
}

.yi-settings-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.yi-settings-btn.danger {
  color: #f4212e;
  border-color: rgba(244, 33, 46, 0.45);
}

.yi-settings-hint {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: #71767b;
  line-height: 1.35;
}

.yi-live-room-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0 16px 12px;
}

.yi-live-room-title {
  margin: 12px 0 4px;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.25;
}

.yi-live-room-topic {
  margin: 0 0 14px;
  color: #71767b;
  font-size: 0.85rem;
}

.yi-live-room .yi-speaker-grid {
  grid-template-columns: repeat(4, 1fr);
  padding: 0;
}

.yi-live-room .yi-speaker-av-wrap {
  width: 36px;
  height: 36px;
}

.yi-speaking-ring .yi-speaker-av-wrap {
  box-shadow: none;
}

.yi-muted-mic {
  position: absolute;
  right: -4px;
  bottom: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f4212e;
  color: #fff;
  font-size: 0.58rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #000;
  z-index: 2;
  pointer-events: none;
}

.yi-hand-badge {
  position: absolute;
  left: -4px;
  top: -2px;
  font-size: 0.82rem;
  line-height: 1;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
}

/* Listeners sit in the same grid as speakers but appear dimmed with their
   mic off until they request to speak or get invited onto the stage. */
.yi-listener-card .yi-speaker-av-inner {
  opacity: 0.62;
}

.yi-listener-card .yi-speaker-role {
  color: #5b6066;
}

.yi-listener-card.yi-hand-raised .yi-speaker-av-inner {
  opacity: 1;
  box-shadow: 0 0 0 2px #f6c945;
}

.yi-listener-card.yi-hand-raised .yi-speaker-role {
  color: #f6c945;
}

.yi-listener-mic-off {
  position: absolute;
  right: -4px;
  bottom: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #2f3336;
  color: #8b8f94;
  font-size: 0.58rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #000;
  z-index: 2;
  pointer-events: none;
  filter: grayscale(1);
}

.yi-live-dock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 22px;
  border-top: 1px solid #2f3336;
  background: #000;
  flex-shrink: 0;
}

/* Shown when browser autoplay blocks remote audio; tapping unlocks sound. */
.yi-tap-to-listen {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 13000;
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f1419;
  background: #eff3f4;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  animation: yi-tap-pulse 1.8s ease-in-out infinite;
}

@keyframes yi-tap-pulse {
  0%, 100% { box-shadow: 0 10px 30px rgba(29, 155, 240, 0.35); }
  50% { box-shadow: 0 10px 36px rgba(29, 155, 240, 0.75); }
}

.yi-dock-primary {
  display: flex;
  align-items: center;
  gap: 12px;
}

.yi-mic-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: #eff3f4;
  color: #0f1419;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease, transform 0.1s ease;
}

.yi-mic-btn svg {
  width: 24px;
  height: 24px;
  display: block;
}

.yi-mic-btn:active {
  transform: scale(0.93);
}

/* LIVE (unmuted speaker): light button with a green "you are live" ring +
   a slow breathing glow so it's obvious the mic is open. */
.yi-mic-btn.live {
  background: #eff3f4;
  color: #0f1419;
  border-color: #00ba7c;
  box-shadow: 0 0 0 4px rgba(0, 186, 124, 0.22), 0 6px 18px rgba(0, 186, 124, 0.32);
  animation: yi-mic-live-pulse 2s ease-in-out infinite;
}

@keyframes yi-mic-live-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(0, 186, 124, 0.18), 0 6px 16px rgba(0, 186, 124, 0.28); }
  50% { box-shadow: 0 0 0 6px rgba(0, 186, 124, 0.30), 0 6px 22px rgba(0, 186, 124, 0.45); }
}

/* MUTED (off): solid red with a slashed-mic icon — the universal "mic off". */
.yi-mic-btn.muted {
  background: #f4212e;
  color: #ffffff;
  border-color: #f4212e;
  box-shadow: 0 6px 18px rgba(244, 33, 46, 0.4);
}

.yi-mic-btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #2f3336;
  color: #71767b;
  border-color: transparent;
  box-shadow: none;
  animation: none;
}

/* Listener mic = request-to-speak: muted look until a request is pending. */
.yi-mic-btn.request {
  background: #2f3336;
  color: #e7e9ea;
}

.yi-mic-btn.request.pending {
  background: #1d9bf0;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(29, 155, 240, 0.35);
}

/* Mic + music live level meters (also a capture/transmission diagnostic). */
.yi-mic-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.yi-mic-meter {
  width: 52px;
  height: 5px;
  border-radius: 3px;
  background: #2f3336;
  overflow: hidden;
}

.yi-mic-meter-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, #1d9bf0, #00ba7c);
  transition: width 70ms linear;
}

.yi-mic-meter.idle .yi-mic-meter-fill {
  background: #71767b;
}

.yi-dj-meter {
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: #2f3336;
  overflow: hidden;
  margin: 2px 0 4px;
}

.yi-dj-meter-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, #1d9bf0, #f91880);
  transition: width 70ms linear;
}

.yi-dj-meter.idle .yi-dj-meter-fill {
  background: #71767b;
}

.yi-dock-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.yi-dock-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #2f3336;
  background: transparent;
  color: #e7e9ea;
  cursor: pointer;
  font-size: 1rem;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.yi-dock-btn.has-unread {
  border-color: #ff69b4;
  background: rgba(255, 105, 180, 0.18);
  color: #ff8dc7;
  box-shadow: 0 0 0 2px rgba(255, 105, 180, 0.35);
  animation: yi-chat-unread-pulse 1.6s ease-in-out infinite;
}

.yi-dock-btn.has-unread::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff69b4;
  border: 2px solid #000;
}

@keyframes yi-chat-unread-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 2px rgba(255, 105, 180, 0.35);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(255, 105, 180, 0.55);
  }
}

.yi-dock-btn.active {
  border-color: #1d9bf0;
  background: rgba(29, 155, 240, 0.15);
  color: #1d9bf0;
}

.yi-hand-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 0;
  background: #2f3336;
  color: #e7e9ea;
  font-size: 1.35rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.yi-hand-btn.raised {
  background: #f59e0b;
  color: #000;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.35);
}

.yi-hand-btn.pending,
.yi-hand-btn.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.yi-reaction-float {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  background: rgba(15, 20, 25, 0.88);
  border-radius: 50%;
  animation: yi-pop 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.yi-space-chat {
  border-top: 1px solid #2f3336;
  background: #050505;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.yi-space-chat.is-typing,
.yi-space-chat:focus-within {
  background: linear-gradient(180deg, rgba(255, 105, 180, 0.14) 0%, #0a0508 100%);
  border-top-color: #ff69b4;
  box-shadow: inset 0 1px 0 rgba(255, 105, 180, 0.35);
}

.yi-space-chat.is-typing .yi-space-chat-head,
.yi-space-chat:focus-within .yi-space-chat-head {
  color: #ff8dc7;
}

.yi-chat-emoji-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 12px;
  border-top: 1px solid #2f3336;
  flex-shrink: 0;
}

.yi-chat-emoji-btn {
  border: 0;
  background: transparent;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.yi-chat-emoji-btn:hover {
  background: rgba(255, 105, 180, 0.15);
}

.yi-dj-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  margin: 12px 0 8px;
  padding: 10px 12px;
  border: 1px solid #2f3336;
  border-radius: 12px;
  background: #0d1114;
}

.yi-dj-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.yi-dj-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #e7e9ea;
}

.yi-dj-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(29, 155, 240, 0.15);
  color: #1d9bf0;
  border: 1px solid rgba(29, 155, 240, 0.35);
}

.yi-dj-now {
  width: 100%;
  margin: 0;
  font-size: 0.78rem;
  color: #71767b;
}

.yi-dj-transport {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.yi-dj-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 4px 0 2px;
}

.yi-dj-time {
  font-size: 0.72rem;
  color: #71767b;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.yi-dj-progress {
  flex: 1;
  min-width: 0;
  height: 4px;
  accent-color: #1d9bf0;
  cursor: pointer;
}

.yi-dj-shuffle-btn,
.yi-dj-prev-btn,
.yi-dj-next-btn,
.yi-dj-loop-btn {
  border: 1px solid #2f3336;
  background: #000;
  color: #e7e9ea;
  border-radius: 999px;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  font-size: 0.85rem;
  cursor: pointer;
}

.yi-dj-shuffle-btn.active,
.yi-dj-loop-btn.active {
  border-color: #1d9bf0;
  color: #1d9bf0;
  background: rgba(29, 155, 240, 0.12);
}

.yi-dj-loop-btn.one.active {
  border-color: #f91880;
  color: #f91880;
  background: rgba(249, 24, 128, 0.1);
}

.yi-dj-playlist-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}

.yi-dj-pl-hint {
  font-size: 0.72rem;
  color: #71767b;
}

.yi-dj-playlist {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  max-height: 140px;
  overflow-y: auto;
  border: 1px solid #2f3336;
  border-radius: 8px;
  background: #000;
}

.yi-dj-pl-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-bottom: 1px solid #2f3336;
  font-size: 0.78rem;
}

.yi-dj-pl-item:last-child {
  border-bottom: 0;
}

.yi-dj-pl-item.active {
  background: rgba(29, 155, 240, 0.12);
}

.yi-dj-pl-empty {
  padding: 10px;
  color: #71767b;
  font-size: 0.75rem;
}

.yi-dj-pl-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #e7e9ea;
}

.yi-dj-pl-play,
.yi-dj-pl-remove {
  border: 0;
  background: transparent;
  color: #1d9bf0;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 4px;
}

.yi-dj-pl-remove {
  color: #f4212e;
}

.yi-dj-hint {
  width: 100%;
  margin: 4px 0 0;
  font-size: 0.72rem;
  color: #71767b;
  line-height: 1.35;
}

.yi-dj-stream-add {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
}

.yi-dj-stream-add input {
  flex: 1;
  min-width: 0;
  border: 1px solid #2f3336;
  border-radius: 999px;
  background: #0f0f0f;
  color: #e7e9ea;
  padding: 8px 14px;
  font-size: 0.78rem;
}

.yi-dj-stream-add button {
  border: 1px solid #2f3336;
  border-radius: 999px;
  background: #16181c;
  color: #e7e9ea;
  padding: 8px 14px;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
}

.yi-dj-stream-add button:hover {
  background: #1d1f23;
}

.yi-dj-spotify-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  flex-wrap: wrap;
}

.yi-dj-spotify-btn,
.yi-dj-spotify-disconnect {
  border: 1px solid #2f3336;
  border-radius: 999px;
  background: #16181c;
  color: #e7e9ea;
  padding: 6px 12px;
  font-size: 0.74rem;
  cursor: pointer;
}

.yi-dj-spotify-btn:hover,
.yi-dj-spotify-disconnect:hover {
  background: #1d1f23;
}

.yi-dj-spotify-ok {
  font-size: 0.72rem;
  color: #1db954;
}

.yi-dj-spotify-off {
  font-size: 0.72rem;
  color: #71767b;
}

.yi-dj-stream-note {
  width: 100%;
  margin: 6px 0 0;
  font-size: 0.7rem;
  color: #71767b;
  line-height: 1.35;
}

.yi-dj-pl-source {
  flex-shrink: 0;
  font-size: 0.85rem;
  width: 22px;
  text-align: center;
}

.yi-dj-upload {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #71767b;
  cursor: pointer;
}

.yi-dj-upload input {
  max-width: 140px;
  font-size: 0.72rem;
}

.yi-dj-btn,
.yi-dj-pause-btn,
.yi-dj-stop-btn,
.yi-dj-mute-btn {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.yi-dj-btn {
  background: #1d9bf0;
  color: #fff;
}

.yi-dj-pause-btn {
  background: #38444d;
  color: #e7e9ea;
}

.yi-dj-stop-btn {
  background: #2f3336;
  color: #e7e9ea;
}

.yi-dj-mute-btn {
  background: #16181c;
  color: #e7e9ea;
  border: 1px solid #2f3336;
  padding: 8px 12px;
}

.yi-dj-mute-btn.muted {
  opacity: 0.45;
}

.yi-dj-btn:disabled,
.yi-dj-pause-btn:disabled,
.yi-dj-stop-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.yi-room-lock-badge,
.yi-live-lock-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.12);
  color: #f4212e;
  border: 1px solid rgba(244, 33, 46, 0.35);
  vertical-align: middle;
}

.yi-preview-lock {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: #f4212e;
  font-weight: 600;
}

.yi-create-lock-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid #2f3336;
  border-radius: 10px;
  background: #0d1114;
}

.yi-create-lock-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  cursor: pointer;
}

.yi-create-lock-cap {
  font-size: 0.72rem;
}

.yi-create-space-btn {
  display: block;
  width: 100%;
  margin: 0 0 10px;
  padding: 14px 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(120deg, #7c4dff 0%, #9b7bff 40%, #b388ff 60%, #7c4dff 100%);
  background-size: 220% 100%;
  color: #fff;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.2px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 6px 18px rgba(124, 77, 255, 0.35);
  animation: yi-create-shimmer 5s ease-in-out infinite, yi-create-pulse 2.8s ease-in-out infinite;
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}

@keyframes yi-create-shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes yi-create-pulse {
  0%, 100% { box-shadow: 0 6px 18px rgba(124, 77, 255, 0.35); }
  50% { box-shadow: 0 6px 26px rgba(124, 77, 255, 0.65); }
}

.yi-create-space-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(124, 77, 255, 0.55);
}

.yi-create-space-btn:active {
  transform: translateY(0);
  background-image: linear-gradient(120deg, #6a3bff 0%, #8a63ff 50%, #6a3bff 100%);
}

.yi-create-space-btn.open {
  animation: none;
  background: #d7dbdc;
  color: #0f1419;
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .yi-create-space-btn {
    animation: none;
  }
}

.yi-create-space-wrap {
  margin-bottom: 10px;
}

.yi-create-space-sheet {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 8px;
}

.yi-create-space-sheet[hidden] {
  display: none !important;
}

.yi-create-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.yi-create-field-label {
  font-size: 0.78rem;
  color: #71767b;
}

.yi-create-field input,
.yi-create-field select {
  border: 1px solid #2f3336;
  border-radius: 12px;
  padding: 12px 14px;
  background: #000;
  color: #e7e9ea;
  font-size: 16px;
  width: 100%;
}

.yi-create-record-row {
  margin: 0;
}

.yi-create-space-submit {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  background: #1d9bf0;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

.yi-create-space-submit:disabled {
  opacity: 0.65;
  cursor: default;
}

.yi-live-panel-mobile-dock.yi-create-sheet-open .yi-live-panel-scroll {
  max-height: 88px;
}

.yi-live-panel-mobile-dock.yi-create-sheet-open {
  max-height: min(72vh, 520px);
}

/* Public Spaces browse */
.yi-browse-search-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.yi-browse-search-label,
.yi-browse-search-wrap .jam-search-label {
  font-size: 0.78rem;
  color: #71767b;
}

.yi-browse-search,
.jam-space-search {
  width: 100%;
  border: 1px solid #2f3336;
  border-radius: 12px;
  padding: 12px 14px;
  background: #000;
  color: #e7e9ea;
  font-size: 16px;
}

.yi-browse-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(42vh, 360px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 8px;
}

.yi-browse-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 1px solid #2f3336;
  border-radius: 12px;
  padding: 10px 12px;
  background: #0d1114;
  color: #e7e9ea;
  cursor: pointer;
  touch-action: manipulation;
}

.yi-browse-item-main {
  flex: 1 1 auto;
  min-width: 0;
}

/* Pulsing purple dot marks a Space as live. */
.yi-browse-live-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #9b7bff;
  box-shadow: 0 0 0 0 rgba(155, 123, 255, 0.6);
  animation: yi-browse-live-pulse 1.8s infinite;
}

@keyframes yi-browse-live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(155, 123, 255, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(155, 123, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(155, 123, 255, 0); }
}

/* The "Join" call-to-action on each live Space row. */
.yi-browse-join {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 7px 18px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  background: #7856ff;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease, transform 0.1s ease;
}

.yi-browse-join:hover {
  background: #6a48f0;
}

.yi-browse-join:active {
  transform: scale(0.96);
}

.yi-browse-item:hover,
.yi-browse-item:active {
  background: #16181c;
}

/* Live public Spaces stand out in purple so users notice them. */
.yi-browse-item.is-live-space {
  border-color: rgba(155, 123, 255, 0.55);
  background: linear-gradient(180deg, rgba(124, 77, 255, 0.16) 0%, rgba(124, 77, 255, 0.06) 100%);
  box-shadow: inset 0 0 0 1px rgba(155, 123, 255, 0.18);
}

.yi-browse-item.is-live-space:hover,
.yi-browse-item.is-live-space:active {
  background: linear-gradient(180deg, rgba(124, 77, 255, 0.26) 0%, rgba(124, 77, 255, 0.1) 100%);
  border-color: rgba(155, 123, 255, 0.85);
}

/* The busiest Space (first in the list) gets a brighter purple glow. */
.yi-browse-list .yi-browse-item.is-live-space:first-child {
  border-color: #9b7bff;
  box-shadow: 0 0 0 1px rgba(155, 123, 255, 0.5), 0 6px 18px rgba(124, 77, 255, 0.3);
}

.yi-browse-item.is-active-space {
  border-color: #9b7bff;
}

.yi-browse-item-title {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 4px;
}

.yi-browse-item-meta {
  font-size: 0.78rem;
  color: #71767b;
}

.yi-browse-lock {
  font-size: 0.72rem;
  margin-left: 6px;
  color: #71767b;
}

.yi-browse-pager,
.jam-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.yi-browse-page-label,
.jam-pager span {
  font-size: 0.78rem;
  color: #71767b;
  flex: 1;
  text-align: center;
}

.yi-browse-pager-btn {
  border: 1px solid #536471;
  background: transparent;
  color: #e7e9ea;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.yi-browse-pager-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.yi-spaces-browse-center {
  padding: 12px 16px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

/* Mobile Spaces tab — create + browse at top of feed */
.yi-spaces-tab-panel {
  padding: 0 16px 16px;
  margin: 0;
  border-bottom: 1px solid #2f3336;
  background: #000;
}

/* On the mobile Spaces tab, show ONLY our Spaces panel. The app otherwise
   renders its own secondary Spaces view in the same column, which on iOS looks
   like a second Spaces "window" sitting behind ours — hide it so there is just
   one Spaces surface. */
body.yi-spaces-tab-active .x-center-main > *:not(#yi-spaces-tab-panel) {
  display: none !important;
}

.yi-spaces-tab-panel .yi-create-space-wrap {
  padding-top: 8px;
  padding-bottom: 4px;
}

.yi-spaces-tab-panel .yi-create-space-btn {
  margin-top: 0;
  margin-bottom: 12px;
}

.yi-spaces-tab-panel .yi-panel-head {
  padding-top: 0;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.yi-spaces-tab-panel .yi-browse-list {
  max-height: none;
}

@media (max-width: 1100px) and (pointer: coarse), (max-width: 760px) {
  .yi-spaces-tab-panel .yi-create-space-wrap {
    position: sticky;
    top: 0;
    z-index: 25;
    background: #000;
    padding: 10px 0 10px;
    margin: 0 -16px 8px;
    padding-left: 16px;
    padding-right: 16px;
    border-bottom: 1px solid #2f3336;
  }
}

.yi-live-panel-mobile-dock .yi-browse-list {
  max-height: min(38vh, 300px);
}

.yi-live-panel-mobile-dock.yi-create-sheet-open .yi-browse-list {
  max-height: min(24vh, 180px);
}

.yi-live-panel-scroll {
  max-height: 132px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.yi-live-panel-mobile-dock .yi-live-item {
  padding: 10px 12px;
}

.yi-live-panel-mobile-dock .yi-show-more {
  width: 100%;
  margin-top: 4px;
}

.yi-settings-lock-note {
  font-size: 0.78rem;
  margin: 0 0 8px;
  line-height: 1.35;
}

.yal-lock-space-intro {
  margin: 0 0 12px;
  font-size: 0.85rem;
  line-height: 1.4;
}

.yal-lock-space-perk {
  margin: 6px 0 0;
  font-size: 0.82rem;
}

.yi-request-cohost {
  border: 1px solid #1d9bf0;
  background: transparent;
  color: #1d9bf0;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.yi-listener-kick {
  border: 0;
  background: transparent;
  color: #f4212e;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  margin-right: 6px;
}

.yi-listener-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

.yi-listener-invite {
  margin-left: auto;
}

.yi-space-chat-head {
  padding: 10px 16px 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #71767b;
  flex-shrink: 0;
}

.yi-space-chat-msgs {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  max-height: none;
  -webkit-overflow-scrolling: touch;
}

.yi-chat-empty {
  margin: 0;
  color: #71767b;
  font-size: 0.84rem;
}

.yi-chat-msg {
  font-size: 0.86rem;
  line-height: 1.4;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.yi-chat-author {
  font-weight: 700;
  color: #e7e9ea;
  margin-right: 6px;
}

.yi-chat-text {
  color: #cfd3d6;
  word-break: break-word;
  flex: 1 1 auto;
}

.yi-chat-del {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #71767b;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 6px;
  opacity: 0.55;
}

.yi-chat-del:hover {
  color: #f4212e;
  opacity: 1;
  background: rgba(244, 33, 46, 0.12);
}

.yi-listener-role-tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: #71767b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 1px solid #2f3336;
  border-radius: 999px;
  padding: 1px 8px;
}

.yi-space-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px 16px 14px;
  border-top: 1px solid #2f3336;
  flex-shrink: 0;
  background: #050505;
}

.yi-space-chat-form input {
  flex: 1;
  border: 1px solid #2f3336;
  background: #000;
  color: #e7e9ea;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.86rem;
}

.yi-space-chat-form button {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  background: #1d9bf0;
  color: #fff;
}

.yi-dock-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #2f3336;
  color: #e7e9ea;
  font-size: 0.88rem;
}

.yi-reaction-pop {
  position: fixed;
  bottom: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: min(340px, calc(100vw - 24px));
  padding: 10px;
  background: #16181c;
  border: 1px solid #2f3336;
  border-radius: 20px;
  z-index: 12750;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  touch-action: manipulation;
}

.yi-reaction-pop button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.yi-reaction-pop button:hover {
  background: #2f3336;
}

@keyframes yi-pop {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.yi-minimized-label {
  font-size: 0.88rem;
  font-weight: 600;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yi-minimized-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f4212e;
  animation: yi-pulse 1.2s infinite;
}

@keyframes yi-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

/* Full-screen Space room — phones only (desktop keeps right-side dock) */
body.yi-in-space-mobile #yi-live-dock-root {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-height: none !important;
  z-index: 12500 !important;
  display: flex !important;
  justify-content: stretch !important;
  align-items: stretch !important;
  pointer-events: none;
  background: var(--yi-bg, #000);
}

body.yi-in-space-mobile #yi-live-dock-root .yi-overlay.yi-overlay-live {
  position: relative !important;
  inset: auto !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  max-height: none !important;
  background: #000 !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  pointer-events: auto;
  box-shadow: none !important;
}

body.yi-in-space-mobile #yi-live-dock-root .yi-overlay.yi-overlay-live .yi-live-room,
body.yi-in-space-mobile #yi-live-dock-root .yi-live-room {
  flex: 1 1 auto !important;
  width: 100% !important;
  max-height: none !important;
  height: 100% !important;
  min-height: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  display: flex !important;
  flex-direction: column !important;
}

/* ---- iOS-style mobile Space room -------------------------------------------
   Header + primary audio controls (mic / request-to-speak / hand) pinned near
   the TOP as a frosted toolbar; the room content scrolls beneath. Fixes the
   old bottom dock where mic + "Request to speak" + Leave wrapped and stacked
   on top of one another. */
body.yi-in-space-mobile .yi-live-room-head {
  order: 0;
  flex-shrink: 0;
  padding-top: calc(env(safe-area-inset-top, 0px) + 10px) !important;
  padding-bottom: 8px !important;
  background: rgba(0, 0, 0, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.12);
}

body.yi-in-space-mobile .yi-live-dock {
  order: 1;
  flex-shrink: 0;
  padding: 10px 14px;
  gap: 10px;
  border-top: 0;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
}

body.yi-in-space-mobile .yi-live-room-main {
  order: 2;
  flex: 1 1 auto;
  min-height: 0;
}

body.yi-in-space-mobile .yi-live-room-body {
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
}

/* Keep the primary controls on ONE row — no more vertical stacking. */
body.yi-in-space-mobile .yi-dock-primary {
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 12px;
  min-width: 0;
}

body.yi-in-space-mobile .yi-mic-wrap {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

/* Hide the thin meter on mobile so the toolbar stays compact and iOS-clean. */
body.yi-in-space-mobile .yi-mic-meter {
  display: none;
}

body.yi-in-space-mobile .yi-mic-btn {
  width: 46px;
  height: 46px;
}

body.yi-in-space-mobile .yi-request-speak-btn {
  padding: 9px 14px;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46vw;
}

/* iOS-style pill toolbar buttons in the header. */
body.yi-in-space-mobile .yi-live-toolbar {
  gap: 8px;
}

body.yi-in-space-mobile .yi-live-toolbar button {
  border-radius: 999px;
  font-weight: 600;
}

body.yi-in-space-mobile .yi-dock-actions {
  gap: 10px;
}

body.yi-in-space-mobile .yi-dock-btn {
  width: 44px;
  height: 44px;
}

/* Isweet Spaces card avatars: on the black background the circles blended in, so
   give them a white ring, and shrink ~30% (66px -> 46px) to fit the page. */
.x-space-speaker-avatar {
  width: 46px !important;
  height: 46px !important;
  border: 2px solid #fff !important;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.65) !important;
  object-fit: cover;
}

/* Isweet Spaces card (React-rendered): the action buttons "Request to speak",
   "Leave Space" and "Start listening" use .x-space-listen-btn and render as
   loose siblings, so on phones they stacked on top of one another. Lay an
   ADJACENT pair side by side; a lone button stays full width. */
@media (max-width: 760px) {
  .x-space-listen-btn:has(+ .x-space-listen-btn),
  .x-space-listen-btn + .x-space-listen-btn {
    display: inline-block !important;
    width: calc(50% - 4px) !important;
    vertical-align: top !important;
    box-sizing: border-box !important;
  }
  .x-space-listen-btn + .x-space-listen-btn {
    margin-left: 8px !important;
    margin-top: 0 !important;
  }
}

/* Desktop / wide browser: dock on the right, page stays usable */
@media (min-width: 761px) {
  body .x-left {
    z-index: 5;
    position: sticky;
  }

  body.yi-in-space:not(.yi-in-space-mobile) #yi-live-dock-root {
    --yi-dock-top: clamp(64px, 12vh, 120px);
    position: fixed !important;
    top: var(--yi-dock-top) !important;
    right: max(16px, calc((100vw - min(1280px, 100vw)) / 2 + 16px)) !important;
    left: auto !important;
    bottom: auto !important;
    width: min(380px, calc(100vw - 32px)) !important;
    max-height: calc(100dvh - var(--yi-dock-top) - 20px) !important;
    z-index: 8800 !important;
    display: block !important;
    justify-content: initial !important;
    align-items: initial !important;
    background: transparent !important;
    pointer-events: none;
  }

  body.yi-in-space:not(.yi-in-space-mobile) #yi-live-dock-root .yi-overlay.yi-overlay-live {
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    max-height: calc(100dvh - var(--yi-dock-top) - 20px) !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.yi-in-space:not(.yi-in-space-mobile) #yi-live-dock-root .yi-live-room {
    height: auto !important;
    max-height: calc(100dvh - var(--yi-dock-top) - 20px) !important;
    border-radius: 16px !important;
    border: 1px solid #2f3336 !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55) !important;
  }
}

@media (max-width: 700px) {
  #yi-live-dock-root {
    top: 64px;
    right: 8px;
    left: 8px;
    width: auto;
  }

  .yi-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .yi-preview {
    width: 100%;
    max-height: 95vh;
    border-radius: 20px 20px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }

  .yi-live-room {
    width: 100%;
    border-radius: 16px;
  }

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

/* Host co-host request panel */
.yi-host-panel {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #2f3336;
  border-radius: 12px;
  background: #0a0a0a;
}

.yi-host-panel-head {
  font-size: 0.88rem;
  font-weight: 700;
  color: #e7e9ea;
  margin-bottom: 10px;
}

.yi-host-count {
  color: #71767b;
  font-weight: 600;
}

.yi-host-empty,
.yi-host-limit-msg {
  margin: 0;
  font-size: 0.82rem;
  color: #71767b;
}

.yi-host-limit-msg {
  margin-top: 8px;
  color: #f97316;
}

.yi-request-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.yi-request-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.yi-request-av,
.yi-listener-av {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.yi-request-av .yi-pill-av,
.yi-listener-av .yi-pill-av {
  width: 32px;
  height: 32px;
}

.yi-listeners-section {
  margin-top: 12px;
}

.yi-listeners-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.yi-listener-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.yi-listener-name {
  flex: 1;
  min-width: 0;
  font-size: 0.86rem;
  color: #e7e9ea;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yi-listener-invite {
  flex-shrink: 0;
  border: 1px solid #536471;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #e7e9ea;
  background: transparent;
  cursor: pointer;
}

.yi-listener-invite:hover {
  background: rgba(231, 233, 234, 0.08);
}

.yi-anon-listeners {
  margin-top: 4px;
}

.yi-request-speak-btn {
  border: 1px solid #536471;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #e7e9ea;
  background: #16181c;
  cursor: pointer;
  white-space: nowrap;
}

.yi-request-speak-btn:hover {
  background: #1d1f23;
}

.yi-request-speak-btn.pending {
  border-color: #1d9bf0;
  color: #1d9bf0;
  background: rgba(29, 155, 240, 0.1);
}

.yi-dock-primary {
  flex-wrap: wrap;
  justify-content: center;
}

.yi-request-name {
  font-size: 0.86rem;
  color: #e7e9ea;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yi-request-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.yi-request-approve,
.yi-request-deny {
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.yi-request-approve {
  background: #e7e9ea;
  color: #000;
}

.yi-request-approve:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.yi-request-deny {
  background: transparent;
  color: #e7e9ea;
  border: 1px solid #536471;
}

.yi-cohost-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.yi-cohost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.yi-cohost-name {
  font-size: 0.86rem;
  color: #e7e9ea;
  font-weight: 600;
}

.yi-pass-host-btn {
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  background: #eff3f4;
  color: #0f1419;
}

.yi-request-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #2f3336;
}

.yi-request-section-head {
  font-size: 0.82rem;
  font-weight: 700;
  color: #71767b;
  margin-bottom: 8px;
}

.yi-transfer-overlay {
  z-index: 6000;
}

.yi-transfer-dialog {
  width: min(420px, 92vw);
  background: #000;
  border: 1px solid #2f3336;
  border-radius: 16px;
  padding: 20px;
  color: #e7e9ea;
}

.yi-transfer-title {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.yi-transfer-note {
  margin: 0 0 16px;
  font-size: 0.88rem;
  color: #71767b;
  line-height: 1.45;
}

.yi-transfer-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.yi-transfer-cohost,
.yi-transfer-leave,
.yi-transfer-cancel {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.yi-transfer-cohost {
  background: #e7e9ea;
  color: #000;
}

.yi-transfer-leave {
  background: transparent;
  color: #e7e9ea;
  border: 1px solid #536471;
}

.yi-transfer-cancel {
  background: transparent;
  color: #71767b;
}

/* Space moderation */
.yi-speaker-mod {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
}

.yi-mod-btn {
  border: 1px solid #2f3336;
  background: #16181c;
  color: #e7e9ea;
  border-radius: 999px;
  width: 28px;
  height: 24px;
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0;
}

.yi-mod-btn:hover {
  background: #2f3336;
}

.yi-host-bulk-actions {
  display: flex;
  gap: 6px;
}

.yi-host-bulk-btn {
  border: 1px solid #536471;
  background: transparent;
  color: #e7e9ea;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.yi-host-bulk-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.yi-host-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.yi-space-settings-overlay {
  z-index: 12650;
}

.yi-space-settings {
  width: min(440px, 94vw);
  max-height: 88vh;
  overflow: auto;
  background: #000;
  border: 1px solid #2f3336;
  border-radius: 16px;
  color: #e7e9ea;
}

.yi-space-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #2f3336;
}

.yi-space-settings-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.yi-space-settings-head button {
  border: 0;
  background: transparent;
  color: #e7e9ea;
  font-size: 1.1rem;
  cursor: pointer;
}

.yi-space-settings-body {
  padding: 12px 16px 18px;
}

.yi-space-settings-body section {
  margin-bottom: 16px;
}

.yi-space-settings-body h4 {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: #71767b;
}

.yi-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #16181c;
  font-size: 0.86rem;
}

.yi-settings-row .muted {
  color: #71767b;
  font-size: 0.78rem;
}

.yi-settings-btn {
  border: 1px solid #536471;
  background: transparent;
  color: #e7e9ea;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.yi-settings-empty {
  margin: 0;
  color: #71767b;
  font-size: 0.84rem;
}

.yi-space-invite-overlay {
  z-index: 12900;
}

.yi-space-invite {
  width: min(460px, 92vw);
  background: #16181c;
  border: 1px solid #2f3336;
  border-radius: 16px;
  margin: 10vh auto;
  color: #e7e9ea;
}

.yi-space-invite-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #2f3336;
}

.yi-space-invite-head h3 {
  margin: 0;
  font-size: 1rem;
}

.yi-space-invite-head button {
  border: 0;
  background: transparent;
  color: #e7e9ea;
  font-size: 1.1rem;
  cursor: pointer;
}

.yi-space-invite-body {
  padding: 16px;
}

.yi-space-invite-label {
  display: block;
  font-size: 0.8rem;
  color: #71767b;
  margin-bottom: 6px;
}

.yi-space-invite-link-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.yi-space-invite-link-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid #2f3336;
  background: #000;
  color: #e7e9ea;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.82rem;
}

.yi-space-invite-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.yi-space-invite-btn {
  border: 1px solid #536471;
  background: transparent;
  color: #e7e9ea;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.yi-space-invite-btn.primary {
  background: #1d9bf0;
  border-color: #1d9bf0;
  color: #fff;
}

.yi-space-invite-hint {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: #1d9bf0;
}

.yi-invite-search {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #2f3336;
  border-radius: 999px;
  background: #000;
  color: #e7e9ea;
  padding: 10px 14px;
  margin-bottom: 10px;
}

.yi-invite-list {
  max-height: min(42vh, 320px);
  overflow-y: auto;
  border: 1px solid #2f3336;
  border-radius: 12px;
  background: #0b0c0d;
  margin-bottom: 12px;
}

.yi-invite-section h4 {
  margin: 0;
  padding: 10px 12px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #71767b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.yi-invite-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #1a1c1f;
  cursor: pointer;
}

.yi-invite-user-row:last-child {
  border-bottom: none;
}

.yi-invite-user-row input {
  flex-shrink: 0;
}

.yi-invite-user-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.82rem;
}

.yi-invite-user-meta strong {
  font-size: 0.9rem;
  color: #e7e9ea;
}

.yi-invite-user-meta span {
  color: #71767b;
}

.yi-invite-role {
  font-size: 0.72rem;
  color: #1d9bf0;
}

.yi-invite-speak-btn {
  border: 1px solid #2f3336;
  background: transparent;
  color: #e7e9ea;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  flex-shrink: 0;
}

.yi-invite-speak-btn:hover {
  border-color: #1d9bf0;
  color: #1d9bf0;
}

.yi-invite-footer {
  display: flex;
  justify-content: flex-end;
}
