* {
	box-sizing: border-box;
}

:root {
	color-scheme: light dark;
}

body {
	margin: 0;
	padding: 32px 16px;
	font-family: system-ui, sans-serif;
	background: #f5f5f5;
	color: #222;
}

main {
	width: min(1100px, 100%);
	margin-inline: auto;
}

header {
	margin-bottom: 24px;
}

header p,
.description {
	color: #666;
}

fieldset {
	margin: 0 0 20px;
	padding: 16px;
	border: 1px solid #ccc;
	border-radius: 8px;
	background: #fff;
}

legend {
	padding-inline: 6px;
	font-weight: 600;
}

label {
	display: inline-block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 500;
}

textarea,
input[type="text"] {
	width: 100%;
	border: 1px solid #bbb;
	border-radius: 6px;
	background: #fff;
	color: #111;
	outline: none;
}

textarea {
	display: block;
	min-height: 280px;
	padding: 12px;
	resize: vertical;
	font: 14px / 1.5 monospace;
}

#output {
	min-height: 380px;
}

textarea:focus,
input[type="text"]:focus {
	border-color: #555;
}

.description {
	margin: 8px 0 0;
	font-size: 13px;
}

.parameters {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 12px;
}

.parameter input {
	padding: 9px 10px;
	font: 14px monospace;
}

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

.option + .option {
	margin-top: 8px;
}

.option label {
	margin: 0;
}

.option input {
	margin: 0;
}

.actions {
	display: flex;
	gap: 8px;
	margin: 20px 0;
}

button {
	padding: 10px 16px;
	border: 0;
	border-radius: 6px;
	cursor: pointer;
	font: inherit;
}

#pack {
	background: #111;
	color: #fff;
}

#copy,
#reset {
	background: #ddd;
	color: #111;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.output-section {
	margin-top: 24px;
}

@media (max-width: 700px) {
	body {
		padding: 20px 12px;
	}

	.parameters {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 400px) {
	.parameters {
		grid-template-columns: 1fr;
	}
}

@media (prefers-color-scheme: dark) {
	body {
		background: #111;
		color: #eee;
	}

	fieldset {
		border-color: #444;
		background: #1b1b1b;
	}

	textarea,
	input[type="text"] {
		border-color: #555;
		background: #151515;
		color: #eee;
	}

	header p,
	.description {
		color: #aaa;
	}

	#pack {
		background: #eee;
		color: #111;
	}

	#copy,
	#reset {
		background: #333;
		color: #eee;
	}
}
