* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: #f8f5ee;
	color: #3a3833;
	font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.65;
}

h1, h2, h3 {
	color: #2c4a63;
	line-height: 1.25;
	margin: 0 0 12px 0;
}

h1 { font-size: 32px; }
h2 { font-size: 22px; margin-top: 34px; }
h3 { font-size: 17px; margin-top: 22px; }

p { margin: 0 0 14px 0; }

a { color: #2f6f9f; text-decoration: none; }
a:hover { text-decoration: underline; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
	outline: 2px solid #2f6f9f;
	outline-offset: 2px;
}

ul, ol { margin: 0 0 16px 0; padding-left: 22px; }
li { margin-bottom: 6px; }

code {
	font-family: Consolas, Monaco, monospace;
	font-size: 14px;
	background: #efe9db;
	padding: 1px 5px;
	border-radius: 3px;
}

img, canvas { max-width: 100%; }

.hidden { display: none !important; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; }

.site-head { border-bottom: 1px solid #e6dfd0; background: #fffdf8; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 58px; flex-wrap: wrap; }
.logo { font-weight: 700; font-size: 19px; color: #2c4a63; }
.logo:hover { text-decoration: none; }
.site-nav a { margin-left: 18px; color: #5b564c; font-size: 15px; }

main { padding: 28px 0 40px 0; }

.crumbs { font-size: 14px; color: #8a8576; margin-bottom: 14px; }
.crumbs a { color: #6f6a5d; }

.lead { font-size: 18px; color: #55514a; max-width: 680px; }

.tool {
	background: #fffdf8;
	border: 1px solid #e6dfd0;
	border-radius: 10px;
	padding: 20px;
	margin: 22px 0 10px 0;
}

.drop {
	border: 2px dashed #cfc6b2;
	border-radius: 8px;
	background: #fbf8f1;
	text-align: center;
	padding: 30px 16px;
}

.drop.over { border-color: #2f6f9f; background: #eef4f8; }
.drop-title { font-size: 19px; font-weight: 600; color: #2c4a63; margin: 0 0 10px 0; }
.drop-note { font-size: 14px; color: #7a7566; margin: 12px 0 0 0; }

.btn {
	display: inline-block;
	background: #2f6f9f;
	color: #fff;
	border: 0;
	border-radius: 6px;
	padding: 10px 20px;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.btn:hover { background: #265a82; text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: wait; }

button.plain {
	background: none;
	border: 0;
	color: #2f6f9f;
	font: inherit;
	cursor: pointer;
	padding: 10px 14px;
}

button.small {
	background: #fffdf8;
	border: 1px solid #d9d0bc;
	border-radius: 5px;
	color: #4a463d;
	font: inherit;
	font-size: 13px;
	padding: 4px 10px;
	cursor: pointer;
}

button.small:hover { border-color: #2f6f9f; color: #2f6f9f; }

.message {
	background: #fdf3dc;
	border: 1px solid #e8d3a0;
	color: #6b5217;
	border-radius: 6px;
	padding: 10px 14px;
	margin: 14px 0 0 0;
	font-size: 15px;
}

.message.warn { background: #fbe9e4; border-color: #e5b9ad; color: #7a2f1f; }

.status { color: #5b564c; font-size: 15px; margin: 12px 0 0 0; }

.files { margin-top: 14px; }

.file, .result {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 0;
	border-top: 1px solid #eee7d8;
}

.file img { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; border: 1px solid #e6dfd0; }

.result img { width: 84px; height: 84px; object-fit: contain; border-radius: 4px; border: 1px solid #e6dfd0; background: #f3efe4; }

.icon {
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #eee7d8;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 700;
	color: #6f6a5d;
	flex: none;
}

.icon.big { width: 84px; height: 84px; }

.fileinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fileinfo strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.fileinfo span { font-size: 13px; color: #7a7566; }
.fileinfo .note { color: #5b564c; margin-top: 2px; }

.options { margin-top: 18px; padding-top: 16px; border-top: 1px solid #eee7d8; }

.field { margin-bottom: 14px; }
.field label, .row label { display: block; font-size: 14px; font-weight: 600; color: #4a463d; margin-bottom: 4px; }
.field .hintline { font-size: 13px; color: #7a7566; margin-top: 3px; }
.checkfield label { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 15px; }

.groupfields { display: flex; gap: 14px; flex-wrap: wrap; }
.groupfields .field { flex: 1; min-width: 120px; }

input[type=number], input[type=text], select, textarea {
	width: 100%;
	max-width: 420px;
	padding: 8px 10px;
	border: 1px solid #d9d0bc;
	border-radius: 6px;
	background: #fff;
	font: inherit;
	color: #3a3833;
}

input[type=color] { width: 60px; height: 38px; padding: 2px; border: 1px solid #d9d0bc; border-radius: 6px; background: #fff; }
input[type=range] { width: 100%; max-width: 360px; }
.rangeline { display: flex; align-items: center; gap: 12px; }
.rangeval { min-width: 56px; color: #2c4a63; font-weight: 600; }

textarea { max-width: 100%; font-family: Consolas, Monaco, monospace; font-size: 13px; }

.actions { margin-top: 18px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }

.resultbar { margin-top: 14px; border-top: 1px solid #eee7d8; padding-top: 14px; }
.stage { margin-top: 16px; text-align: center; }
.stage canvas, .picker { border: 1px solid #e6dfd0; border-radius: 6px; touch-action: none; background: #f3efe4; }
.picker { cursor: crosshair; max-width: 100%; }
.hint { font-size: 14px; color: #6f6a5d; }
.stage .hint { text-align: left; }

.datatable { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 15px; }
.datatable th, .datatable td { text-align: left; padding: 7px 10px; border: 1px solid #e6dfd0; }
.datatable th { background: #f1ece0; }

.colourpanel { display: flex; gap: 16px; align-items: center; margin: 14px 0; flex-wrap: wrap; }
.swatchbig { width: 96px; height: 96px; border-radius: 8px; border: 1px solid #d9d0bc; background: #fff; }
.colourline { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip { border: 1px solid rgba(0, 0, 0, 0.15); border-radius: 6px; padding: 8px 12px; font: 13px Consolas, Monaco, monospace; cursor: pointer; }

.content { margin-top: 36px; }
.content h2:first-child { margin-top: 0; }

details { border-top: 1px solid #e6dfd0; padding: 12px 0; }
details:last-of-type { border-bottom: 1px solid #e6dfd0; }
summary { cursor: pointer; font-weight: 600; color: #2c4a63; }
details p { margin: 8px 0 0 0; color: #55514a; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin: 14px 0 26px 0; }
.card { display: block; background: #fffdf8; border: 1px solid #e6dfd0; border-radius: 8px; padding: 14px 16px; color: #3a3833; }
.card:hover { border-color: #2f6f9f; text-decoration: none; }
.card strong { display: block; color: #2c4a63; margin-bottom: 2px; }
.card span { display: block; font-size: 14px; line-height: 1.45; color: #6f6a5d; }

.hero { padding: 10px 0 6px 0; }
.hero h1 { font-size: 38px; max-width: 700px; }

.linklist { columns: 2; column-gap: 28px; padding-left: 18px; }
.linklist li { break-inside: avoid; }

.site-foot { border-top: 1px solid #e6dfd0; background: #fffdf8; padding: 26px 0; font-size: 14px; color: #6f6a5d; }
.site-foot a { color: #5b564c; margin-right: 16px; }
.site-foot p { margin: 0 0 8px 0; }

input[type=range], input[type=checkbox] { accent-color: #2f6f9f; }

@media (max-width: 640px) {
	.result { display: grid; grid-template-columns: 84px 1fr; align-items: start; }
	.result .btn { grid-column: 1 / -1; text-align: center; }
	.result .fileinfo strong { white-space: normal; overflow-wrap: anywhere; }
	h1, .hero h1 { font-size: 27px; }
	.site-nav a { margin: 0 14px 0 0; }
	.site-head .wrap { padding-bottom: 8px; }
	.linklist { columns: 1; }
	.file, .result { flex-wrap: wrap; }
	.tool { padding: 14px; }
}

@media print {
	.site-head, .site-foot, .tool { display: none; }
}
