[view="relations-cluster"] {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: stretch;
	gap: 20px;
}

[view="relations-cluster"] header {
	margin-bottom: 0 !important;
}

[view="relations-cluster"] form {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: stretch;
	gap: 20px;
}

[view="relations-cluster"] form h2 {
	display: block;
	width: 100%;
}

#query-nodes,
#query-links {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	justify-content: flex-start;
	align-items: flex-start;
	gap: 10px;
}

:is(#query-nodes, #query-links) label {
	--base: gray;
	--dark: darkgray;
	--light: lightgray;
	cursor: pointer;
}

:is(#query-nodes, #query-links) label input[type="checkbox"] {
	all: unset;
	position: absolute;
	width: 0;
	height: 0;
}

:is(#query-nodes, #query-links) label input + span {
	display: inline-block;
	padding: .5em 1em;

	border-width: 3px;
	border-style: solid;
	border-radius: 5px;

	font-weight: 700;

	border-color: var(--shiro-color-gray7);
	background-color: var(--shiro-color-gray2);
	color: var(--shiro-color-gray9);

	transition: all .15s ease-out;
}

#query-nodes label:hover input + span {
	border-color: var(--light);
	background-color: var(--light);
	color: var(--dark);
}
#query-nodes label input:checked + span {
	border-color: var(--base);
	background-color: var(--base);
	color: var(--shiro-color-gray2);
}
#query-nodes label:hover input:checked + span {
	border-color: var(--dark);
	background-color: var(--dark);
	color: var(--light);
}

#query-links label:hover input + span {
	border-color: var(--shiro-color-gray5);
	background-color: var(--shiro-color-gray5);
	color: var(--shiro-color-gray10);
}
#query-links label input:checked + span {
	border-color: var(--shiro-color-gray8);
	background-color: var(--shiro-color-gray8);
	color: var(--shiro-color-gray2);
}
#query-links label:hover input:checked + span {
	border-color: var(--shiro-color-gray10);
	background-color: var(--shiro-color-gray10);
	color: var(--shiro-color-gray5);
}

#query-limit input {
	margin-left: 10px;
}

#graph {
	position: relative;
	width: 100%;
	height: 700px;
	border-radius: 5px;
	outline-width: 1px;
	outline-style: solid; 
	outline-color: #ddd; 
	overflow: hidden;
}

#graph canvas {
	position: relative;
	width: 100%;
	height: 100%;
}
#graph.loading canvas {
	opacity: .5;
	pointer-events: none;
}
#graph.mouseover canvas {
	cursor: pointer;
}

#graph .icon-loading {
	--loading-icon-size: 20px;
	position: absolute;
	top: 50%;
	left: 50%;
	width: var(--loading-icon-size);
	height: var(--loading-icon-size);
	transform: translate(-50%, -50%);
	opacity: 0;
	transition: opacity .15s ease-out;
}
#graph.loading .icon-loading {
	opacity: 1;
}

#graph .tooltip {
	position: absolute;
	top: calc( var(--my, 0) * 1px);
	left: calc( var(--mx, 0) * 1px);
	pointer-events: none;

	max-width: min(100%, 400px);
	
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: flex-start;
	padding: .5em;
	border-radius: 5px;
	margin-left: 1em;

	white-space: nowrap;

	background-color: black;
	color: white;
	
	z-index: 20;

	opacity: 0;
	transition: opacity .15s ease-out;
}
#graph.mouseover .tooltip {
	opacity: 1;
}
#graph .tooltip .node-label {
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
}
#graph .tooltip .node-property {
	white-space: nowrap;
}
#graph .tooltip .node-property .property-label {
	font-size: .8em;
	color: gray;
	text-transform: uppercase;
}
#graph .tooltip .node-property .property-label:after {
	content: ':';
}

#graph-sidebar {
	--width: min(50%, 400px);

	position: absolute;
	top: 0;
	bottom: 0;
	
	width: var(--width);
	right: calc( -1 * var(--width) );
	
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: flex-start;
	gap: 2em;
	padding: 1em;

	background-color: rgba(0, 0, 0, 0.75);
	backdrop-filter: blur(5px);
	color: white;
	
	z-index: 10;

	transition: all .15s ease-out;
}
#graph.sidebar-visible #graph-sidebar,
#graph-sidebar.loading {
	right: 0;
}

#graph-sidebar.loading {
	background-color: rgba(0, 0, 0, 0.50);
}

#graph-sidebar > * {
	opacity: 1;
	transition: opacity .15s ease-out;
}
#graph-sidebar.loading > * {
	opacity: 0;
}

#graph-sidebar > :is(header, main, footer) {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: stretch;
	gap: 1em;
	width: 100%;
	padding: 0;
}

#graph-sidebar > main {
	--offset: 5px;
	flex-grow: 1;
	margin: 0 calc(-1 * var(--offset));
	overflow-x: hidden;
	overflow-y: auto;
}

#graph-sidebar [shiro-property] {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: flex-start;
	gap: .5em;

	max-width: 100%;
}
#graph-sidebar [shiro-property] > * {
	padding: var(--offset);
}
#graph-sidebar .property-label {
	position: sticky;
	top: 0;
	width: 100%;
	background-color: var(--shiro-color-gray11);
	font-size: 1em;
	font-weight: 700;
}
#graph-sidebar .property-values {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: flex-start;
	gap: .5em;
}

#graph-sidebar .property-values a {
	color: inherit;
	text-decoration: underline;
	transition: all .15s ease-out;
}
#graph-sidebar .property-values a:hover {
	color: var(--shiro-color-theme);
	text-decoration-color: transparent;
}

#graph-sidebar header [shiro-property] .property-label {
	display: none;
}

#graph-sidebar [shiro-property="_name"] {
	font-size: 2em;
	font-weight: bold;
}
#graph-sidebar [shiro-property="_id"] {
	font-size: 1.6em;
	font-weight: lighter;
}

#graph-sidebar a.see-item {
	display: grid;
	place-items: center;
	width: 100%;
	padding: 1em;
	border-radius: 5px;

	font-size: 1.5em;
	text-decoration: none;

	background-color: var(--shiro-color-theme);
	color: var(--shiro-color-gray1);
	
	transition: all .15s ease-out;
}
#graph-sidebar a.see-item:hover {
	background-color: var(--shiro-color-gray1);
	color: var(--shiro-color-theme);
}

#graph .controls {
	position: absolute;
	left: 10px;
	bottom: 10px;
	display: inline-flex;
	justify-content: flex-end;
	align-items: stretch;
	height: 40px;
	gap: 10px;
	z-index: 1;
}

#graph .controls > * {
	display: grid;
	place-items: center;
	width: auto;
	height: 100%;
	aspect-ratio: 1;
	border-radius: 5px;
	cursor: pointer;
}
#graph .controls > button {
	border: none;
	color: #2da4a8;
	background-color: transparent;
	transition: background-color .15s ease,
							color .15s ease;
}

#graph .controls > button:hover {
	color: white;
	background-color: #2da4a8;
}

#graph .message-list {
	position: absolute;
	top: 10px;
	left: 10px;

	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: flex-start;
	gap: 10px;
}

#graph .message-list > .message-item {
	padding: 10px 20px;
	border-radius: 5px;
	background-color: lightcoral;
	color: var(--shiro-color-gray1);
}

#graph .message-list > .message-item:not(.enabled) {
	display: none;
}

/* TEMP */

#cluster-options {
	display: none;
}