* {
	box-sizing: border-box;
}

body {
	margin: 0;
	height: 100vh;
	display: grid;
	grid-template-columns: 340px 1fr;
	background: #191c21;
	color: #d7dbe2;
	font: 13px/1.4 "Segoe UI", system-ui, sans-serif;
	overflow: hidden;
}

button {
	font: inherit;
	color: #d7dbe2;
	background: #2b303a;
	border: 1px solid #3a4150;
	border-radius: 3px;
	padding: 4px 9px;
	cursor: pointer;
}

button:hover:not(:disabled) {
	background: #363d49;
}

button:disabled {
	opacity: 0.4;
	cursor: default;
}

button.on {
	background: #2f6fb0;
	border-color: #3f8ad6;
}

/* --- панель дерева --- */

#panel {
	display: flex;
	flex-direction: column;
	min-height: 0;
	background: #21252c;
	border-right: 1px solid #10131a;
}

.panel-head {
	padding: 8px;
	display: grid;
	gap: 6px;
	border-bottom: 1px solid #10131a;
}

.panel-head select,
.panel-head input {
	font: inherit;
	width: 100%;
	padding: 4px 6px;
	color: #d7dbe2;
	background: #2b303a;
	border: 1px solid #3a4150;
	border-radius: 3px;
}

#stats {
	color: #7b8494;
	font-size: 11px;
}

#tree {
	flex: 1;
	min-height: 0;
	overflow: auto;
	padding: 4px 0;
	user-select: none;
}

.row {
	display: flex;
	align-items: center;
	gap: 6px;
	height: 22px;
	padding-right: 8px;
	cursor: default;
	white-space: nowrap;
}

.row.filtered,
.row.collapsed-away {
	display: none;
}

.caret {
	flex: none;
	width: 14px;
	height: 16px;
	padding: 0;
	line-height: 1;
	font-size: 9px;
	color: #8b96a8;
	background: none;
	border: none;
}

.caret:hover {
	color: #f0f3f8;
}

.row.hover {
	background: #3a3020;
	box-shadow: inset 2px 0 0 #ff9d3d;
}

.row.selected {
	background: #1e3c58;
	box-shadow: inset 2px 0 0 #3fa9ff;
}

.row.hidden .name,
.row.hidden .icon {
	opacity: 0.35;
	text-decoration: line-through;
}

.row.asm .name {
	color: #f0f3f8;
	font-weight: 600;
}

.row .icon {
	color: #6f7b8d;
	font-size: 11px;
}

.row .name {
	overflow: hidden;
	text-overflow: ellipsis;
}

.eye {
	flex: none;
	width: 16px;
	height: 16px;
	padding: 0;
	line-height: 1;
	font-size: 9px;
	color: #8b96a8;
	background: none;
	border: none;
}

.row.hidden .eye {
	color: #4a5261;
}

.eye:hover {
	color: #ff9d3d;
}

.panel-foot {
	display: flex;
	gap: 6px;
	padding: 8px;
	border-top: 1px solid #10131a;
}

.panel-foot button {
	flex: 1;
}

/* --- вьюпорт --- */

#viewport {
	position: relative;
	min-width: 0;
}

#viewport canvas {
	display: block;
}

#toolbar {
	position: absolute;
	top: 10px;
	left: 10px;
	right: 10px;
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
	z-index: 10;
	pointer-events: none;
}

#toolbar .group {
	display: flex;
	gap: 4px;
	align-items: center;
	pointer-events: auto;
	background: rgba(33, 37, 44, 0.9);
	border: 1px solid #10131a;
	border-radius: 4px;
	padding: 4px;
}

.check {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 0 6px;
	white-space: nowrap;
}

#crumbs {
	position: absolute;
	left: 10px;
	bottom: 10px;
	z-index: 10;
	max-width: calc(100% - 20px);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: #93a0b4;
	font-size: 12px;
	pointer-events: none;
}

#hint {
	position: absolute;
	right: 10px;
	bottom: 10px;
	z-index: 10;
	color: #5d6675;
	font-size: 11px;
	pointer-events: none;
}

#loading {
	position: absolute;
	inset: 0;
	z-index: 20;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	background: rgba(25, 28, 33, 0.94);
	text-align: center;
	padding: 20px;
}

.spinner {
	width: 34px;
	height: 34px;
	border: 3px solid #333a46;
	border-top-color: #3fa9ff;
	border-radius: 50%;
	animation: spin 0.9s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.error {
	color: #ff7b6b;
}
