.ktr {
	--k-ink: var(--wp--preset--color--ink, #243d56);
	--k-brand: var(--wp--preset--color--brand, #7893ac);
	--k-pale: var(--wp--preset--color--pale, #e8eef3);
	--k-surface: var(--wp--preset--color--surface, #fff);
	--k-muted: var(--wp--preset--color--muted, #5e6d7b);
	--k-line: var(--wp--preset--color--line, #d8dfe5);
	--k-focus: var(--wp--preset--color--focus, #446d92);
	--k-ok: var(--wp--preset--color--success, #2c654d);
	--k-ok-bg: var(--wp--preset--color--success-surface, #edf5ef);
	--k-warn: var(--wp--preset--color--warning, #805a17);
	--k-warn-bg: var(--wp--preset--color--warning-surface, #fbf3e5);
	--k-err: var(--wp--preset--color--error, #a33b36);
	--k-err-bg: var(--wp--preset--color--error-surface, #f9ecea);
	display: grid;
	gap: 24px;
	max-width: 1240px;
	margin: 32px auto 64px;
	color: var(--k-ink);
}

.ktr [hidden] {
	display: none !important;
}

.ktr p,
.ktr h1,
.ktr h2,
.ktr ol,
.ktr ul,
.ktr figure,
.ktr label {
	margin: 0;
}

.ktr :focus-visible {
	outline: 3px solid var(--k-focus);
	outline-offset: 3px;
}

.ktr__head {
	display: grid;
	gap: 12px;
}

.ktr__eyebrow {
	color: var(--k-brand);
	font-weight: 700;
	font-size: 0.8125rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.ktr__title {
	font-size: clamp(2rem, 4vw, 2.75rem);
	line-height: 1.13;
	letter-spacing: -0.03em;
	font-weight: 600;
	max-width: 900px;
}

.ktr__lead {
	color: var(--k-muted);
	max-width: 760px;
	font-size: 1.0625rem;
}

.ktr__steps {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	padding: 0;
	margin-top: 8px;
	counter-reset: kstep;
}

.ktr__steps li {
	counter-increment: kstep;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 14px 6px 6px;
	border-radius: 999px;
	background: var(--k-surface);
	border: 1px solid var(--k-line);
	color: var(--k-muted);
	font-size: 0.875rem;
	font-weight: 600;
}

.ktr__steps li::before {
	content: counter(kstep);
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--k-pale);
	color: var(--k-ink);
	font-size: 0.75rem;
}

.ktr__steps li.is-current {
	border-color: var(--k-ink);
	color: var(--k-ink);
}

.ktr__steps li.is-done::before {
	content: "✓";
	background: var(--k-ink);
	color: #fff;
}

.ktr__card {
	display: grid;
	gap: 16px;
	padding: 24px;
	border: 1px solid var(--k-line);
	border-radius: 16px;
	background: var(--k-surface);
}

.ktr__h2 {
	font-size: 1.375rem;
	font-weight: 600;
	letter-spacing: -0.01em;
}

.ktr__categories {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 12px;
}

.ktr__category {
	display: grid;
	gap: 4px;
	padding: 16px;
	border: 1px solid var(--k-line);
	border-radius: 12px;
	background: var(--k-surface);
	color: var(--k-ink);
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.ktr__category span {
	color: var(--k-muted);
	font-size: 0.75rem;
	line-height: 1.45;
}

.ktr__category:hover {
	border-color: var(--k-brand);
}

.ktr__category[aria-checked="true"] {
	background: var(--k-pale);
	border-color: var(--k-ink);
	box-shadow: inset 0 0 0 1px var(--k-ink);
}

.ktr__drop {
	position: relative;
	display: grid;
	justify-items: center;
	gap: 6px;
	padding: 32px 16px;
	border: 1.5px dashed var(--k-brand);
	border-radius: 12px;
	background: var(--k-surface);
	text-align: center;
	cursor: pointer;
}

.ktr__drop:hover,
.ktr__drop.is-over {
	background: var(--k-pale);
	border-color: var(--k-ink);
}

.ktr__drop input {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
}

.ktr__drop svg {
	width: 32px;
	height: 32px;
	fill: none;
	stroke: var(--k-ink);
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.ktr__drop span,
.ktr__help,
.ktr__note {
	color: var(--k-muted);
	font-size: 0.875rem;
	line-height: 1.55;
}

.ktr.is-busy .ktr__status::before {
	content: "";
	display: inline-block;
	width: 0.85em;
	height: 0.85em;
	margin-right: 0.5em;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	vertical-align: -0.12em;
	animation: ktr-spin 0.8s linear infinite;
}

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

.ktr__review-head {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: baseline;
	gap: 8px;
}

.ktr__save {
	color: var(--k-muted);
	font-size: 0.8125rem;
}

.ktr__alerts {
	display: grid;
	gap: 8px;
}

.ktr__alert {
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 0.875rem;
}

.ktr__alert.is-warning {
	background: var(--k-warn-bg);
	color: var(--k-warn);
}

.ktr__alert.is-info {
	background: var(--k-pale);
}

.ktr__split {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: 24px;
	align-items: start;
}

.ktr__source {
	position: sticky;
	top: 24px;
	display: grid;
	gap: 8px;
}

.ktr__source figcaption {
	font-weight: 600;
	font-size: 0.875rem;
}

.ktr__source-view {
	border: 1px solid var(--k-line);
	border-radius: 12px;
	background: #f4f6f8;
	max-height: 80vh;
	overflow: auto;
}

.ktr__source-view img {
	display: block;
	width: 100%;
	height: auto;
}

.ktr__fields {
	display: grid;
	gap: 16px;
}

.ktr__field {
	display: grid;
	gap: 6px;
	padding-left: 12px;
	border-left: 3px solid transparent;
}

.ktr__field label {
	font-size: 0.8125rem;
	font-weight: 600;
}

.ktr__field input:not([type="checkbox"]),
.ktr__field textarea,
.ktr__field select {
	width: 100%;
	min-height: 44px;
	padding: 10px 12px;
	border: 1px solid var(--k-line);
	border-radius: 8px;
	background: var(--k-surface);
	color: var(--k-ink);
	font: inherit;
	line-height: 1.5;
}

.ktr__field textarea {
	resize: vertical;
}

.ktr__field.is-missing {
	border-left-color: var(--k-err);
}

.ktr__field.is-missing input,
.ktr__field.is-missing textarea {
	border-color: var(--k-err);
	background: var(--k-err-bg);
}

.ktr__field.is-client.is-missing {
	border-left-color: var(--k-warn);
}

.ktr__field.is-client.is-missing input,
.ktr__field.is-client.is-missing textarea {
	border-color: var(--k-warn);
	background: var(--k-warn-bg);
}

.ktr__hint {
	color: var(--k-muted);
	font-size: 0.8125rem;
}

.ktr__field.is-missing .ktr__hint {
	color: var(--k-err);
	font-weight: 600;
}

.ktr__field.is-client.is-missing .ktr__hint {
	color: var(--k-warn);
}

.ktr__nutrition {
	display: grid;
	gap: 6px;
}

.ktr__nrow {
	display: grid;
	grid-template-columns: 1fr 140px;
	gap: 8px;
	align-items: center;
	font-size: 0.875rem;
}

.ktr__nrow label {
	font-weight: 400 !important;
}

.ktr__lot {
	display: grid;
	gap: 8px;
}

.ktr__missing {
	padding-left: 20px;
	color: var(--k-err);
	font-size: 0.875rem;
}

.ktr__confirm {
	display: grid;
	grid-template-columns: 20px 1fr;
	gap: 10px;
	align-items: start;
	font-size: 0.9375rem;
	cursor: pointer;
}

.ktr__confirm input {
	width: 18px;
	height: 18px;
	margin-top: 3px;
	accent-color: var(--k-ink);
}

.ktr__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

.ktr__actions .wp-element-button:disabled {
	background: var(--k-line);
	color: var(--k-muted);
	cursor: not-allowed;
}

.ktr__done {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	border-radius: 10px;
	background: var(--k-ok-bg);
	color: var(--k-ok);
}

.ktr__drop span + span {
	max-width: 46ch;
}

.ktr__h3 {
	font-size: 1.0625rem;
	font-weight: 700;
}

.ktr__batch {
	display: grid;
	gap: 12px;
	margin-top: 20px;
}

.ktr__batch-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 16px;
}

.ktr__batch-list {
	display: grid;
	gap: 8px;
	padding: 0;
	list-style: none;
}

.ktr__item {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border: 1px solid var(--k-line);
	border-radius: 10px;
	background: var(--k-surface);
}

.ktr__item-n {
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--k-pale);
	font-size: 0.8125rem;
	font-weight: 700;
}

.ktr__item-info {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.ktr__item-info strong {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ktr__item-info span {
	color: var(--k-muted);
	font-size: 0.875rem;
	overflow-wrap: anywhere;
}

.ktr__item.is-reading .ktr__item-info span::before {
	content: "";
	display: inline-block;
	width: 10px;
	height: 10px;
	margin-right: 6px;
	border: 2px solid var(--k-line);
	border-top-color: var(--k-focus);
	border-radius: 50%;
	vertical-align: -1px;
	animation: ktr-spin 0.8s linear infinite;
}

.ktr__item.is-approved {
	border-color: var(--k-ok);
	background: var(--k-ok-bg);
}

.ktr__item.is-approved .ktr__item-info span {
	color: var(--k-ok);
}

.ktr__item.is-error .ktr__item-info span {
	color: var(--k-err);
}

.ktr__item .wp-element-button {
	padding: 8px 16px;
	font-size: 0.875rem;
}

.ktr__crumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 16px;
	color: var(--k-muted);
	font-size: 0.875rem;
}

.ktr__back {
	padding: 8px 14px;
	border: 1px solid var(--k-line);
	border-radius: 999px;
	background: var(--k-surface);
	color: var(--k-ink);
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
}

.ktr__back:hover {
	border-color: var(--k-brand);
}

.ktr__crumb .ktr__back::before {
	content: "← ";
}

.ktr__done-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

@media (max-width: 800px) {
	.ktr {
		margin-top: 16px;
	}

	.ktr__card {
		padding: 16px;
	}

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

	.ktr__source {
		position: static;
	}

	.ktr__source-view {
		max-height: 50vh;
	}
}
