:root {
	--tree-bg: #ffffff;
	--tree-muted: #6b7280;
	--tree-line: #d7dce2;
	--tree-link: #14558f;
	--tree-link-hover: #0b3f6c;
	--tree-button-bg: #eef2f5;
	--tree-button-hover: #dde6ee;
	--tree-button-text: #2d3748;
	--tree-focus: #d7822b;
	--tree-panel-size: 280px;
}

#item-tree {
	display: grid;
	grid-template-columns: minmax(var(--tree-panel-size), 20%) 2px minmax(0, 1fr);
	align-items: start;
	height: calc(100vh - 90px); /*190px*/
	min-height: 540px;
	padding-bottom: 0;
}

#item-tree > section {
	min-height: 0;
	height: 100%;
	padding: 0;
	/*background: var(--tree-bg);*/
}

#item-tree > section:first-child {
	overflow: auto;
	padding-right: 4px;
}

#item-tree > section:last-child {
	border: 1px solid var(--tree-line);
}

#pane-resizer {
	cursor: col-resize;
	background: transparent;
	height: 100%;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
}
#pane-resizer:hover {
	background: var(--tree-line);
}

#detail-frame {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 0;
	border: 0;
	background: #ffffff;
}

#tree-status {
	margin: 0 0 10px;
	color: var(--tree-muted);
	font-size: 0.95rem;
}

#tree-status:empty {
	display: none;
}

#q-tree,
#q-tree ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

#q-tree ul {
	margin-left: 14px;
	margin-bottom: 8px;
	padding-left: 6px;
	border-left: 1px solid var(--tree-line);
}

#q-tree li {
	margin: 3px 0;
	list-style: none;
}

#q-tree li li li li {
	font-size: 0.95rem;
}

#q-tree ul > li {
	margin-top: 4px;
}

#q-tree > li[data-name] > div {
	background: var(--bg-l1);
	max-height: 30px;
	margin-bottom: 6px;
}

#q-tree li > div {
	align-items: start;
	max-height: 22px;
	min-width: 0;
	padding-left: 10px;
}
#q-tree li > div.hasimg {
	background: rgb(200 200 200 / 0.4);
	cursor: default;
}
#q-tree li > div:has(button) {
	display: grid;
	grid-template-columns: 24px minmax(0, 1fr);
	padding-left: 0;
}

#q-tree button {
	display: inline-grid;
	place-items: center;
	width: 24px;
	height: 24px;
	margin-top: 3px;
	border: 1px solid transparent;
	border-radius: 4px;
	background: var(--tree-button-bg);
	color: var(--tree-button-text);
	cursor: pointer;
	font: inherit;
	line-height: 1;
}

#q-tree button:hover {
	background: var(--tree-button-hover);
}

#q-tree button:focus-visible,
#q-tree a:focus-visible {
	outline: 2px solid var(--tree-focus);
	outline-offset: 2px;
}

#q-tree button[disabled] {
	cursor: wait;
	opacity: 0.7;
}

#q-tree a,
#q-tree span {
	display: inline-block;
	min-width: 0;
	width: 100%;
	padding: 2px 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#q-tree a {
	color: var(--tree-link);
	text-decoration: none;
}

#q-tree a:hover {
	color: var(--tree-link-hover);
	text-decoration: underline;
}

#q-tree [data-message] {
	margin: 3px 0 8px 30px;
	color: var(--tree-muted);
	font-size: 0.92rem;
}

#q-tree [data-error] {
	color: #9d2f2f;
}

.pseudo {
	color: #636363;
}

@media (max-width: 640px) {
	:root {
		--tree-panel-size: calc(50vh - 100px);
	}
	#item-tree {
		grid-template-columns: 1fr;
		height: auto;
		min-height: 0;
	}

	#item-tree > section:first-child {
		padding: 12px;
		height: var(--tree-panel-size);
		overflow-y: scroll;
		margin: 0;
		box-sizing: border-box;
	}
	#pane-resizer {
		cursor: row-resize;
		width: 100%;
		height: 6px;
		margin: 0;
		box-sizing: border-box;
	}

	#q-tree ul {
		margin-left: 24px;
		padding-left: 12px;
	}

	#detail-frame {
		height: 60vh;
		min-height: 360px;
	}
}
