body:has(#room:not([hidden])) #app {
  padding: 8px 12px 0;
  max-width: none;
  width: 100%;
}
.room-topline,
.control-guidance,
.room-counts {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
}
.room-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  scrollbar-gutter: auto;
}
.room-content .bubble-video-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.room-content .stage-wrap,
.room-content .stage-wrap:has(.stage:not([hidden])) {
  position: static;
  flex: 1;
  min-height: 0;
  padding: 8px 0;
  background: transparent;
  border: 0;
  overflow: auto;
  align-items: safe center;
}
.room-content .stage:not([hidden]) {
  min-height: 0;
  max-height: 100%;
  align-content: safe center;
  justify-content: safe center;
  align-items: center;
  flex-wrap: wrap;
  overflow: auto;
}
.room-content .bubble-focus:not([hidden]) {
  flex: 1;
  min-height: 0;
}
.room-content .bubble-focus:not([hidden]) + .stage-wrap {
  flex: 0 0 auto;
  max-height: 112px;
  overflow: hidden;
}
.room-content .bubble-focus:not([hidden]) + .stage-wrap .stage {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
}
@media (max-height: 500px) and (min-width: 600px) {
  .room-content .bubble-focus:not([hidden]) + .stage-wrap {
    max-height: 100%;
  }
  .room-content .bubble-focus:not([hidden]) + .stage-wrap .stage {
    overflow-x: hidden;
    overflow-y: auto;
  }
}
.room-apps {
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.workspace-navigation {
  flex-shrink: 0;
  margin: 0;
}
.app-tabs {
  min-width: 0;
}
.workspace-status:empty {
  display: none;
}
.app-panel {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
}
body[data-workspace-view="videos"] .app-panel {
  display: none;
}
body[data-workspace-view="apps"] .room-apps {
  flex: 1;
}
body[data-workspace-view="apps"] .room-content .bubble-video-stage {
  flex: 0 0 auto;
}
body[data-workspace-view="apps"] .room-content .stage:not([hidden]) {
  flex-wrap: nowrap;
  min-height: 0;
}
body[data-workspace-view="apps"] .room-content .stage-wrap {
  flex: 0 0 auto;
  max-height: 168px;
}
.app-window {
  position: absolute;
  width: 360px;
  height: 480px;
  max-width: 100%;
  max-height: 100%;
  min-width: 240px;
  min-height: 180px;
  resize: both;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}
.app-window-handle {
  touch-action: none;
  cursor: grab;
  flex: 0 0 36px;
  min-height: 36px;
  border-radius: 0;
  font-size: 12px;
}
.app-window-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.app-window-content .app-frame {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
}
.control-bar {
  gap: 8px;
  flex-wrap: nowrap;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  min-height: 60px;
}
.control-bar .brand {
  flex: 0 0 32px;
  margin: 0;
}
.control-bar .brand-mark {
  width: 25px;
  height: 25px;
}
.room-name {
  min-width: 0;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 8px;
  font-size: 13px;
}
.control-actions {
  margin-left: auto;
  gap: 6px;
  flex-wrap: nowrap;
}
#room-actions {
  display: flex;
}
#mic-button,
#screen-button,
#room-actions button {
  min-width: 44px;
  width: 44px;
  height: 44px;
  padding: 10px;
}
#mic-button svg,
#screen-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
#mic-button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}
#camera-button {
  min-width: 100px;
  padding: 12px;
}
#copy-status {
  position: absolute;
  bottom: 100%;
  left: 40px;
  font-size: 12px;
}
.copied {
  animation: copied 0.3s ease;
}
@keyframes copied {
  50% {
    transform: translateY(-3px);
  }
}
.feedback-widget {
  position: static;
  flex: 0 0 auto;
  align-self: end;
  margin: 0 12px 4px;
}
.feedback-widget > button {
  min-height: 24px;
  padding: 2px 8px;
  font-size: 11px;
}
.feedback-panel {
  position: fixed;
  bottom: 90px;
  right: 12px;
  max-width: calc(100vw - 24px);
  z-index: 10;
}
.app-builder {
  position: absolute;
  inset: 12px;
  z-index: 5;
  overflow: auto;
  background: var(--paper);
  padding: 16px;
}
@media (max-width: 760px), (max-height: 500px) {
  body:has(#room:not([hidden])) #app {
    padding: 4px 6px 0;
  }
  .app-window {
    position: absolute;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0;
    min-height: 0;
    resize: none;
    border: 0;
    border-radius: 0;
  }
  .app-window[data-active="false"] {
    display: none;
  }
  .app-window-handle {
    display: none;
  }
  body[data-workspace-view="apps"] #room .room-content .stage-wrap {
    max-height: 94px;
    padding: 2px 0;
  }
  body[data-workspace-view="apps"] .room-content .stage .bubble {
    width: 64px;
    flex-basis: 64px;
  }
  body[data-workspace-view="apps"] .room-content .stage .screen-tile {
    width: 96px;
    flex-basis: 96px;
  }
  .control-bar {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 44px;
    gap: 4px;
  }
  .control-actions {
    grid-column: 1 / -1;
    justify-content: center;
    width: 100%;
    margin: 0;
  }
  .room-name {
    max-width: 100%;
    text-align: left;
  }
  .control-bar .brand {
    width: 28px;
  }
  .workspace-navigation > button {
    padding: 8px;
    font-size: 12px;
  }
  .feedback-widget {
    margin-bottom: 2px;
  }
}
@media (max-height: 500px) and (min-width: 600px) {
  .control-bar {
    display: flex;
  }
  .control-actions {
    width: auto;
    margin-left: auto;
  }
  body[data-workspace-view="apps"] .room-content .stage-wrap {
    max-height: 78px;
  }
  body[data-workspace-view="apps"] .room-content .stage .bubble {
    width: 48px;
    flex-basis: 48px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .copied {
    animation: none;
  }
}

#room {
  padding: 0;
}
#room .control-bar {
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}
#room .room-apps {
  max-width: none;
  width: 100%;
  background: transparent;
}
#room .stage {
  padding: 4px;
}
body[data-workspace-view="videos"] #room .stage:not([hidden]) .bubble {
  width: min(65vw, 36dvh, 300px);
  flex-basis: min(65vw, 36dvh, 300px);
}
body[data-workspace-view="videos"]
  #room[data-bubble-size="small"]
  .stage:not([hidden])
  .bubble {
  width: min(45vw, 24dvh, 190px);
  flex-basis: min(45vw, 24dvh, 190px);
}
body[data-workspace-view="videos"]
  #room[data-bubble-size="medium"]
  .stage:not([hidden])
  .bubble {
  width: min(55vw, 30dvh, 240px);
  flex-basis: min(55vw, 30dvh, 240px);
}
@media (max-width: 760px), (max-height: 500px) {
  body[data-workspace-view="apps"] #room .stage:not([hidden]) .bubble {
    width: 56px;
    flex-basis: 56px;
  }
  body[data-workspace-view="apps"] #room .stage:not([hidden]) .screen-tile {
    width: 80px;
    flex-basis: 80px;
  }
}

