:root {
	--ink: #17243f;
	--ink-soft: #4d5d78;
	--paper: #f6f8fc;
	--surface: #ffffff;
	--surface-soft: #edf2fa;
	--line: #cbd5e5;
	--primary: #3159d8;
	--primary-dark: #2342a4;
	--success: #087a55;
	--success-soft: #e5f7ef;
	--warning: #9a5b00;
	--warning-soft: #fff4d6;
	--danger: #b42335;
	--danger-dark: #861a28;
	--danger-soft: #ffeaed;
	--shadow: 0 12px 32px rgb(23 36 63 / 9%);
	--radius: 14px;
	--focus: 0 0 0 3px rgb(49 89 216 / 28%);
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--ink);
	background: var(--paper);
}

* {
	box-sizing: border-box;
}

[hidden] {
	display: none !important;
}

html {
	min-height: 100%;
	scroll-behavior: smooth;
}

body {
	min-width: 320px;
	min-height: 100vh;
	margin: 0;
	background:
		radial-gradient(circle at 85% 0%, rgb(49 89 216 / 9%), transparent 28rem),
		var(--paper);
}

button,
input,
textarea {
	font: inherit;
}

button {
	color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
	outline: none;
	box-shadow: var(--focus);
}

button:disabled {
	cursor: not-allowed;
	opacity: .52;
}

h1,
h2,
h3,
p {
	margin-top: 0;
}

h1 {
	margin-bottom: 0;
	font-size: clamp(2rem, 4vw, 3rem);
	letter-spacing: -.045em;
}

h2 {
	margin-bottom: .45rem;
	font-size: clamp(1.65rem, 3vw, 2.2rem);
	letter-spacing: -.025em;
}

h3 {
	margin-bottom: .45rem;
	font-size: 1.05rem;
}

p {
	line-height: 1.6;
}

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

.skip-link {
	position: fixed;
	top: .75rem;
	left: .75rem;
	z-index: 100;
	padding: .7rem 1rem;
	border-radius: 8px;
	color: #fff;
	background: var(--ink);
	transform: translateY(-180%);
}

.skip-link:focus {
	transform: translateY(0);
}

.site-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	max-width: 1220px;
	margin: 0 auto;
	padding: 2rem 1.5rem 1.25rem;
}

.brand {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.brand__refresh {
	display: inline-grid;
	padding: 0;
	border: 0;
	border-radius: 14px;
	background: transparent;
	cursor: pointer;
}

.brand__mark {
	width: 64px;
	height: 64px;
	filter: drop-shadow(0 8px 12px rgb(49 89 216 / 18%));
}

.eyebrow,
.step-label {
	margin-bottom: .2rem;
	color: var(--primary);
	font-size: .75rem;
	font-weight: 800;
	letter-spacing: .12em;
	text-transform: uppercase;
}

.header-actions,
.button-row,
.card__heading,
.section-heading,
.snapshot-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.header-actions,
.button-row,
.snapshot-actions {
	flex-wrap: wrap;
}

.version-chip,
.status-badge {
	display: inline-flex;
	align-items: center;
	width: fit-content;
	min-height: 30px;
	padding: .3rem .65rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	color: var(--ink-soft);
	background: var(--surface);
	font-size: .82rem;
	font-weight: 700;
}

.status-badge--success {
	border-color: #8ed5bc;
	color: var(--success);
	background: var(--success-soft);
}

.status-badge--warning {
	border-color: #e3bd62;
	color: var(--warning);
	background: var(--warning-soft);
}

.status-badge--danger {
	border-color: #ef9ba6;
	color: var(--danger);
	background: var(--danger-soft);
}

.privacy-banner {
	display: flex;
	justify-content: center;
	gap: .65rem;
	padding: .75rem 1.5rem;
	color: #fff;
	background: var(--ink);
	font-size: .9rem;
	text-align: center;
}

.stage-nav {
	position: sticky;
	top: 0;
	z-index: 20;
	overflow-x: auto;
	border-bottom: 1px solid var(--line);
	background: rgb(246 248 252 / 94%);
	backdrop-filter: blur(12px);
}

.stage-nav ol {
	display: flex;
	gap: .35rem;
	max-width: 1220px;
	margin: 0 auto;
	padding: .7rem 1.5rem;
	list-style: none;
}

.stage-tab {
	display: flex;
	align-items: center;
	gap: .45rem;
	padding: .55rem .72rem;
	border: 0;
	border-radius: 9px;
	color: var(--ink-soft);
	background: transparent;
	font-size: .85rem;
	font-weight: 750;
	white-space: nowrap;
	cursor: pointer;
}

.stage-tab span {
	display: grid;
	width: 23px;
	height: 23px;
	place-items: center;
	border: 1px solid var(--line);
	border-radius: 50%;
	font-size: .7rem;
}

.stage-tab.is-current {
	color: var(--primary-dark);
	background: #e7edff;
}

.stage-tab.is-complete span {
	border-color: var(--success);
	color: #fff;
	background: var(--success);
}

main {
	width: min(1180px, calc(100% - 2rem));
	min-height: 62vh;
	margin: 2rem auto 4rem;
}

.stage-panel {
	animation: stage-in .22s ease-out;
}

@keyframes stage-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.section-heading {
	align-items: flex-start;
	margin-bottom: 1.25rem;
}

.section-heading > div > p:last-child {
	max-width: 760px;
	margin-bottom: 0;
	color: var(--ink-soft);
}

.card {
	margin-bottom: 1rem;
	padding: 1.25rem;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow);
}

