Spectral variability in cool main-sequence stars due to small-scale magnetic features