.kcc-comparison {
	--kcc-c-line: #e3e8f1;
	--kcc-c-ink: #0d1526;
	--kcc-c-muted: #56627a;
	--kcc-c-primary: #1a56db;
	--kcc-c-accent: #f59e0b;
	--kcc-ease: cubic-bezier(0.22, 1, 0.36, 1);
	margin: 2.5rem 0;
	font-size: 0.95rem;
	font-variant-numeric: tabular-nums;
}

/* ---------- Toolbar ---------- */
.kcc-comparison__controls {
	display: flex;
	flex-wrap: wrap;
	gap: 0.9rem 1.5rem;
	align-items: center;
	justify-content: space-between;
	padding: 0.9rem 1.1rem;
	margin-bottom: 1.4rem;
	background: #fff;
	border: 1px solid var(--kcc-c-line);
	border-radius: 0.85rem;
	box-shadow: 0 1px 2px rgba(13, 21, 38, 0.05);
}

.kcc-comparison__sort {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: 700;
	color: var(--kcc-c-ink);
}

.kcc-comparison__sort select {
	appearance: none;
	-webkit-appearance: none;
	font: inherit;
	font-weight: 600;
	color: var(--kcc-c-ink);
	background: #f4f7fc
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2356627a' d='M1 1l5 5 5-5'/%3E%3C/svg%3E")
		no-repeat right 0.7rem center;
	border: 1px solid var(--kcc-c-line);
	border-radius: 0.55rem;
	padding: 0.5rem 2rem 0.5rem 0.8rem;
	cursor: pointer;
}

.kcc-comparison__filters {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.kcc-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--kcc-c-muted);
	background: #f4f7fc;
	border: 1px solid var(--kcc-c-line);
	padding: 0.4rem 0.8rem;
	border-radius: 999px;
	cursor: pointer;
	transition: all 0.18s var(--kcc-ease);
	user-select: none;
}

.kcc-chip:hover {
	border-color: rgba(26, 86, 219, 0.45);
	color: var(--kcc-c-ink);
}

.kcc-chip input {
	accent-color: var(--kcc-c-primary);
	margin: 0;
}

.kcc-chip:has(input:checked),
.kcc-chip.is-active {
	background: rgba(26, 86, 219, 0.1);
	border-color: var(--kcc-c-primary);
	color: var(--kcc-c-primary);
}

/* ---------- Program rail shell ---------- */
.kcc-comparison__shell {
	display: grid;
	grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
	gap: 1rem;
	align-items: start;
}

.kcc-program-rail {
	position: sticky;
	top: 1rem;
	max-height: calc(100vh - 2rem);
	overflow: auto;
	background: #f1f3f6;
	border: 1px solid #d7dce5;
	border-radius: 0.5rem;
	box-shadow: inset -1px 0 0 rgba(13, 21, 38, 0.05);
}

.kcc-program-rail__label {
	position: sticky;
	top: 0;
	z-index: 1;
	padding: 0.75rem 0.9rem;
	background: #e7eaef;
	border-bottom: 1px solid #d7dce5;
	color: #3e4655;
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.kcc-program-rail__list {
	display: flex;
	flex-direction: column;
}

.kcc-program-rail__button {
	display: grid;
	grid-template-columns: 2rem minmax(0, 1fr);
	gap: 0.65rem;
	align-items: center;
	width: 100%;
	min-height: 3.6rem;
	padding: 0.75rem 0.85rem;
	color: #343b49;
	background: transparent;
	border: 0;
	border-bottom: 1px solid #d7dce5;
	text-align: left;
	cursor: pointer;
	transition:
		background-color 0.18s var(--kcc-ease),
		color 0.18s var(--kcc-ease),
		box-shadow 0.18s var(--kcc-ease);
}

.kcc-program-rail__button[hidden] {
	display: none;
}

.kcc-program-rail__button:hover,
.kcc-program-rail__button.is-active {
	background: #fff;
	color: var(--kcc-c-ink);
	box-shadow: inset 3px 0 0 #0f766e;
	outline: none;
}

.kcc-program-rail__button:focus-visible {
	background: #fff;
	color: var(--kcc-c-ink);
	box-shadow:
		inset 3px 0 0 #0f766e,
		0 0 0 3px rgba(15, 118, 110, 0.18);
	outline: 2px solid #0f766e;
	outline-offset: -2px;
}

.kcc-program-rail__logo {
	display: inline-grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	border-radius: 0.35rem;
	overflow: hidden;
	background: #fff;
	border: 1px solid rgba(13, 21, 38, 0.08);
	font-family: var(--wp--preset--font-family--sans, sans-serif);
	font-weight: 800;
	color: #0f766e;
}

.kcc-program-rail__logo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.kcc-program-rail__body {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.12rem;
}

.kcc-program-rail__name {
	overflow-wrap: anywhere;
	font-weight: 700;
	line-height: 1.25;
}

/* ---------- Card grid ---------- */
.kcc-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr));
	gap: 1.25rem;
	min-width: 0;
}

