Meine Herangehensweise mag mehr Aufwand bedeuten, dafür geht sie den möglichen Konflikten zwischen den Paketen aus dem Weg.
\documentclass[tikz, border=1pt]{standalone}
\usetikzlibrary{matrix, positioning, calc, fit, backgrounds}
\begin{document}
\begin{tikzpicture}[
terminal/.style={
inner sep=1pt,
rounded corners=3mm,
draw=black!50,
top color=white,
bottom color=black!20
},
gray matrix/.style={
matrix of nodes,
nodes={
% draw,
inner sep=0pt
},
font=\ttfamily,
column sep=3mm
},
circled/.style={
circle,
draw=red,
thick
}
]
\matrix[
gray matrix
] (ml) {
a\textsubscript{1}, & b\textsubscript{2} & $\vert$ &
e\textsubscript{3}, & r\textsubscript{1}\\
};
\matrix[
gray matrix,
right=4mm of ml
] (mr) {
a\textsubscript{1}, & b\textsubscript{2} & $\vert$ &
e\textsubscript{3}, & r\textsubscript{1}\\
};
\scoped [on background layer, nodes=terminal]
\path
node [fit=(ml)] {}
node [fit=(mr)] {}
;
\begin{scope}[thick, transform canvas={yshift=-2pt}]
\draw [green]
(ml-1-1.south west) -- (ml-1-2.south east)
(mr-1-1.south west) -- (mr-1-2.south east)
;
\draw [blue]
(ml-1-4.south west) -- (ml-1-5.south east)
(mr-1-4.south west) -- (mr-1-5.south east)
;
\end{scope}
\node [fit=(ml-1-1) (ml-1-2), circled, inner sep=1pt] {};
\draw [circled] (mr-1-1) circle [radius=12pt];
\end{tikzpicture}
\end{document}