Tabbed Tabbed Container UI

I’d love for there to be a better UI for tabbed containers in tabbed containers.

The current UI has a lot of extra space in the margin of the second internal container:

I’d love if I could have the component look something like this (the second row of tabs being contingent on the first row):