Custom Google Search Implementation gone weird following Ghost documentation

I am trying to add Programmable search but it’s functioning weiredly.

I even customized the search layout to be compact like this.

https://cse.google.com/cse?cx=e1e9270b449b57fa8#gsc.tab=0

I want have followed all the instructions provided in the documentation


I want to add Custom search in the menu bar or in the header. Please point me in the right direction as the documentation seems to outdated.