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.

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.