.kcc-card {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
	background: #fff;
	border: 1px solid var(--kcc-c-line);
	border-radius: 0.5rem;
	padding: 1.1rem 1.1rem 1.2rem;
	box-shadow: 0 10px 30px -16px rgba(13, 21, 38, 0.22);
	transition:
		transform 0.22s var(--kcc-ease),
		box-shadow 0.22s var(--kcc-ease),
		border-color 0.22s var(--kcc-ease);
}

.kcc-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 22px 44px -18px rgba(13, 21, 38, 0.3);
	border-color: rgba(26, 86, 219, 0.35);
}

.kcc-card--top {
	border-color: rgba(245, 158, 11, 0.55);
	box-shadow:
		0 0 0 1px rgba(245, 158, 11, 0.35),
		0 16px 40px -18px rgba(245, 158, 11, 0.45);
}

.kcc-card--active {
	border-color: rgba(15, 118, 110, 0.75);
	box-shadow:
		0 0 0 2px rgba(15, 118, 110, 0.12),
		0 18px 40px -20px rgba(15, 118, 110, 0.42);
}

.kcc-card--hidden {
	display: none;
}

/* ---------- Topline: rank + tags ---------- */
.kcc-card__topline {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	flex-wrap: wrap;
}

.kcc-card__rank {
	flex: 0 0 auto;
	display: inline-grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	border-radius: 0.55rem;
	font-family: var(--wp--preset--font-family--sans, sans-serif);
	font-weight: 800;
	font-size: 0.95rem;
	color: #fff;
	background: #9aa6bd;
}

.kcc-card__rank--1 {
	background: linear-gradient(135deg, #f7c948, #d99e0b);
	color: #3a2a00;
}
.kcc-card__rank--2 {
	background: linear-gradient(135deg, #cfd8e6, #9aa6bd);
	color: #2a3142;
}
.kcc-card__rank--3 {
	background: linear-gradient(135deg, #e2a877, #b9783f);
	color: #3a1f08;
}

.kcc-card__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
}

.kcc-tag {
	font-size: 0.7rem;
	font-weight: 700;
	color: var(--kcc-c-muted);
	background: #f1f4fa;
	border: 1px solid var(--kcc-c-line);
	padding: 0.18rem 0.5rem;
	border-radius: 999px;
	white-space: nowrap;
}

.kcc-tag--hero {
	color: #fff;
	background: linear-gradient(135deg, #1a56db, #2563eb);
	border-color: transparent;
}

/* ---------- Card visual (CSS mockup, brand-agnostic) ---------- */
.kcc-card__viz {
	position: relative;
	aspect-ratio: 1.586 / 1;
	border-radius: 0.45rem;
	padding: 0.95rem 1.05rem;
	color: #fff;
	display: grid;
	grid-template-areas:
		"chip net"
		"name name"
		"foot foot";
	grid-template-rows: auto 1fr auto;
	background:
		radial-gradient(
			130% 130% at 82% 6%,
			hsl(var(--kcc-h, 220) 72% 48% / 0.55),
			transparent 58%
		),
		linear-gradient(
			135deg,
			#0b1838,
			#122a59 52%,
			hsl(var(--kcc-h, 220) 52% 22%)
		);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.14),
		0 12px 26px -14px rgba(13, 21, 38, 0.6);
	overflow: hidden;
}

.kcc-card__viz::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		115deg,
		transparent 38%,
		rgba(255, 255, 255, 0.16) 50%,
		transparent 62%
	);
	pointer-events: none;
}

.kcc-card__viz--img {
	display: block;
	padding: 0;
	background: #0b1838;
}

.kcc-card__viz--img::before {
	display: none;
}

