Adjoint-optimized metasurfaces for compact mode-division multiplexing