/**
 * Curlo Reconcile — migrate-check panel chrome + animation states.
 * Uses Curlo tokens; keeps the always-dark code surface like the reference visual.
 */

.curlo-reconcile {
	--cr-bg: var(--curlo-code-bg, #0b0e14);
	--cr-ink: var(--curlo-code-text, #e6edf3);
	--cr-muted: var(--curlo-code-muted, #7e8ca0);
	--cr-line: var(--curlo-code-line, #1e2a3d);
	--cr-accent: var(--curlo-green, #4ade80);
	--cr-accent-dim: rgb(74 222 128 / 0.55);

	position: relative;
	width: 100%;
	max-width: 36rem;
	margin: 0 auto;
	padding: 1.15rem 1.2rem 1rem;
	box-sizing: border-box;
	font-family: var(--curlo-font-mono, ui-monospace, monospace);
	background:
		radial-gradient(420px circle at 85% 0%, rgb(20 53 31 / 0.35), transparent 55%),
		var(--cr-bg);
	border: 1px solid var(--cr-line);
	border-radius: var(--curlo-radius, 0.75rem);
	color: var(--cr-accent);
	box-shadow: var(--curlo-shadow-lg, 0 22px 44px -22px rgb(0 0 0 / 0.8));
	overflow: hidden;
}

.curlo-reconcile__head {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2.25rem;
	margin-bottom: 0.85rem;
	padding: 0 0.15rem;
}

.curlo-reconcile__col-label {
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--cr-accent);
	line-height: 1.3;
}

.curlo-reconcile__col-label--target {
	text-align: right;
}

.curlo-reconcile__rows {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
}

.curlo-reconcile__row {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	gap: 0.55rem;
	align-items: center;
}

.curlo-reconcile__cell {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.65rem;
	min-height: 2.65rem;
	padding: 0.45rem 0.7rem;
	border: 1px solid var(--cr-line);
	border-radius: var(--curlo-radius-sm, 0.5rem);
	background: rgb(255 255 255 / 0.015);
	transition: border-color 0.25s ease, box-shadow 0.25s ease, opacity 0.3s ease;
}

.curlo-reconcile--animate .curlo-reconcile__cell--target {
	opacity: 0.45;
}

.curlo-reconcile--animate .curlo-reconcile__row.is-matched .curlo-reconcile__cell--target,
.curlo-reconcile.is-complete .curlo-reconcile__cell--target {
	opacity: 1;
}

.curlo-reconcile__row.is-matched .curlo-reconcile__cell {
	border-color: rgb(74 222 128 / 0.35);
	box-shadow: inset 0 0 0 1px rgb(74 222 128 / 0.08);
}

.curlo-reconcile__label {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 0.72rem;
	line-height: 1.25;
	color: var(--cr-muted);
	overflow-wrap: anywhere;
}

.curlo-reconcile__value {
	flex: 0 0 auto;
	font-size: 0.82rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: var(--cr-accent);
	white-space: nowrap;
}

.curlo-reconcile__cell--target .curlo-reconcile__value.is-ticking {
	color: var(--cr-accent-dim);
}

.curlo-reconcile__check {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.1rem;
	font-size: 0.95rem;
	line-height: 1;
	color: var(--cr-accent);
	opacity: 0;
	transform: scale(0.6);
	transition: opacity 0.22s ease, transform 0.22s ease;
}

.curlo-reconcile__row.is-matched .curlo-reconcile__check,
.curlo-reconcile.is-complete .curlo-reconcile__check {
	opacity: 1;
	transform: scale(1);
}

.curlo-reconcile__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 0.95rem;
	padding-top: 0.75rem;
	border-top: 1px dashed var(--cr-line);
	font-size: 0.72rem;
	color: var(--cr-accent-dim);
}

.curlo-reconcile__count {
	font-variant-numeric: tabular-nums;
}

.curlo-reconcile__status {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	color: var(--cr-accent);
}

.curlo-reconcile__pulse {
	width: 0.45rem;
	height: 0.45rem;
	border-radius: 999px;
	background: var(--cr-accent);
	box-shadow: 0 0 0 0 rgb(74 222 128 / 0.55);
	animation: curlo-reconcile-pulse 1.6s ease-out infinite;
}

@keyframes curlo-reconcile-pulse {
	0% { box-shadow: 0 0 0 0 rgb(74 222 128 / 0.5); }
	70% { box-shadow: 0 0 0 8px rgb(74 222 128 / 0); }
	100% { box-shadow: 0 0 0 0 rgb(74 222 128 / 0); }
}

/* Inspector row editor spacing */
.curlo-reconcile-editor__row {
	margin-bottom: 0.85rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid var(--curlo-line, #dce3ec);
}

@media (max-width: 520px) {
	.curlo-reconcile {
		padding: 1rem 0.85rem 0.85rem;
	}

	.curlo-reconcile__head {
		gap: 1rem;
	}

	.curlo-reconcile__row {
		gap: 0.35rem;
	}

	.curlo-reconcile__cell {
		padding: 0.4rem 0.5rem;
		min-height: 2.4rem;
	}

	.curlo-reconcile__label {
		font-size: 0.65rem;
	}

	.curlo-reconcile__value {
		font-size: 0.74rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.curlo-reconcile__pulse {
		animation: none;
	}

	.curlo-reconcile__check {
		transition: none;
	}
}
