Photonic bound states in the continuum (BICs) are eigenmodes with an infinite lifetime, which coexist with a continuous spectrum of radiating waves. BICs are not only of great theoretical interest, but have a wide range of practical applications, e.g. in the design of optical resonators. Here, we study this phenomenon in a new integrated nanophotonic element consisting of a single dielectric ridge terminating an abruptly ended slab waveguide. This structure can be considered as an on-chip analogue of the Gires-Tournois interferometer (GTI). We demonstrate that, in contrast to the conventional GTI, the proposed integrated structure supports high-Q phase resonances and "conditional" BICs. We develop a simple but extremely accurate coupled-wave model, which clarifies the physics of the BIC formation and enables predicting their locations. We show that the studied BICs are topologically protected and, for the first time, investigate the strong phase resonance effect, which occurs when two BICs with opposite topological charges annihilate.