Nonzero Gram determinant and bases away from finitely many primes
Fix the CM lattice datum described below, of $\mathcal O_E$-rank $p+q$, with underlying module $\Lambda$ and alternating pairing $B$. Choose a finite set $I$ of cardinality $p+q$ and an $\mathcal O_E$-linearly independent family $(e_i)_{i\in I}$ in $\Lambda$. Let $(b_k)$ be the integral basis of $E$ used in the datum and $(b_k^\vee)$ its trace-dual basis over $\mathbb Q$, and set $$s(x,y)=\sum_kB(b_kx,y)b_k^\vee,\qquad G=(s(e_i,e_j))_{i,j\in I}.$$ Then $\det G\ne0$. Moreover, for all but finitely many rational primes $\ell$, there is an integer $n\ge0$, not divisible by $\ell$, such that $$n\Lambda\subseteq\sum_{i\in I}\mathcal O_Ee_i.$$
The CM lattice datum consists of a CM field $E$, unramified over its maximal real subfield at all finite places; a prime $d\equiv7\pmod{16}$; $\xi,w\in\mathcal O_E$ with $\xi^2=-d$ and $2w=1+\xi$; the integral conjugation induced by complex conjugation; and a chosen $\xi_0\in\mathbb C$ with $\xi_0^2=-d$. The module $\Lambda$ is finite projective over $\mathcal O_E$. Its $\mathbb Z$-bilinear pairing $B$ is alternating, unimodular, and satisfies $B(ax,y)=B(x,\bar a y)$. Put $\Psi=\{\tau:E\hookrightarrow\mathbb C:\tau(\xi)=\xi_0\}$.
The datum also assumes a real-linear $J$ on $\Lambda_{\mathbb R}$ with $J^2=-1$, preserving $B$, and $B(Jx,x)>0$ for $x\ne0$. If $A_a$ is multiplication by $a\in\mathcal O_E$ on $\Lambda_{\mathbb R}$ and $t_a=\sum_{\tau\in\Psi}(p\tau(a)+q\overline{\tau(a)})$, then $JA_a=A_aJ$, $\operatorname{tr}_{\mathbb R}A_a=2\Re t_a$, and $\operatorname{tr}_{\mathbb R}(JA_a)=-2\Im t_a$.