:root {
	--bg: #0e0e10;
	--bg-soft: #141419;
	--panel: rgba(26, 26, 29, 0.92);
	--panel-strong: rgba(32, 32, 38, 0.96);
	--line: rgba(255, 255, 255, 0.08);
	--text: #e4e7ec;
	--muted: #9da4af;
	--accent: #ff4d5a;
	--accent-soft: rgba(255, 77, 90, 0.14);
	--accent-strong: rgba(255, 77, 90, 0.24);
	--success: #ff7a84;
	--success-soft: rgba(255, 122, 132, 0.14);
	--error: #ff5d73;
	--error-soft: rgba(255, 93, 115, 0.16);
	--shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	scroll-behavior: smooth;
}

body {
	min-height: 100vh;
	background:
		radial-gradient(circle at top left, rgba(255, 77, 90, 0.16), transparent 26%),
		linear-gradient(180deg, #111217 0%, var(--bg) 100%);
	color: var(--text);
	font-family: "Space Grotesk", "Segoe UI", sans-serif;
	line-height: 1.5;
}

a,
	button,
	input {
	font: inherit;
}

a {
	color: inherit;
	text-decoration: none;
}

button,
input {
	border: 0;
	outline: 0;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
	outline: 3px solid rgba(255, 77, 90, 0.55);
	outline-offset: 3px;
}

.page-shell {
	width: min(1120px, calc(100% - 32px));
	margin: 0 auto;
	padding: 34px 0 40px;
}

.hero {
	display: grid;
	grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.9fr);
	gap: 24px;
	margin-bottom: 28px;
}

.hero,
.panel,
.hero-note,
.tool-card {
	border: 1px solid var(--line);
	box-shadow: var(--shadow);
	backdrop-filter: blur(14px);
}

.hero > div,
.hero-note,
.panel,
.tool-card {
	background: var(--panel);
	border-radius: 28px;
}

.hero > div:first-child {
	padding: 34px;
}

.back-link,
.eyebrow,
.panel-kicker {
	display: inline-flex;
	align-items: center;
	width: fit-content;
	padding: 8px 14px;
	border-radius: 999px;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.back-link {
	margin-bottom: 18px;
	background: rgba(255, 255, 255, 0.04);
	color: var(--muted);
	text-transform: none;
	letter-spacing: 0;
}

.eyebrow,
.panel-kicker {
	background: var(--accent-soft);
	color: var(--accent);
}

.hero h1 {
	margin-top: 18px;
	font-size: clamp(2.2rem, 4.5vw, 4rem);
	line-height: 0.98;
	letter-spacing: -0.05em;
}

.hero p,
.hero-note p,
.field-help,
.result-label,
.result-links a,
.secondary-action {
	color: var(--muted);
}

.hero p {
	max-width: 58ch;
	margin-top: 16px;
	font-size: 1.02rem;
}

.hero-note {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 28px;
	background:
		linear-gradient(180deg, rgba(255, 77, 90, 0.1), transparent 52%),
		var(--panel-strong);
}

.hero-note strong {
	font-size: 1.5rem;
	letter-spacing: -0.03em;
}

.hero-note p {
	margin-top: 14px;
}

.content-grid {
	display: grid;
	grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
	gap: 24px;
}

.stack-layout {
	display: grid;
	gap: 24px;
}

.panel {
	padding: 28px;
}

.panel-heading {
	margin-bottom: 20px;
}

.panel-heading h2 {
	margin-top: 14px;
	font-size: clamp(1.5rem, 3vw, 2rem);
	letter-spacing: -0.04em;
}

.field-group {
	display: grid;
	gap: 10px;
	margin-bottom: 18px;
}

.field-group label {
	font-weight: 700;
}

.checkbox-row {
	display: flex;
	align-items: center;
	gap: 12px;
	font-weight: 500;
}

.checkbox-row input {
	width: 18px;
	height: 18px;
	accent-color: var(--accent);
	flex: 0 0 auto;
}

input[type="text"],
input[type="number"] {
	min-height: 54px;
	padding: 0 16px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 16px;
	background: rgba(255, 255, 255, 0.03);
	color: var(--text);
}

input[aria-invalid="true"] {
	border-color: rgba(255, 107, 129, 0.48);
	background: var(--error-soft);
}

.field-help {
	font-size: 0.94rem;
}

.form-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	padding-top: 6px;
}

button,
.secondary-action,
.result-links a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0 18px;
	border-radius: 14px;
	transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

button {
	cursor: pointer;
	background: var(--accent-soft);
	color: var(--accent);
	font-weight: 700;
	border: 1px solid rgba(255, 77, 90, 0.24);
}

button:hover,
.secondary-action:hover,
.result-links a:hover {
	transform: translateY(-2px);
	border-color: rgba(255, 77, 90, 0.38);
	background: var(--accent-strong);
}