.card p:last-child {
	margin-bottom: 0;
}

.card-grid,
.diagnostic-grid {
	display: grid;
	gap: 1rem;
}

.card-grid--two,
.diagnostic-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card__heading {
	align-items: flex-start;
	margin-bottom: 1rem;
}

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding: .65rem 1rem;
	border: 1px solid transparent;
	border-radius: 9px;
	font-weight: 760;
	text-decoration: none;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.button:not(:disabled):active {
	transform: translateY(1px);
}

.button--primary {
	color: #fff;
	background: var(--primary);
}

.button--primary:hover:not(:disabled) {
	background: var(--primary-dark);
}

.button--secondary {
	border-color: var(--line);
	color: var(--ink);
	background: var(--surface);
}

.button--secondary:hover:not(:disabled),
.button--quiet:hover:not(:disabled) {
	background: var(--surface-soft);
}

.button--quiet,
.button--danger-quiet {
	border-color: transparent;
	background: transparent;
}

.button--danger {
	color: #fff;
	background: var(--danger);
}

.button--danger:hover:not(:disabled) {
	background: var(--danger-dark);
}

.button--danger-quiet {
	color: var(--danger);
}

.file-button {
	width: fit-content;
}

label {
	display: block;
	margin-bottom: .45rem;
	font-size: .9rem;
	font-weight: 750;
}

.textarea {
	width: 100%;
	padding: .85rem;
	border: 1px solid var(--line);
	border-radius: 9px;
	color: var(--ink);
	background: #fff;
	line-height: 1.5;
	resize: vertical;
}

.textarea--small {
	min-height: 9rem;
}

.textarea--code {
	min-height: 26rem;
	font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
	font-size: .86rem;
	tab-size: 4;
}

.field-help {
	margin-top: .65rem;
	color: var(--ink-soft);
	font-size: .83rem;
}

.project-name {
	margin-bottom: 0;
	font-size: 1.3rem;
	font-weight: 800;
	overflow-wrap: anywhere;
}

.stat-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: .75rem;
	margin: 0 0 1.25rem;
}

.stat-grid div {
	padding: .9rem;
	border-radius: 10px;
	background: var(--surface-soft);
}

.stat-grid dt {
	color: var(--ink-soft);
	font-size: .75rem;
	font-weight: 750;
	text-transform: uppercase;
}

.stat-grid dd {
	margin: .3rem 0 0;
	font-size: 1.25rem;
	font-weight: 850;
}

details summary {
	padding: .2rem;
	font-weight: 780;
	cursor: pointer;
}

.details-content {
	padding: 1rem .2rem .1rem;
	color: var(--ink-soft);
}

.drop-zone {
	margin-bottom: 1rem;
	padding: 1.5rem;
	border: 2px dashed #98a8c2;
	border-radius: var(--radius);
	background: rgb(255 255 255 / 65%);
	text-align: center;
	transition: border-color .15s ease, background .15s ease;
}

.drop-zone p {
	margin-bottom: .35rem;
}

.drop-zone.is-dragging {
	border-color: var(--primary);
	background: #eaf0ff;
}

.message-list {
	display: grid;
	gap: .65rem;
	margin: .75rem 0;
}

.message {
	padding: .8rem 1rem;
	border-left: 4px solid var(--line);
	border-radius: 8px;
	color: var(--ink);
	background: var(--surface-soft);
	overflow-wrap: anywhere;
}

.message strong {
	display: block;
	margin-bottom: .2rem;
}

.message--warning {
	border-color: var(--warning);
	background: var(--warning-soft);
}

.message--error {
	border-color: var(--danger);
	background: var(--danger-soft);
}

.warning-panel {
	margin-bottom: 1rem;
	padding: 1rem 1.1rem;
	border: 1px solid #e3bd62;
	border-radius: var(--radius);
	background: var(--warning-soft);
}

.warning-panel p {
	margin: .35rem 0 0;
}

.operation-list {
	display: grid;
	gap: .65rem;
}

.operation-item {
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: .8rem;
	align-items: start;
	padding: .85rem;
	border: 1px solid var(--line);
	border-radius: 10px;
}

.operation-item__id {
	font-family: "SFMono-Regular", Consolas, monospace;
	font-size: .8rem;
	font-weight: 800;
}

.operation-item p {
	margin: .2rem 0 0;
	color: var(--ink-soft);
	font-size: .85rem;
	overflow-wrap: anywhere;
}

.preview-layout {
	display: grid;
	grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
	gap: 1rem;
}

.preview-sidebar,
.preview-main {
	min-width: 0;
}

.file-list {
	display: grid;
	gap: .35rem;
	max-height: 34rem;
	overflow: auto;
}

