Supercomplex spectra and continuum emission from rare-earth ions: Sm, a case study