.learning-surface-fit-canvas {
  position: fixed !important;
  top: var(--learning-surface-top, 50%) !important;
  left: var(--learning-surface-left, 50%) !important;
  z-index: 20;
  box-sizing: border-box !important;
  width: 1180px !important;
  max-width: none !important;
  height: var(--learning-surface-height, 500px) !important;
  min-height: 0 !important;
  margin: 0 !important;
  transform: translate(-50%, -50%) scale(var(--learning-surface-scale, 1));
  transform-origin: center center;
  overflow: hidden !important;
}

body.learning-surface-fit-mode {
  overflow: hidden !important;
}

body.learning-surface-fit-mode .main-sidebar {
  display: none !important;
}

body.learning-surface-fit-mode[data-current-view="lesson"] .workbench-header {
  display: none !important;
}

body.learning-surface-fit-mode[data-current-view="lesson"].landscape-menu-open .workbench-header {
  display: flex !important;
}

body.learning-surface-fit-mode .app-shell,
body.learning-surface-fit-mode .app-content {
  width: 100vw !important;
  height: 100dvh !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.learning-surface-fit-mode .learning-surface-fit-canvas > .unified-test-card,
body.learning-surface-fit-mode .learning-surface-fit-canvas > .special-training-card,
body.learning-surface-fit-mode .learning-surface-fit-canvas .lesson-view,
body.learning-surface-fit-mode .learning-surface-fit-canvas .workspace {
  height: 100% !important;
  min-height: 0 !important;
}

body.learning-surface-fit-mode[data-current-view="lesson"]:not(.landscape-menu-open) .context-return-bar,
body.learning-surface-fit-mode[data-current-view="lesson"] .pretest-warning:not([hidden]) {
  display: none !important;
}

body.learning-surface-fit-mode[data-current-view="lesson"] .context-return-bar + .workspace {
  height: 100% !important;
}

body.learning-surface-fit-mode[data-current-view="lesson"] .stage-column,
body.learning-surface-fit-mode[data-current-view="lesson"] .stage-column > .stage,
body.learning-surface-fit-mode[data-current-view="lesson"] .memory-panel {
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
}

@media (orientation: landscape) {
  body.learning-surface-fit-mode[data-current-view="lesson"] .landscape-focus-toggle {
    position: fixed !important;
    top: 6px !important;
    left: 8px !important;
    right: auto !important;
    z-index: 141 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: max-content !important;
    min-width: 116px !important;
    max-width: none !important;
    height: 44px !important;
    padding: 4px !important;
    border-radius: 7px !important;
    white-space: nowrap !important;
  }

  body.learning-surface-fit-mode[data-current-view="lesson"] .landscape-focus-toggle::before {
    display: none !important;
    content: none !important;
  }

  body.learning-surface-fit-mode[data-current-view="lesson"].landscape-menu-open .landscape-focus-toggle {
    top: 72px !important;
  }

  /* Align expanded navigation with the centered learning surface frame. */
  body.learning-surface-fit-mode[data-current-view="lesson"].landscape-menu-open .workbench-header {
    position: fixed !important;
    top: 0 !important;
    left: 50% !important;
    width: min(1180px, calc(100vw - 32px)) !important;
    max-width: none !important;
    transform: translateX(-50%) !important;
    box-sizing: border-box !important;
  }
}
