Born-Oppenheimer approximation in open systems