\usetikzlibrary{arrows.meta}
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{patterns}

% We put nodes in a separate layer, so we can
% slightly overlap with paths for a perfect fit
\pgfdeclarelayer{nodes}
\pgfdeclarelayer{path}
\pgfsetlayers{main,nodes}

% Layer settings
\tikzset{
	% Layer hack, lets us write
	% later = * in scopes.
	layer/.style = {
		execute at begin scope={\pgfonlayer{#1}},
		execute at end scope={\endpgfonlayer}
	},
	%
	% Arrowhead tweak
	>={Latex[ width=2mm, length=2mm ]},
	%
	% Labels inside edges
	label/.style = {
		rectangle,
		% For automatic red background in solutions
		fill = \ORMCbgcolor,
		draw = none,
		rounded corners = 0mm
	},
	%
	% Nodes
	edg/.style = {
		midway,
		fill = \ORMCbgcolor,
		text = gray
	},
	int/.style = {},
	end/.style = {
		anchor=north
	},
	%
	% Loop tweaks
	loop above/.style = {
		min distance = 2mm,
		looseness = 8,
		out = 45,
		in = 135
	},
	loop below/.style = {
		min distance = 5mm,
		looseness = 10,
		out = 315,
		in = 225
	},
	loop right/.style = {
		min distance = 5mm,
		looseness = 10,
		out = 45,
		in = 315
	},
	loop left/.style = {
		min distance = 5mm,
		looseness = 10,
		out = 135,
		in = 215
	}
}