body.mobile-site {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background: #05080d;
}

.mobile-site .app,
.mobile-shell,
.mobile-shell .stage,
.mobile-shell .left-stage {
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
}

.mobile-shell {
  position: relative;
  display: block;
  background: #05080d;
}

.mobile-shell .stage,
.mobile-shell .left-stage {
  position: absolute;
  inset: 0;
  display: block;
  background: #05080d;
}

.mobile-shell .topbar {
  position: fixed;
  z-index: 35;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  gap: 8px;
  padding: max(10px, env(safe-area-inset-top)) 12px 12px;
  border-bottom: 0;
  color: #ffffff;
  background: linear-gradient(180deg, rgba(5, 8, 13, 0.92), rgba(5, 8, 13, 0.58) 72%, transparent);
  pointer-events: none;
}

.mobile-shell .topbar > * {
  pointer-events: auto;
}

.mobile-shell .brand {
  min-width: 0;
}

.mobile-shell .brand-title {
  gap: 8px;
  margin: 0 0 3px;
}

.mobile-shell .brand-title img {
  width: 27px;
  height: 27px;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.26);
}

.mobile-shell h1 {
  max-width: 68vw;
  overflow: hidden;
  color: #ffffff;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
}

.mobile-shell .brand p {
  max-width: 94vw;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.72);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.mobile-shell .top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.mobile-shell .top-actions::-webkit-scrollbar {
  display: none;
}

.mobile-shell .capacity-pill,
.mobile-shell .live-pill,
.mobile-shell .status-pill {
  min-width: max-content;
  min-height: 30px;
  border-color: rgba(255, 255, 255, 0.16);
  padding: 5px 9px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(14px);
  font-size: 12px;
}

.mobile-shell .live-pill {
  color: #ffffff;
  border-color: rgba(43, 191, 145, 0.45);
  background: rgba(43, 191, 145, 0.22);
}

.mobile-shell .live-pill.is-offline {
  color: #ffd7d7;
  border-color: rgba(255, 120, 120, 0.42);
  background: rgba(185, 50, 50, 0.24);
}

.mobile-shell .status-pill.active {
  color: #ffffff;
  border-color: rgba(43, 191, 145, 0.45);
  background: rgba(43, 191, 145, 0.22);
}

.mobile-shell .status-pill.ended {
  color: #ffd7d7;
  border-color: rgba(255, 120, 120, 0.42);
  background: rgba(185, 50, 50, 0.24);
}

.mobile-shell .status-pill.is-animated {
  min-width: 56px;
}

.mobile-shell .status-pill.idle-animation {
  color: rgba(255, 255, 255, 0.78);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
}

.mobile-shell .status-pill.searching-animation {
  color: #ffffff;
  border-color: rgba(43, 191, 145, 0.45);
  background: rgba(43, 191, 145, 0.22);
}

