How to align a button at the button of the sidebar?

If I understand you correctly. You want to add an additional sidebar? It’s always better to share minimal clone of your app or some picture of the problem.

max-height ensure only that it won’t be higher than some size. It won’t change the size.

Don’t use px to set it. It changes depending of the screen size (1080p, 4k etc.). Use vh (view height) or vw (view width)

height: calc(100vh - 54px);

54px to leave the place for the top app nav bar

And regarding the button look there.