:root {
	color-scheme: light;
	--bg: #f7f8fb;
	--panel: #ffffff;
	--text: #17202a;
	--muted: #5f6b7a;
	--line: #dfe5ec;
	--accent: #0f766e;
	--accent-dark: #0b5d57;
	--focus: #f59e0b;
	--danger: #b42318;
	--shadow: 0 18px 45px rgba(30, 42, 59, 0.10);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: Arial, Helvetica, sans-serif;
	font-size: 16px;
	line-height: 1.5;
}

a {
	color: var(--accent-dark);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
	outline: 3px solid var(--focus);
	outline-offset: 3px;
}

.container,
.tool-page {
	width: min(920px, calc(100% - 32px));
	margin: 0 auto;
	padding: 36px 0 52px;
}

.tool-shell,
.form,
.out,
.panel {
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--panel);
	box-shadow: var(--shadow);
}

.tool-shell {
	padding: 28px;
}

.form,
.out,
.panel {
	padding: 20px;
}

.form + .comment,
.form + .panel,
.panel + .panel,
.comment + .comment {
	margin-top: 16px;
}

h1 {
	margin: 0 0 10px;
	font-size: clamp(1.8rem, 4vw, 3rem);
	line-height: 1.08;
	letter-spacing: 0;
}

h2,
h3,
h4,
h5 {
	margin: 22px 0 10px;
	line-height: 1.2;
	letter-spacing: 0;
}

p {
	margin: 0 0 14px;
}

.lede,
.hint,
.muted,
.text-info,
.form-text {
	color: var(--muted);
}

.hint,
.lede {
	max-width: 720px;
	font-size: 1.05rem;
}

.back-link {
	display: inline-flex;
	margin-bottom: 18px;
	color: var(--accent-dark);
	font-weight: 700;
	text-decoration: none;
}

.back-link:hover {
	text-decoration: underline;
}

.form-group {
	margin-bottom: 16px;
}

label {
	display: inline-flex;
	gap: 8px;
	align-items: center;
	margin: 0 16px 10px 0;
	color: var(--text);
	font-weight: 700;
}

input,
textarea,
output,
.form-control,
.form-input {
	width: 100%;
	min-height: 44px;
	padding: 10px 12px;
	border: 1px solid #cfd8e3;
	border-radius: 6px;
	background: #ffffff;
	color: var(--text);
	font: inherit;
}

textarea {
	min-height: 150px;
	resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
	width: auto;
	min-height: auto;
	margin: 0;
	accent-color: var(--accent);
}

input[type="number"] {
	max-width: 9rem;
}

input[readonly],
textarea[readonly],
.disabled {
	background: #f3f6f9;
	color: #435062;
}

button,
.button,
input[type="button"],
input[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 16px;
	border: 1px solid var(--accent);
	border-radius: 6px;
	background: var(--accent);
	color: #ffffff;
	font: inherit;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}

button.secondary,
.button.secondary {
	border-color: var(--line);
	background: #ffffff;
	color: var(--text);
}

button:hover,
.button:hover,
input[type="button"]:hover,
input[type="submit"]:hover {
	background: var(--accent-dark);
	border-color: var(--accent-dark);
}

.buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 14px 0 18px;
}

.comment,
.note {
	padding: 14px 16px;
	border: 1px solid #cce4df;
	border-radius: 8px;
	background: #eef8f6;
	color: #27524d;
}

pre,
code {
	font-family: Consolas, Monaco, "Courier New", monospace;
}

pre {
	overflow: auto;
	white-space: pre-wrap;
}

.result,
#result {
	min-height: 64px;
}

.item {
	padding: 12px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: #ffffff;
}

.row {
	display: flex;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
}

.url {
	overflow-wrap: anywhere;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (max-width: 640px) {
	.container,
	.tool-page {
		width: min(100% - 22px, 920px);
		padding-top: 18px;
	}

	.tool-shell,
	.form,
	.out,
	.panel {
		padding: 18px;
	}

	.row,
	.buttons {
		align-items: stretch;
		flex-direction: column;
	}

	button,
	.button,
	input[type="button"],
	input[type="submit"] {
		width: 100%;
	}

	label {
		display: flex;
		margin-right: 0;
	}
}