.mobile-shell .video-grid {
  position: fixed;
  inset: 0;
  display: block;
  min-height: 100dvh;
  padding: 0;
  border: 0;
  background: radial-gradient(circle at 20% 16%, #183b42 0, #05080d 56%);
}

.mobile-shell .video-box {
  border: 0;
  background: #05080d;
}

.mobile-shell .video-box.remote {
  width: 100%;
  height: 100dvh;
  border-radius: 0;
}

.mobile-shell .video-box.remote video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mobile-shell .video-box.local {
  position: fixed;
  z-index: 24;
  right: 12px;
  bottom: calc(150px + env(safe-area-inset-bottom));
  width: clamp(140px, 32vw, 190px);
  aspect-ratio: 3 / 4;
  min-height: 138px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 18px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
}

.mobile-shell .video-box.local video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mobile-shell .video-empty {
  max-width: 100%;
  padding: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 16px;
  text-align: center;
}

.mobile-shell .video-box.local .video-empty {
  max-width: 100%;
  font-size: 12px;
}

.mobile-shell .video-label {
  left: 12px;
  bottom: calc(150px + env(safe-area-inset-bottom));
  max-width: calc(100vw - 188px);
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
  background: rgba(5, 8, 13, 0.56);
  backdrop-filter: blur(12px);
  font-size: 12px;
}

.mobile-shell .video-box.local .video-label {
  left: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  padding: 4px 7px;
  font-size: 11px;
}

.mobile-shell .preview-controls {
  right: 8px;
  top: 8px;
  bottom: auto;
  gap: 5px;
}

.mobile-shell .preview-control {
  width: 32px;
  height: 32px;
  min-height: 32px;
  border-radius: 999px;
}

.mobile-shell .preview-control svg {
  width: 17px;
  height: 17px;
}

.mobile-control-dock {
  position: fixed;
  z-index: 34;
  left: 10px;
  right: 10px;
  bottom: max(10px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(0, 0.84fr) minmax(0, 0.84fr);
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 22px;
  background: rgba(9, 14, 22, 0.78);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(18px);
}

.mobile-control-dock button {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0 10px;
  border-radius: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
}

.mobile-control-dock .secondary {
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.mobile-control-dock .secondary:hover {
  background: rgba(255, 255, 255, 0.16);
}

.mobile-control-dock .danger {
  background: rgba(185, 50, 50, 0.92);
}

.mobile-control-dock button[hidden] {
  display: none;
}

.chat-unread {
  position: absolute;
  top: 5px;
  right: 8px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--danger);
  font-size: 10px;
}

.mobile-sheet-backdrop {
  position: fixed;
  z-index: 44;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(5px);
}

.mobile-sheet-backdrop[hidden] {
  display: none;
}

.mobile-shell .setup,
.mobile-shell .chat-panel {
  position: fixed;
  z-index: 50;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(78dvh, 640px);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  background: var(--panel);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.35);
  transform: translateY(calc(100% + 24px));
  transition: transform 0.24s ease;
  pointer-events: none;
}

.mobile-shell .setup[hidden],
.mobile-shell .chat-panel[hidden] {
  display: none;
}

.mobile-shell.setup-open .setup,
.mobile-shell.chat-open .chat-panel {
  transform: translateY(0);
  pointer-events: auto;
}

.mobile-shell .setup {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  height: auto;
  min-height: 0;
  padding: 16px 16px max(18px, env(safe-area-inset-bottom));
  overflow: auto;
}

.setup-sheet-head,
.mobile-shell .chat-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.setup-sheet-head strong,
.mobile-shell .chat-panel-head strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
}

.setup-sheet-head span,
.mobile-shell .chat-panel-head span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.sheet-close {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--panel-soft);
  font-size: 12px;
  font-weight: 800;
}

.sheet-close:hover {
  color: #ffffff;
  background: var(--accent);
}

.mobile-shell .setup label {
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.mobile-shell .setup input,
.mobile-shell .setup select {
  min-height: 46px;
  border-color: var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--panel-soft);
  font-size: 16px;
}

.setup-sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.setup-sheet-actions .theme-toggle {
  grid-column: 1 / -1;
  width: 100%;
}

.setup-sheet-actions .site-menu {
  width: 100%;
}

.setup-sheet-actions .site-menu summary {
  width: 100%;
  min-height: 38px;
  justify-content: center;
  border-radius: 999px;
}

.setup-sheet-actions .site-menu nav {
  left: 0;
  right: auto;
  width: min(286px, calc(100vw - 44px));
}

.mobile-shell .support-link {
  display: inline-flex;
  justify-content: center;
  min-height: 38px;
  border-radius: 999px;
  padding: 0 11px;
  font-size: 12px;
}

.mobile-shell .theme-toggle {
  min-width: 0;
  color: var(--muted);
  background: var(--panel-soft);
}

.mobile-shell .chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: min(78dvh, 640px);
  min-height: 360px;
  overflow: hidden;
  border-left: 1px solid var(--line);
}

