Thanks for very much for sharing your experiences. You must have a lot of learned experiences from 2 such episodes. Making it a habit to turn inwards, to the extent that we are aware of how things are going before they become symptoms, as you say, is so important. It seems to be a much healthier habit than many which we all adopt without us even realising. I’m pleased that helps you and I’m sure it will help others.
With the electronic devices, if I feel that I’m getting plugged in too much or too easily (at any point in the day) I make it a habit to not touch anything electronic until at least one hour after I wake. I wake up very early (which reminds us that we have great self control) then go through a simple routine of doing everything else first (eg sitting/ meditating, then journaling, then some studying – about 20 minutes of each in a row) then I get on with the essentials of the day – preparing lunches for school, showering etc etc. This time before anything else brings up for me what I really need to do in the day and it throws up a little priority list (of what’s actually going to be possible in the day). Interestingly, it really works and keeps me off all devices for hours. When I do open one up, I clearly have more self control over what I’m doing on there and I really value that! Have you ever tried that??