.kcc-card__viz--img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.kcc-card__viz-chip {
	grid-area: chip;
	width: 2.5rem;
	height: 1.75rem;
	border-radius: 0.35rem;
	background: linear-gradient(135deg, #f3d27a, #b8860b);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
	position: relative;
}

.kcc-card__viz-chip::after {
	content: "";
	position: absolute;
	inset: 0.32rem 0.4rem;
	border: 1px solid rgba(120, 80, 0, 0.5);
	border-radius: 0.15rem;
	background:
		linear-gradient(rgba(120, 80, 0, 0.5), rgba(120, 80, 0, 0.5)) center / 100%
		1px no-repeat,
		linear-gradient(rgba(120, 80, 0, 0.5), rgba(120, 80, 0, 0.5)) center / 1px
		100% no-repeat;
}

.kcc-card__viz-net {
	grid-area: net;
	justify-self: end;
	align-self: start;
	font-size: 0.66rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	opacity: 0.88;
}

.kcc-card__viz-name {
	grid-area: name;
	align-self: center;
	font-family: var(--wp--preset--font-family--sans, sans-serif);
	font-weight: 800;
	font-size: clamp(1.15rem, 2.4vw, 1.55rem);
	line-height: 1.15;
	letter-spacing: 0;
	text-shadow: 0 1px 12px rgba(0, 0, 0, 0.25);
}

.kcc-card__viz-foot {
	grid-area: foot;
	font-size: 0.62rem;
	font-weight: 600;
	letter-spacing: 0.26em;
	opacity: 0.62;
}

/* ---------- Name ---------- */
.kcc-card__name {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 800;
	line-height: 1.3;
}

.kcc-card__name a {
	color: var(--kcc-c-ink);
	text-decoration: none;
}

.kcc-card__name a:hover {
	color: var(--kcc-c-primary);
}

/* ---------- Specs ---------- */
.kcc-card__specs {
	margin: 0;
	display: flex;
	flex-direction: column;
}

.kcc-card__spec {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	padding: 0.5rem 0;
	border-bottom: 1px solid var(--kcc-c-line);
}

.kcc-card__spec:last-child {
	border-bottom: none;
}

.kcc-card__spec dt {
	margin: 0;
	color: var(--kcc-c-muted);
	font-size: 0.82rem;
	font-weight: 600;
}

.kcc-card__spec dd {
	margin: 0;
	font-weight: 700;
	color: var(--kcc-c-ink);
	text-align: right;
}

.kcc-card__spec--hero {
	align-items: center;
	padding: 0.65rem 0.85rem;
	margin-bottom: 0.3rem;
	border-bottom: none;
	border-radius: 0.45rem;
	background: linear-gradient(
		135deg,
		rgba(26, 86, 219, 0.09),
		rgba(245, 158, 11, 0.1)
	);
}

.kcc-card__spec--hero dt {
	color: var(--kcc-c-primary);
	font-weight: 700;
	font-size: 0.85rem;
}

.kcc-card__spec--hero dd {
	font-family: var(--wp--preset--font-family--sans, sans-serif);
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.25;
	text-align: right;
	word-break: break-word;
}

/* ---------- Yes / No flags ---------- */
.kcc-flag {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	font-weight: 700;
	font-size: 0.88rem;
}

.kcc-flag span {
	font-size: 0.95em;
}

.kcc-flag--yes {
	color: #15803d;
}

.kcc-flag--no {
	color: #9aa6bd;
}

/* ---------- Actions ---------- */
.kcc-card__actions {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 0.5rem;
	margin-top: auto;
	padding-top: 0.2rem;
}

.kcc-card__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.3rem;
	padding: 0.65rem 1rem;
	background: linear-gradient(135deg, #f59e0b, #f97316);
	color: #1a1207;
	font-weight: 800;
	border-radius: 0.45rem;
	text-decoration: none;
	white-space: nowrap;
	box-shadow: 0 8px 18px -8px rgba(245, 158, 11, 0.6);
	transition:
		transform 0.18s var(--kcc-ease),
		box-shadow 0.18s;
}

.kcc-card__cta span {
	transition: transform 0.18s ease;
}

.kcc-card__cta:hover {
	transform: translateY(-2px);
	box-shadow: 0 14px 26px -10px rgba(245, 158, 11, 0.7);
	color: #1a1207;
}

.kcc-card__cta:hover span {
	transform: translateX(3px);
}

.kcc-card__detail {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.65rem 0.9rem;
	border: 1px solid var(--kcc-c-line);
	border-radius: 0.45rem;
	color: var(--kcc-c-ink);
	font-weight: 700;
	font-size: 0.85rem;
	text-decoration: none;
	white-space: nowrap;
	transition:
		border-color 0.18s var(--kcc-ease),
		color 0.18s;
}

.kcc-card__detail:hover {
	border-color: var(--kcc-c-primary);
	color: var(--kcc-c-primary);
}

/* ---------- Empty + disclaimer ---------- */
.kcc-comparison__empty {
	margin: 1.5rem 0 0;
	padding: 1.5rem;
	text-align: center;
	color: var(--kcc-c-muted);
	background: #f4f7fc;
	border-radius: 0.85rem;
}

.kcc-comparison__disclaimer {
	margin-top: 1.1rem;
	font-size: 0.74rem;
	color: var(--kcc-c-muted);
	line-height: 1.7;
}

@media (max-width: 760px) {
	.kcc-comparison__shell {
		display: block;
	}

	.kcc-program-rail {
		position: relative;
		top: auto;
		max-height: none;
		margin-bottom: 1rem;
		overflow: hidden;
	}

	.kcc-program-rail__label {
		position: relative;
	}

	.kcc-program-rail__list {
		display: grid;
		grid-auto-columns: minmax(10rem, 68%);
		grid-auto-flow: column;
		overflow-x: auto;
		scroll-snap-type: x proximity;
	}

	.kcc-program-rail__button {
		border-bottom: 0;
		border-right: 1px solid #d7dce5;
		scroll-snap-align: start;
	}
}

@media (prefers-reduced-motion: reduce) {
	.kcc-card,
	.kcc-card__cta,
	.kcc-card__cta span {
		transition: none;
	}
	.kcc-card:hover {
		transform: none;
	}
}
