@media (max-width: 920px) {
  body {
    overflow: auto;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: auto;
    min-height: 68px;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 14px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .brand strong {
    font-size: 16px;
  }

  #roomLabel {
    max-width: 58vw;
  }

  .top-actions {
    flex: 1 1 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .top-actions .ghost-button,
  .top-actions .primary-button,
  .top-actions .status-badge {
    min-width: 0;
    min-height: 38px;
    padding: 0 10px;
    justify-content: center;
    font-size: 13px;
  }

  .app-layout {
    grid-template-columns: 64px minmax(0, 1fr);
    height: auto;
    min-height: calc(100vh - 68px);
    min-height: calc(100svh - 68px);
  }

  .app-layout.chat-collapsed {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .room-lobby {
    min-height: calc(100vh - 68px);
    min-height: calc(100svh - 68px);
    padding: 28px 14px;
  }

  .room-lobby-form {
    grid-template-columns: 1fr;
  }

  .participant-sidebar {
    padding: 12px 8px;
  }

  .stage {
    padding: 12px;
  }

  .side-panel {
    grid-column: 1 / -1;
    grid-template-rows: none;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .chat-resize-handle {
    display: none;
  }

  .chat-panel-toggle {
    left: auto;
    right: 14px;
    top: -48px;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .app-layout.chat-collapsed .side-panel {
    min-height: 44px;
    border-top-color: transparent;
  }

  .app-layout.chat-collapsed .chat-panel-toggle {
    left: auto;
    right: 8px;
    top: 4px;
    width: 64px;
    height: 36px;
  }

  .app-layout.chat-collapsed .chat-panel {
    display: none;
  }

  .video-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(240px, 1fr);
  }

  .stage.has-tile-strip .stage-video-layout {
    grid-template-columns: minmax(0, 1fr) clamp(170px, 27vw, 230px);
  }

  .focus-layout.video-grid {
    height: calc(100vh - 112px);
    height: calc(100svh - 112px);
    min-height: 420px;
  }

  .focus-layout .video-tile.is-pip {
    right: 12px;
    bottom: var(--pip-offset, 12px);
    width: clamp(132px, 38vw, 210px);
  }

  .tile-strip-list .video-tile.is-pip {
    right: auto;
    bottom: auto;
    width: 100%;
  }

  .focus-layout.video-grid .video-tile.is-fullscreen,
  .focus-layout.video-grid .video-tile:fullscreen,
  .focus-layout.video-grid .video-tile.is-featured.is-fullscreen,
  .focus-layout.video-grid .video-tile.is-featured:fullscreen,
  .focus-layout.video-grid .video-tile.is-pip.is-fullscreen,
  .focus-layout.video-grid .video-tile.is-pip:fullscreen {
    position: fixed;
    inset: 0;
    z-index: 80;
    width: 100vw;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
    transform: none;
  }

  .hidden-tile-dock {
    left: 12px;
    bottom: 88px;
    max-width: calc(100% - 24px);
  }

  .participant-popover {
    left: calc(100% + 8px);
    min-width: 170px;
  }
}

@media (max-width: 760px) {
  body:not(.is-lobby) {
    display: flex;
    flex-direction: column;
    height: var(--app-viewport-height, 100dvh);
    min-height: var(--app-viewport-height, 100dvh);
    overflow: hidden;
  }

  body:not(.is-lobby) .topbar {
    position: relative;
    top: auto;
  }

  body.mobile-chat-open {
    height: var(--app-viewport-height, 100dvh);
    min-height: var(--app-viewport-height, 100dvh);
    overflow: hidden;
  }

  body.mobile-chat-open .topbar {
    position: relative;
    top: auto;
  }

  .topbar {
    min-height: 64px;
    padding: 10px;
  }

  .brand {
    flex: 1 1 auto;
  }

  #roomLabel {
    max-width: 66vw;
  }

  .app-layout {
    flex: 1 1 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    width: 100vw;
    max-width: 100vw;
    height: max(0px, calc(var(--app-viewport-height, 100dvh) - var(--topbar-height, 64px)));
    min-height: 0;
    overflow: hidden;
  }

  .app-layout.chat-collapsed {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .participant-sidebar {
    grid-row: 1;
    padding: 8px 10px 6px;
    overflow: hidden;
    background: rgba(8, 12, 18, 0.96);
    border-right: 0;
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }

  .participant-sidebar::-webkit-scrollbar {
    display: none;
  }

  .participant-sidebar .participants {
    height: auto;
  }

  .participant-sidebar .section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
  }

  .participant-sidebar .section-heading h2 {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .participant-sidebar .section-actions {
    display: flex;
    gap: 8px;
  }

  #participantList {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    min-height: 64px;
    padding: 7px 12px 11px 2px;
    overscroll-behavior-x: contain;
    scroll-padding-inline: 2px 12px;
    scrollbar-width: none;
  }

  #participantList::-webkit-scrollbar {
    display: none;
  }

  .participant-item {
    flex: 0 0 auto;
    width: 62px;
    height: 54px;
    min-height: 54px;
    padding: 0;
  }

  .participant-avatar {
    width: 46px;
    min-width: 46px;
    height: 46px;
    min-height: 46px;
  }

  .participant-status-dots {
    right: -5px;
    top: 50%;
    bottom: auto;
    gap: 2px;
  }

  .participant-status-dot {
    width: 18px;
    height: 18px;
  }

  .participant-status-dot .button-icon {
    width: 10px;
    height: 10px;
  }

  .participant-popover {
    position: fixed;
    left: 10px;
    right: 10px;
    top: auto;
    bottom: calc(74px + env(safe-area-inset-bottom));
    z-index: 60;
    min-width: 0;
    max-width: none;
    max-height: min(430px, calc(100svh - 118px));
    overflow: auto;
    transform: none;
  }

  .participant-audio-row input[type="range"] {
    min-height: 32px;
  }

  .stage {
    grid-column: 1;
    grid-row: 2;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    width: 100vw;
    max-width: 100vw;
    height: var(--stage-viewport-height, calc(100dvh - var(--topbar-height, 64px) - 86px));
    max-height: var(--stage-viewport-height, calc(100dvh - var(--topbar-height, 64px) - 86px));
    min-height: 0;
    padding: 10px;
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
    overflow: hidden;
  }

  .stage-video-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
    gap: 10px;
    min-height: 0;
    overflow: hidden;
  }

  .stage.has-tile-strip .stage-video-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .stage.has-tile-strip .tile-strip-panel {
    grid-column: 1;
    grid-row: 1;
  }

  .stage.has-tile-strip .video-grid {
    grid-column: 1;
    grid-row: 2;
    align-self: stretch;
    min-height: 0;
  }

  .tile-strip-panel {
    order: -1;
    max-width: 100%;
    min-height: 0;
    overflow: hidden;
    padding: 7px;
  }

  .tile-strip-header {
    display: none;
  }

  .tile-strip-list {
    display: flex;
    gap: 8px;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: none;
    scroll-padding-inline: 2px 12px;
    scrollbar-width: none;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
  }

  .tile-strip-list::-webkit-scrollbar {
    display: none;
  }

  .tile-strip-list .video-tile.is-pip {
    flex: 0 0 clamp(126px, 38vw, 174px);
    width: auto;
    min-height: 78px;
    max-width: none;
    touch-action: pan-x;
  }

  .tile-strip-list .video-tile.is-pip .tile-footer {
    min-height: 28px;
    margin: 5px 6px 6px;
    padding: 4px 6px;
    font-size: 11px;
  }

  .video-grid {
    gap: 10px;
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
    grid-auto-rows: minmax(0, 1fr);
  }

  .focus-layout.video-grid {
    align-content: stretch;
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    max-height: none;
  }

  .stage:not(.has-tile-strip) .video-grid {
    min-height: 0;
  }

  .video-grid.single-tile-layout {
    align-content: stretch;
    grid-auto-rows: minmax(0, 1fr);
  }

  .video-grid.single-tile-layout > .video-tile:not(.is-hidden-tile) {
    height: 100%;
    min-height: 0;
  }

  .focus-layout .video-tile.is-featured {
    position: relative;
    inset: auto !important;
    grid-column: 1;
    grid-row: 1;
    align-self: stretch;
    justify-self: stretch;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    display: flex;
    flex-direction: column;
    width: 100% !important;
    max-width: 100% !important;
    height: 100%;
    min-height: 0;
  }

  .focus-layout .video-tile.is-featured video {
    flex: 1 1 0;
    height: auto;
    min-height: 0;
  }

  .focus-layout .video-tile.is-featured .tile-footer {
    flex: 0 0 auto;
  }

  .focus-layout .whiteboard-tile.is-featured .whiteboard-shell {
    flex: 1 1 0;
    width: 100%;
  }

  .focus-layout .video-tile.is-pip {
    left: auto;
    top: auto;
    right: 10px;
    bottom: var(--pip-offset, 10px);
    width: clamp(126px, 42vw, 190px);
    max-width: calc(100% - 20px);
  }

  .tile-strip-list .video-tile.is-pip {
    left: auto !important;
    top: auto !important;
    right: auto;
    bottom: auto;
  }

  .focus-layout .video-tile.is-pip[data-drag-positioned="true"] {
    right: auto;
    bottom: auto;
  }

  .video-tile,
  .focus-layout .video-tile.is-featured {
    border-radius: 8px;
  }

  .video-tile,
  .video-tile video {
    min-height: 0;
  }

  .hidden-tile-dock {
    left: 10px;
    right: 10px;
    bottom: calc(98px + env(safe-area-inset-bottom));
    z-index: 70;
    max-width: none;
  }

  .hidden-tile-button {
    width: 40px;
    height: 40px;
  }

  .side-panel {
    grid-row: 2;
    grid-column: 1;
    align-self: stretch;
    justify-self: stretch;
    z-index: 45;
    height: 0;
    min-height: 0;
    gap: 0;
    padding: 0;
    overflow: visible;
    background: transparent;
    border: 0;
    pointer-events: none;
  }

  .app-layout.chat-collapsed .side-panel {
    min-height: 0;
    border-top-color: transparent;
  }

  .side-panel .chat-panel,
  .app-layout.chat-collapsed .chat-panel {
    display: none;
  }

  .chat-panel-toggle,
  .app-layout.chat-collapsed .chat-panel-toggle {
    position: fixed;
    left: auto;
    right: -8px;
    top: auto;
    bottom: calc(20px + env(safe-area-inset-bottom));
    z-index: 38;
    width: 54px;
    height: 52px;
    border: 1px solid var(--line);
    border-right: 0;
    border-radius: 10px 0 0 10px;
    pointer-events: auto;
  }

  .app-layout.mobile-chat-open .stage {
    display: none;
  }

  .app-layout.mobile-chat-open {
    height: max(0px, calc(var(--app-viewport-height, 100dvh) - var(--topbar-height, 64px)));
    min-height: 0;
    overflow: hidden;
  }

  .app-layout.mobile-chat-open .side-panel {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    align-self: stretch;
    height: auto;
    min-height: 0;
    max-height: none;
    gap: 0;
    padding: 10px 10px max(10px, env(safe-area-inset-bottom));
    overflow: hidden;
    background: var(--bg);
    pointer-events: auto;
  }

  .app-layout.mobile-chat-open .side-panel .chat-panel {
    display: grid;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .app-layout.mobile-chat-open .chat-panel .section-heading {
    padding-right: 50px;
  }

  .app-layout.mobile-chat-open .chat-panel-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    bottom: auto;
    z-index: 30;
    width: 40px;
    height: 40px;
    border-right: 1px solid var(--line);
    border-radius: 8px;
    pointer-events: auto;
  }

  .app-layout.mobile-chat-open .chat-messages {
    min-height: 0;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .stage-controls {
    position: fixed;
    left: 50vw;
    right: auto;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 35;
    --screen-menu-left: calc(100% - 84px);
    --record-menu-left: calc(100% - 32px);
    grid-template-columns: repeat(4, minmax(48px, 52px));
    width: max-content;
    max-width: calc(100vw - 20px);
    gap: 6px;
    margin: 0;
    padding: 8px;
    transform: translateX(-50%);
  }

  .stage-controls.has-camera-switch {
    grid-template-columns: repeat(5, minmax(44px, 52px));
  }

  .stage-controls .mobile-camera-switch.is-visible {
    display: grid;
  }

  .stage-controls .screen-toggle,
  .screen-share-menu {
    display: none !important;
  }

  .screen-share-menu {
    left: 50%;
    right: auto;
    bottom: calc(100% + 10px);
    width: min(320px, calc(100vw - 20px));
    transform: translateX(-50%);
  }

  .recording-menu {
    right: auto;
    bottom: calc(100% + 10px);
    width: min(220px, calc(100vw - 20px));
  }

  .stage > .call-stats {
    left: 10px;
    bottom: 82px;
    width: min(500px, calc(100% - 20px));
  }

  .control-button {
    min-height: 52px;
    padding: 0 6px;
    font-size: 13px;
  }

  .control-icon {
    width: 26px;
    height: 26px;
  }

  .whiteboard-tool-rail {
    left: 6px;
    top: 6px;
    bottom: 6px;
    max-height: none;
  }

  .whiteboard-tool-toggle {
    width: 44px;
    min-width: 44px;
    height: 50px;
  }

  .whiteboard-tool-drawer {
    width: min(294px, calc(100vw - 60px));
    width: min(294px, calc(100cqw - 8px), calc(100vw - 60px));
    max-height: none;
    padding: 10px 10px 10px 52px;
  }

  .whiteboard-tool-button,
  .whiteboard-color-button,
  .whiteboard-action-button,
  .whiteboard-download-button {
    min-height: 44px;
  }

  .whiteboard-text-editor {
    font-size: 16px;
  }

  .whiteboard-modal {
    padding: 10px;
  }

  .whiteboard-modal-card {
    padding: 14px;
  }

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

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-devices {
    grid-template-columns: 1fr;
  }

  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  .settings-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100svh - 20px);
  }

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

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

  .settings-dialog-card {
    padding: 12px;
  }

  .settings-field.wide,
  .settings-toggle.wide,
  .settings-group.wide,
  .phone-notification-help.wide,
  .push-actions.wide,
  .settings-profile.wide,
  .friends-settings.wide {
    grid-column: auto;
  }

  .friend-add-form {
    grid-template-columns: 1fr;
  }

  .profile-token-row:not(.profile-inline-field),
  .profile-gate-token-row {
    grid-template-columns: 1fr;
  }

  .profile-token-row:not(.profile-inline-field) .ghost-button,
  .profile-gate-token-row .ghost-button {
    width: 100%;
  }

  .settings-label-with-help {
    width: 100%;
  }

  .settings-profile {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .call-stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .chat-panel {
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .chat-messages {
    min-height: 0;
    max-height: none;
  }

  .chat-input-row {
    grid-template-columns: 40px 40px minmax(0, 1fr) 40px;
  }

  .chat-image-button {
    max-width: 100%;
  }

  .chat-file-attachment {
    max-width: 100%;
  }

  .chat-image-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100svh - 20px);
  }

  .emoji-picker {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(80px + env(safe-area-inset-bottom));
    max-height: min(280px, 48svh);
  }
}