#room .room-counts {
  display: flex;
}
#room .control-guidance > span {
  display: block;
}
body[data-workspace-view="apps"] #room .stage-wrap:has(#stage[hidden]) {
  display: none;
}

#room .screen-tile .bubble-media {
  aspect-ratio: 16 / 9;
}
body[data-workspace-view="videos"]
  #room
  .bubble-focus:not([hidden])
  + .stage-wrap
  .bubble {
  width: 56px;
  flex-basis: 56px;
}
body[data-workspace-view="videos"]
  #room
  .bubble-focus:not([hidden])
  + .stage-wrap
  .screen-tile {
  width: 80px;
  flex-basis: 80px;
}
#room .bubble-focus .bubble-media {
  max-height: var(--focus-video-height);
}

#room .bubble-focus .bubble-media {
  height: var(--focus-video-height);
  aspect-ratio: auto;
}

@media (max-height: 500px) and (min-width: 600px) {
  body[data-workspace-view="videos"]
    #room
    .bubble-video-stage:has(.bubble-focus:not([hidden])) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
  }
  body[data-workspace-view="videos"] #room .bubble-focus + .stage-wrap .stage {
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: safe center;
  }
}

@media (max-height: 500px) and (min-width: 600px) {
  body[data-workspace-view="apps"] #room .stage:not([hidden]) .bubble {
    width: 44px;
    flex-basis: 44px;
  }
  body[data-workspace-view="apps"] #room .stage:not([hidden]) .screen-tile {
    width: 64px;
    flex-basis: 64px;
  }
}

body[data-workspace-view="videos"] #room .stage.stream-grid {
  display: grid;
  height: 100%;
  flex-shrink: 0;
  grid-template-columns: repeat(var(--stream-columns), var(--stream-size));
  grid-auto-rows: calc(var(--stream-size) + 26px);
  gap: 12px;
  width: 100%;
  align-items: start;
  justify-content: safe center;
  align-content: safe center;
}
body[data-workspace-view="videos"]
  #room
  .stage.stream-grid:not([hidden])
  > :is(.bubble, .screen-tile) {
  width: calc(var(--stream-size) * var(--stream-media-scale, 1));
  justify-self: center;
  max-width: none;
  min-width: 0;
}
body[data-workspace-view="videos"]
  #room
  .stage.stream-grid
  > :nth-child(6 of :not([hidden])) {
  grid-column: 1;
}
@media (max-width: 760px), (max-height: 500px) {
  body:has(#room:not([hidden])) {
    position: fixed;
    top: var(--room-viewport-top, 0px);
    width: 100%;
    height: var(--room-viewport-height, 100dvh);
  }
  body.chat-keyboard .control-bar,
  body.chat-keyboard .feedback-widget {
    display: none;
  }
}
.site-footer {
  padding: 12px 24px;
}
.site-footer .brand-mark {
  width: 25px;
  height: 25px;
}
