presence of mind
n//ˌpɹɛz(ə)ns əv ˈmaɪnd//sinnesnärvaro
Focused alertness, good sense, quick-thinking resourcefulness, or stability of feeling and thought, especially in spite of circumstances which are distracting, stressful, or otherwise challenging.