@media (max-width: 520px) {
  .top-actions {
    grid-template-columns: 48px 48px 48px minmax(0, 1fr);
    align-items: center;
  }

  .status-badge {
    grid-column: 1 / -1;
  }

  .top-actions .icon-text-button {
    width: 48px;
    min-width: 48px;
    height: 48px;
    min-height: 48px;
    padding: 0;
  }

  .top-actions .icon-text-button span:not(.button-icon) {
    display: none;
  }

  .top-actions .icon-text-button .button-icon {
    width: 24px;
    height: 24px;
  }

  #joinButton {
    grid-column: 4;
  }

  .status-badge,
  .control-button,
  .primary-button {
    width: 100%;
    justify-content: center;
  }

  .chat-input-row .chat-send-button {
    width: 40px;
    min-width: 40px;
  }

  .room-lobby {
    padding: 22px 12px;
  }

  .room-lobby-header {
    grid-template-columns: 1fr;
  }

  .room-lobby-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .room-lobby-heading h1 {
    font-size: 24px;
  }

  .recent-room-list,
  .call-stats-grid {
    grid-template-columns: 1fr;
  }

  .recent-room-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .recent-room-actions {
    gap: 5px;
  }

  .recent-room-meta small {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .settings-dialog,
  .chat-image-dialog,
  .settings-panel,
  .call-stat,
  .chat-message {
    border-radius: 8px;
  }

  .tile-footer {
    margin: 8px;
    min-height: 34px;
    font-size: 12px;
  }

  .tile-action {
    width: 34px;
    height: 34px;
  }

  .hide-button {
    left: 52px;
  }

  .zoom-reset-button {
    top: 52px;
  }

  .video-tile:fullscreen .hide-button,
  .video-tile.is-fullscreen .hide-button {
    display: none;
  }

  .video-tile:fullscreen .zoom-reset-button,
  .video-tile.is-fullscreen .zoom-reset-button {
    top: 16px;
    left: 58px;
  }
}

