Fix layout issues in Safari and small-screen devices