.mobile-shell .chat-panel.has-sponsor {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.mobile-shell .chat-panel-head {
  min-height: 56px;
  padding: 14px 16px 10px;
}

.mobile-shell .sponsor-slot {
  display: block;
  min-height: 0;
}

.mobile-shell .sponsor-card {
  grid-template-columns: minmax(0, 1fr);
  margin: 0 16px 10px;
  padding: 10px 12px;
  border-radius: 14px;
}

.mobile-shell .sponsor-card img,
.mobile-shell .sponsor-card em {
  display: none;
}

.mobile-shell .chat-scroll {
  min-height: 0;
  overflow: hidden;
}

.mobile-shell .log {
  height: 100%;
  min-height: 0;
  padding: 12px 16px;
  gap: 8px;
  overflow: auto;
}

.mobile-shell .message {
  max-width: 90%;
  padding: 9px 11px;
  border-radius: 16px;
  font-size: 14px;
}

.mobile-shell .typing-line {
  height: 24px;
  min-height: 24px;
  max-height: 24px;
  padding: 3px 16px 6px;
  font-size: 12px;
}

.mobile-shell .composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  gap: 8px;
  height: auto;
  min-height: 0;
  max-height: none;
  padding: 10px 12px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.mobile-shell .composer.is-idle,
.mobile-shell .composer.is-searching {
  display: none;
}

.mobile-shell .composer input {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 16px;
}

.mobile-shell .composer button {
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
  padding: 0 8px;
  font-size: 13px;
}

.mobile-site .age-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
}

.mobile-site .age-card {
  width: 100%;
  max-width: 520px;
  max-height: calc(100dvh - 28px);
  overflow: auto;
  border-radius: 22px;
  padding: 18px;
}

.mobile-site .age-card button {
  width: 100%;
}

@media (max-width: 380px) {
  .mobile-shell h1 {
    max-width: 60vw;
    font-size: 16px;
  }

  .mobile-shell .brand p {
    max-width: 88vw;
  }

  .mobile-shell .live-pill {
    display: none;
  }

  .mobile-control-dock {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .mobile-control-dock button {
    min-height: 44px;
  }

  .mobile-shell .video-box.local {
    width: clamp(106px, 34vw, 136px);
    bottom: calc(140px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 620px) {
  .mobile-site .age-gate {
    justify-content: flex-start;
  }

  .mobile-site .age-card {
    max-width: 360px;
  }

  .mobile-control-dock,
  .mobile-shell .setup,
  .mobile-shell .chat-panel {
    left: 10px;
    right: auto;
    width: calc(100vw - 20px);
    max-width: 370px;
  }
}

@media (min-width: 760px) {
  .mobile-shell .topbar {
    left: 18px;
    right: 18px;
    top: 12px;
    border-radius: 22px;
    padding: 14px 16px;
    background: rgba(5, 8, 13, 0.68);
    backdrop-filter: blur(18px);
  }

  .mobile-control-dock {
    left: 50%;
    right: auto;
    width: min(560px, calc(100vw - 40px));
    transform: translateX(-50%);
  }

  .mobile-shell .video-box.local {
    right: 22px;
    bottom: calc(150px + env(safe-area-inset-bottom));
    width: clamp(170px, 22vw, 240px);
  }

  .mobile-shell .setup {
    left: 50%;
    right: auto;
    width: min(560px, calc(100vw - 40px));
    transform: translate(-50%, calc(100% + 24px));
    border-radius: 24px 24px 0 0;
  }

  .mobile-shell.setup-open .setup {
    transform: translate(-50%, 0);
  }

  .mobile-shell .chat-panel {
    left: auto;
    right: 18px;
    bottom: 18px;
    width: min(480px, 52vw);
    height: calc(100dvh - 36px);
    max-height: calc(100dvh - 36px);
    border: 1px solid var(--line);
    border-radius: 24px;
    transform: translateX(calc(100% + 42px));
  }

  .mobile-shell.chat-open .chat-panel {
    transform: translateX(0);
  }
}
