* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	height: 100%;
	font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
	color: #2b2b2b;
	background: #e9e7e2;
}

#app {
	display: flex;
	height: 100%;
}

/* ---------- sidebar ---------- */

#sidebar {
	width: 380px;
	flex: none;
	background: #faf9f6;
	border-right: 1px solid #d8d4cc;
	padding: 20px 18px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

#sidebar h1 {
	font-size: 18px;
	margin: 0;
}

#sidebar h2 {
	font-size: 13px;
	margin: 0 0 8px;
	color: #6d675c;
}

.description {
	font-size: 12px;
	color: #6d675c;
	margin: 0;
	line-height: 1.6;
}

.file-btn {
	display: block;
	text-align: center;
	background: #4a6b8a;
	color: #fff;
	padding: 10px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
}

.file-btn:hover {
	background: #3d5a75;
}

.file-btn input {
	display: none;
}

.hint {
	font-size: 11px;
	color: #8a8478;
	margin: -6px 0 0;
	text-align: center;
}

/* ---------- sliders ---------- */

.controls {
	border-top: 1px solid #e3dfd7;
	padding-top: 12px;
}

.slider-row {
	margin-bottom: 12px;
}

.slider-row label {
	display: block;
	font-size: 13px;
	margin-bottom: 4px;
}

.slider-row .unit {
	font-size: 10px;
	color: #8a8478;
}

.slider-line {
	display: flex;
	align-items: center;
	gap: 8px;
}

.slider-line input[type="range"] {
	flex: 1;
	accent-color: #4a6b8a;
}

.slider-line output {
	width: 42px;
	text-align: right;
	font-size: 12px;
	font-variant-numeric: tabular-nums;
	color: #4c4842;
}

/* ---------- buttons ---------- */

.presets,
.actions {
	border-top: 1px solid #e3dfd7;
	padding-top: 12px;
}

.preset-buttons {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
}

button {
	font: inherit;
	font-size: 13px;
	padding: 8px 10px;
	border: 1px solid #c9c4ba;
	border-radius: 6px;
	background: #fff;
	color: #2b2b2b;
	cursor: pointer;
}

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

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

button.primary {
	background: #4a6b8a;
	border-color: #4a6b8a;
	color: #fff;
}

button.primary:hover:not(:disabled) {
	background: #3d5a75;
}

.actions {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

#status {
	font-size: 12px;
	color: #6d675c;
	margin: auto 0 0;
	padding-top: 10px;
	min-height: 1.5em;
}

/* ---------- footer ---------- */

#footer {
	border-top: 1px solid #e3dfd7;
	padding-top: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-size: 11px;
}

#footer a {
	display: flex;
	align-items: center;
	gap: 6px;
	color: #6d675c;
	text-decoration: none;
	line-height: 1.4;
}

#footer a:hover {
	color: #4a6b8a;
	text-decoration: underline;
}

#footer .icon {
	flex: none;
	width: 16px;
	text-align: center;
}

/* ---------- main / preview ---------- */

#main {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

#previewWrap {
	flex: 1;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	padding: 24px;
	/* checkerboard to show transparency */
	background:
		repeating-conic-gradient(#dedbd5 0% 25%, #e9e7e2 0% 50%) 0 0 / 24px 24px;
}

#previewWrap.dragover {
	outline: 3px dashed #4a6b8a;
	outline-offset: -12px;
}

#preview {
	max-width: 100%;
	max-height: 100%;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
	background: #fff;
}

#dropHint {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	font-size: 20px;
	color: #9b958a;
	pointer-events: none;
	text-align: center;
}

#dropHint span {
	font-size: 13px;
}

#dropHint.hidden {
	display: none;
}

/* ---------- thumbnails ---------- */

#thumbs {
	flex: none;
	display: flex;
	gap: 8px;
	padding: 10px 14px;
	background: #f3f1ec;
	border-top: 1px solid #d8d4cc;
	overflow-x: auto;
	min-height: 0;
}

#thumbs:empty {
	display: none;
}

.thumb {
	position: relative;
	flex: none;
	width: 72px;
	height: 72px;
	border: 2px solid transparent;
	border-radius: 6px;
	overflow: hidden;
	cursor: pointer;
	background: #fff;
}

.thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.thumb.active {
	border-color: #4a6b8a;
}

.thumb .remove {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 18px;
	height: 18px;
	padding: 0;
	line-height: 16px;
	font-size: 11px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	border: none;
}

.thumb .remove:hover {
	background: rgba(0, 0, 0, 0.8);
}
