Comparing the basicity of heterocyclic amines

Compare the relative basicity of the following amines. I know that the higher the electron density on the nitrogen the higher will be its basicity. So here’s my take on each option.

(a)The Nitrogen lone pair undergoes resonance. It’s not good for basic strength

(b) A doubly bonded nitrogen lone pair does not undergo resonance. So, the Nitrogen lone pair are localised.

(c) Both nitrogen atoms are doubly bonded and so their lone pair won’t be delocalised and the electron density is localised here as well.

(d) There’s no question of resonance here so the lone pairs are localised anyway

From the above points my answer is (c)>(b)>(d)>(a) but the answer given is (d)>(b)>(c)>(a)

Is there any mistake in my reasoning?

The correct order is in fact $$(\bf{d}) \gt (\bf{b}) \gt (\bf{c}) \gt (\bf{a})$$, the reason for this is as follows.

$$(\bf{a})$$ is definitely last in this order of basicity since its lone pair is delocalised by the phenyl ring. Now we need to compare the other three.

We can split this into two parts, a comparison between

1. $$(\bf{d})$$ and $$(\bf{b})$$
2. $$(\bf{b})$$ and $$(\bf{c})$$

The basicity of $$(\bf{d})$$ would be greater than that of $$(\bf{b})$$ because of the fact that in $$(\bf{d})$$, the nitrogen with the localised lone pair is $$\mathrm{sp}^3$$ whereas in case of $$(\bf{b})$$, the lone pair is seen on an $$\mathrm{sp^2}$$ nitrogen. Since an $$\mathrm{sp^2}$$ nitrogen is more electronegative than an $$\mathrm{sp^3}$$ nitrogen, it holds the electrons closer, thereby leading to less accessible electron density. Therefore $$(\bf{d}) \gt (\bf{b})$$.

Now, moving on $$(\bf{b})$$ and $$(\bf{c})$$. In case of $$(\bf{c})$$, one of the nitrogen atoms has a -I effect on the other nitrogen atom, thereby leading to lower electron density and hence lower basicity. Since we find the basicity of each nitrogen atom, we see that the basicity of each one is less than that seen in $$(\bf{b})$$. Therefore, $$(\bf{b}) \gt (\bf{c})$$

Hence, the order of decreasing basicity will be $$(\bf{d}) \gt (\bf{b}) \gt (\bf{c}) \gt (\bf{a})$$.