#reference-image-panel {
	position: fixed;
	top: 64px;
	right: 12px;
	z-index: 50;
	display: grid;
	gap: 12px;
	width: min(310px, calc(100vw - 24px));
	padding: 14px;
	color: #f0f0f0;
	background: rgba(18, 18, 18, 0.97);
	border: 1px solid #4a4a4a;
	border-radius: 8px;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
	font: 13px/1.4 "Segoe UI", sans-serif;
}

#reference-image-panel[hidden] {
	display: none;
}

.reference-image-panel-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 15px;
}

#reference-image-panel button {
	color: #f0f0f0;
	background: #232323;
	border: 1px solid #4a4a4a;
	border-radius: 4px;
	cursor: pointer;
}

#reference-image-panel .reference-image-close {
	width: 28px;
	height: 28px;
	font-size: 20px;
	line-height: 1;
}

.reference-image-file-label,
.reference-image-scale,
.reference-image-position-fields label {
	display: grid;
	gap: 5px;
}

#reference-image-panel input[type="file"],
#reference-image-panel input[type="number"] {
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
	padding: 6px;
	color: #f0f0f0;
	background: #242424;
	border: 1px solid #555;
	border-radius: 4px;
}

.reference-image-visibility {
	display: flex;
	align-items: center;
	gap: 8px;
}

.reference-image-position-fields {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
}

#reference-image-panel p {
	margin: 0;
	color: #bcbcbc;
	font-size: 11px;
}

@media (max-width: 768px) {
	#reference-image-panel {
		top: 12px;
		right: 8px;
	}
}