@media (max-width: 390px) {
  #roomLabel {
    max-width: 58vw;
  }

  .stage-controls {
    --screen-menu-left: calc(100% - 84px);
    --record-menu-left: calc(100% - 32px);
    grid-template-columns: repeat(4, 48px);
  }

  .stage-controls.has-camera-switch {
    grid-template-columns: repeat(5, 48px);
  }

  .stage-controls .control-button {
    width: 48px;
  }

  .focus-layout.video-grid {
    height: 100%;
    min-height: 0;
  }

  .focus-layout .video-tile.is-pip {
    width: clamp(112px, 44vw, 156px);
  }

  .tile-strip-list .video-tile.is-pip {
    flex-basis: clamp(112px, 42vw, 150px);
    width: auto;
  }

  .participant-popover {
    bottom: calc(126px + env(safe-area-inset-bottom));
  }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 920px) {
  html.is-mobile-device body:not(.is-lobby):not(.has-expanded-video)::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(8, 12, 18, 0.96);
    backdrop-filter: blur(10px);
  }

  html.is-mobile-device body:not(.is-lobby):not(.has-expanded-video)::after {
    content: "Поверни телефон вертикально";
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 111;
    width: min(420px, calc(100vw - 40px));
    padding: 18px 20px;
    color: var(--text);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
    background: rgba(17, 24, 35, 0.92);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    transform: translate(-50%, -50%);
  }

  html.is-mobile-device body:not(.is-lobby):not(.has-expanded-video) .app-layout,
  html.is-mobile-device body:not(.is-lobby):not(.has-expanded-video) .topbar {
    pointer-events: none;
  }

  .topbar {
    position: relative;
  }

  .app-layout {
    grid-template-columns: 60px minmax(0, 1fr) minmax(280px, min(var(--chat-panel-width, 34vw), 42vw));
    grid-template-rows: 1fr;
    height: calc(100vh - 64px);
    height: calc(100svh - 64px);
  }

  .app-layout.chat-collapsed {
    grid-template-columns: 60px minmax(0, 1fr) 44px;
  }

  .participant-sidebar {
    display: block;
    grid-row: auto;
    padding: 8px 7px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  #participantList {
    display: grid;
    overflow: visible;
  }

  .stage {
    grid-row: auto;
    height: auto;
    max-height: none;
    padding: 8px;
    padding-bottom: 70px;
  }

  .stage-video-layout,
  .stage.has-tile-strip .stage-video-layout {
    grid-template-columns: minmax(0, 1fr) clamp(150px, 24vw, 210px);
    grid-template-rows: minmax(0, 1fr);
    gap: 8px;
  }

  .tile-strip-panel {
    order: initial;
    padding: 7px;
  }

  .tile-strip-header {
    display: none;
  }

  .tile-strip-list {
    display: grid;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .tile-strip-list .video-tile.is-pip {
    flex-basis: auto;
    width: 100%;
    min-height: 78px;
  }

  .side-panel {
    grid-row: auto;
    grid-column: auto;
    padding: 8px;
    overflow: auto;
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .focus-layout.video-grid {
    height: 100%;
    min-height: 0;
  }

  .stage-controls {
    position: absolute;
    left: 50%;
    bottom: calc(8px + env(safe-area-inset-bottom));
    --screen-menu-left: calc(100% - 138px);
    --record-menu-left: calc(100% - 32px);
    grid-template-columns: repeat(5, 48px);
    margin: 0;
    padding: 6px;
    transform: translate(-50%, var(--stage-controls-y));
  }

  .stage-controls.has-camera-switch {
    grid-template-columns: repeat(6, 48px);
  }

  .stage-controls .mobile-camera-switch.is-visible {
    display: grid;
  }

  .screen-share-menu {
    right: auto;
    width: min(300px, calc(100vw - 20px));
  }

  .recording-menu {
    right: auto;
    width: min(220px, calc(100vw - 20px));
  }

  .app-layout.mobile-chat-open {
    grid-template-columns: 60px minmax(0, 1fr);
    grid-template-rows: 1fr;
  }

  .app-layout.mobile-chat-open .participant-sidebar {
    grid-column: 1;
  }

  .app-layout.mobile-chat-open .side-panel {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    height: auto;
    min-height: 0;
    padding: 8px;
    overflow: hidden;
    background: var(--bg);
    border-left: 1px solid var(--line);
    pointer-events: auto;
  }

  .app-layout.mobile-chat-open .side-panel .chat-panel {
    display: grid;
    height: 100%;
  }

  .app-layout.mobile-chat-open .chat-panel-toggle {
    position: absolute;
    top: 8px;
    right: 8px;
    bottom: auto;
    width: 40px;
    height: 40px;
  }
}