.file-list button {
	width: 100%;
	padding: .7rem;
	border: 1px solid transparent;
	border-radius: 8px;
	color: var(--ink);
	background: transparent;
	text-align: left;
	overflow-wrap: anywhere;
	cursor: pointer;
}

.file-list button:hover,
.file-list button.is-selected,
.file-list button[aria-pressed="true"] {
	border-color: var(--line);
	background: var(--surface-soft);
}

.file-list small {
	display: block;
	margin-top: .2rem;
	color: var(--ink-soft);
}

.segmented-control {
	display: flex;
	flex-wrap: wrap;
	padding: 3px;
	border: 1px solid var(--line);
	border-radius: 9px;
	background: var(--surface-soft);
}

.segmented-control button {
	padding: .4rem .6rem;
	border: 0;
	border-radius: 6px;
	background: transparent;
	font-size: .78rem;
	font-weight: 750;
	cursor: pointer;
}

.segmented-control button[aria-pressed="true"] {
	background: #fff;
	box-shadow: 0 2px 7px rgb(23 36 63 / 12%);
}

.code-view,
.report-view {
	max-height: 34rem;
	margin: 0 0 1rem;
	overflow: auto;
	border: 1px solid var(--line);
	border-radius: 9px;
	background: #111a2e;
	color: #e7edfa;
	font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
	font-size: .8rem;
	line-height: 1.55;
	tab-size: 4;
}

.code-view {
	min-height: 20rem;
}

.report-view {
	padding: 1rem;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.code-line {
	display: grid;
	grid-template-columns: 4.3rem minmax(max-content, 1fr);
	min-width: fit-content;
}

.code-line__number {
	position: sticky;
	left: 0;
	padding: 0 .75rem;
	border-right: 1px solid #31405d;
	color: #8290aa;
	background: #111a2e;
	text-align: right;
	user-select: none;
}

.code-line__text {
	min-height: 1.55em;
	padding: 0 .8rem;
	white-space: pre;
}

.code-line--added {
	background: #123b32;
}

.code-line--removed {
	background: #49232c;
}

.code-line--context {
	color: #c5cee0;
}

.code-line--meta {
	color: #98b4ff;
	background: #1a2947;
}

.empty-state {
	padding: 1rem;
	border: 1px dashed var(--line);
	border-radius: 9px;
	color: var(--ink-soft);
	text-align: center;
}

.snapshot-item {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 1rem;
	padding: .85rem 0;
	border-bottom: 1px solid var(--line);
}

.snapshot-item:last-child {
	border-bottom: 0;
}

.snapshot-item p {
	margin: .2rem 0 0;
	color: var(--ink-soft);
	font-size: .84rem;
}

.busy-overlay {
	position: fixed;
	inset: 0;
	z-index: 80;
	display: grid;
	place-items: center;
	padding: 1rem;
	background: rgb(17 26 46 / 66%);
	backdrop-filter: blur(4px);
}

.busy-card {
	width: min(430px, 100%);
	padding: 1.5rem;
	border-radius: var(--radius);
	background: #fff;
	box-shadow: 0 24px 70px rgb(0 0 0 / 28%);
	text-align: center;
}

.busy-card progress {
	width: 100%;
	margin-top: .75rem;
}

.spinner {
	width: 38px;
	height: 38px;
	margin: 0 auto 1rem;
	border: 4px solid #d9e0ef;
	border-top-color: var(--primary);
	border-radius: 50%;
	animation: spin .8s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.dialog {
	width: min(520px, calc(100% - 2rem));
	padding: 1.4rem;
	border: 0;
	border-radius: var(--radius);
	box-shadow: 0 24px 70px rgb(0 0 0 / 28%);
}

.dialog::backdrop {
	background: rgb(17 26 46 / 66%);
	backdrop-filter: blur(3px);
}

footer {
	padding: 2rem 1rem 2.5rem;
	border-top: 1px solid var(--line);
	color: var(--ink-soft);
	text-align: center;
}

footer p {
	margin: .25rem 0;
	font-size: .86rem;
}

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

@media (max-width: 820px) {
	.card-grid--two,
	.diagnostic-grid,
	.preview-layout {
		grid-template-columns: 1fr;
	}

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

	.preview-sidebar .file-list {
		max-height: 14rem;
	}

	.section-heading {
		flex-direction: column;
	}

	.privacy-banner {
		flex-direction: column;
		gap: 0;
	}
}

@media (max-width: 560px) {
	.site-header {
		align-items: flex-start;
		flex-direction: column;
	}

	.header-actions {
		width: 100%;
	}

	.brand__mark {
		width: 52px;
		height: 52px;
	}

	main {
		width: min(100% - 1rem, 1180px);
		margin-top: 1rem;
	}

	.card {
		padding: 1rem;
	}

	.stat-grid {
		grid-template-columns: 1fr 1fr;
	}

	.card__heading {
		flex-direction: column;
	}

	.operation-item,
	.snapshot-item {
		grid-template-columns: 1fr;
	}

	.button-row .button {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	* {
		scroll-behavior: auto !important;
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}
}