.secondary-action,
.result-links a {
	border: 1px solid rgba(255, 255, 255, 0.08);
	background: rgba(255, 255, 255, 0.03);
}

.status-banner-wrap {
	max-width: 720px;
}

.status-banner {
	padding: 16px 18px;
	border-radius: 18px;
	border: 1px solid var(--line);
	font-weight: 500;
}

.is-neutral {
	background: rgba(255, 255, 255, 0.04);
}

.is-success {
	background: var(--success-soft);
	border-color: rgba(255, 122, 132, 0.22);
	color: #ffd2d6;
}

.is-error {
	background: var(--error-soft);
	border-color: rgba(255, 93, 115, 0.22);
	color: #ffd3da;
}

.result-panel,
.tool-card {
	display: grid;
	align-content: start;
	gap: 18px;
}

.result-list {
	display: grid;
	gap: 14px;
}

.compact-results {
	margin-top: 10px;
}

.result-item {
	padding: 16px 18px;
	border-radius: 18px;
	border: 1px solid rgba(255, 255, 255, 0.06);
	background: rgba(255, 255, 255, 0.03);
	display: grid;
	gap: 6px;
}

.result-item strong {
	font-size: 1.05rem;
	word-break: break-word;
}

.result-label {
	font-size: 0.88rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.dual-panel {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
	background: transparent;
	border: 0;
	padding: 0;
	box-shadow: none;
	backdrop-filter: none;
}

.tool-card {
	padding: 28px;
	background: var(--panel);
}

.result-table {
	list-style: none;
	display: grid;
	gap: 12px;
	margin-top: 8px;
}

.result-table li {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	padding: 16px 18px;
	border-radius: 18px;
	border: 1px solid rgba(255, 255, 255, 0.06);
	background: rgba(255, 255, 255, 0.03);
}

.result-table li span {
	word-break: break-word;
	font-weight: 700;
}

.result-links {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.modal-open {
	overflow: hidden;
}

.modal-backdrop {
	position: fixed;
	inset: 0;
	z-index: 50;
	display: grid;
	place-items: center;
	padding: 20px;
	background: rgba(8, 4, 5, 0.78);
	backdrop-filter: blur(8px);
}

.modal-backdrop[hidden] {
	display: none;
}

.modal-dialog {
	width: min(980px, 100%);
	max-height: min(88vh, 860px);
	display: grid;
	grid-template-rows: auto auto auto minmax(0, 1fr);
	gap: 16px;
	padding: 24px;
	border-radius: 24px;
	border: 1px solid var(--line);
	background: var(--panel-strong);
	box-shadow: var(--shadow);
}

.modal-header,
.modal-top-link {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
}

.modal-close {
	min-height: 44px;
	padding: 0 16px;
	border-radius: 14px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	background: rgba(255, 255, 255, 0.04);
	color: var(--text);
	cursor: pointer;
}

.modal-status {
	padding: 12px 14px;
	border-radius: 14px;
	border: 1px solid var(--line);
	font-size: 0.95rem;
}

.modal-table-wrap {
	overflow: auto;
	border-radius: 18px;
	border: 1px solid rgba(255, 255, 255, 0.06);
	background: rgba(255, 255, 255, 0.02);
}

.json-table {
	width: 100%;
	border-collapse: collapse;
	min-width: 560px;
}

.json-table th,
.json-table td {
	padding: 14px 16px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
	text-align: left;
	vertical-align: top;
	word-break: break-word;
}

.json-table thead th {
	position: sticky;
	top: 0;
	background: rgba(28, 12, 14, 0.96);
	color: var(--accent);
	font-size: 0.86rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	z-index: 1;
}

.json-table tbody th {
	width: 34%;
	color: var(--text);
	font-weight: 700;
	background: rgba(255, 255, 255, 0.02);
}

.json-table tbody td {
	color: var(--muted);
}

@media (max-width: 920px) {
	.hero,
	.content-grid,
	.dual-panel {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 640px) {
	.page-shell {
		width: min(100% - 20px, 1120px);
		padding-top: 20px;
	}

	.hero > div:first-child,
	.hero-note,
	.panel,
	.tool-card {
		padding: 22px;
		border-radius: 22px;
	}

	.result-table li {
		align-items: start;
		flex-direction: column;
	}

	.form-actions {
		flex-direction: column;
	}

	button,
	.secondary-action,
	.result-links a {
		width: 100%;
	}

	.result-links {
		width: 100%;
	}

	.modal-dialog {
		padding: 18px;
		border-radius: 20px;
	}

	.modal-header,
	.modal-top-link {
		align-items: stretch;
		flex-direction: column;
	}

	.modal-close,
	.modal-json-link {
		width: 100%;
	}
}