Oh I am sorry, MMM. It appears you are indeed using a soft edged brush the way I suggested, and this may be the source of your problems in taking the blue right up to the coastline.

If you use a harder edged brush, or the same brush but very much smaller, you will find it easier to get into all the little corners

Once you have got it right, though, you can use the extent you have painted on that layer to make yourself a mask, so that you can select either everything that is the sea, or everything that is not the sea, and work on that - either on the same layer, or on a new one.

The way to use the painted part of a layer as a mask is to right click the layer in the layer docker and choose "Alpha to selection", which is near the bottom of the list. Once you have done that you can choose whichever layer you want to work on and paint away, knowing that your paint will only ever work in the same area as the sea. even though it may be on a different layer.

If you want to paint the land but avoid the sea, then select the sea as described above, but then go to Select/invert, so that everything that is not the sea colour is selected, and you can paint without fear of overlapping into the sea.

You can do all kinds of fancy stuff with layer masks and so on, but lets keep it relatively simple to start with