Electron–phonon coupling in a two-dimensional inhomogeneous electron gas: consequences for surface spectral properties