/* NCK MTK Models — inherits the theme's text colour, so it works on light or dark. */

.nck-mtk {
	--nck-line: color-mix(in srgb, currentColor 16%, transparent);
	--nck-soft: color-mix(in srgb, currentColor 5%, transparent);
	--nck-mute: color-mix(in srgb, currentColor 62%, transparent);
	--nck-accent: #e8442a;
	--nck-radius: 10px;

	color: inherit;
	margin: 2.5rem 0 0;
	font-size: 0.95rem;
	line-height: 1.55;
}

/* Fallback for browsers without color-mix(). */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
	.nck-mtk {
		--nck-line: rgba(128, 128, 128, 0.32);
		--nck-soft: rgba(128, 128, 128, 0.09);
		--nck-mute: rgba(128, 128, 128, 0.95);
	}
}

.nck-mtk *,
.nck-mtk *::before,
.nck-mtk *::after {
	box-sizing: border-box;
}

.nck-mtk__title {
	margin: 0 0 0.75rem;
}

/* Wrapper used when the block is injected outside the page content. */
.nck-mtk-mount {
	display: block;
	clear: both;
}

/* ---------- header ---------- */

.nck-mtk__head {
	margin-bottom: 1rem;
}

.nck-mtk__stats {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1.25rem;
	margin: 0 0 0.75rem;
	font-size: 0.875rem;
	color: var(--nck-mute);
}

.nck-mtk__stats strong {
	color: inherit;
	font-weight: 700;
}

.nck-mtk__tools {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.nck-mtk__input {
	flex: 1 1 260px;
	min-width: 0;
	padding: 0.6rem 0.85rem;
	font: inherit;
	font-size: 0.95rem;
	color: inherit;
	background: var(--nck-soft);
	border: 1px solid var(--nck-line);
	border-radius: var(--nck-radius);
	-webkit-appearance: none;
	appearance: none;
}

.nck-mtk__input::placeholder {
	color: var(--nck-mute);
	opacity: 1;
}

.nck-mtk__input:focus-visible,
.nck-mtk__toggle:focus-visible,
.nck-mtk__summary:focus-visible {
	outline: 2px solid var(--nck-accent);
	outline-offset: 2px;
}

.nck-mtk__toggle {
	flex: 0 0 auto;
	padding: 0.6rem 1rem;
	font: inherit;
	font-size: 0.875rem;
	color: inherit;
	background: transparent;
	border: 1px solid var(--nck-line);
	border-radius: var(--nck-radius);
	cursor: pointer;
}

.nck-mtk__toggle:hover {
	background: var(--nck-soft);
}

.nck-mtk__status {
	margin: 0.6rem 0 0;
	min-height: 1.2em;
	font-size: 0.85rem;
	color: var(--nck-mute);
}

/* ---------- CPU blocks ---------- */

.nck-mtk__list {
	border-top: 1px solid var(--nck-line);
}

.nck-mtk__cpu {
	border-bottom: 1px solid var(--nck-line);
}

.nck-mtk__cpu[hidden] {
	display: none;
}

.nck-mtk__summary {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem 0.75rem;
	padding: 0.85rem 0.25rem;
	cursor: pointer;
	list-style: none;
	user-select: none;
}

.nck-mtk__summary::-webkit-details-marker {
	display: none;
}

.nck-mtk__summary::before {
	content: "";
	flex: 0 0 auto;
	width: 0.5rem;
	height: 0.5rem;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(-45deg);
	transition: transform 0.15s ease;
	opacity: 0.55;
}

.nck-mtk__cpu[open] > .nck-mtk__summary::before {
	transform: rotate(45deg);
}

.nck-mtk__summary:hover {
	background: var(--nck-soft);
}

.nck-mtk__code {
	font-weight: 700;
	letter-spacing: 0.01em;
}

.nck-mtk__sub {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.4rem 0.6rem;
	min-width: 0;
}

.nck-mtk__family {
	font-size: 0.8rem;
	color: var(--nck-mute);
}

.nck-mtk__flag {
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-weight: 700;
	padding: 0.15rem 0.45rem;
	border-radius: 999px;
	color: var(--nck-accent);
	border: 1px solid color-mix(in srgb, var(--nck-accent) 45%, transparent);
}

.nck-mtk__count {
	margin-left: auto;
	font-size: 0.8rem;
	color: var(--nck-mute);
	font-variant-numeric: tabular-nums;
}

.nck-mtk__body {
	padding: 0 0.25rem 1.1rem;
}

.nck-mtk__note,
.nck-mtk__cat {
	margin: 0 0 0.75rem;
	font-size: 0.85rem;
	color: var(--nck-mute);
}

/* ---------- brand rows ---------- */

.nck-mtk__brands {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.55rem;
}

.nck-mtk__brand {
	display: grid;
	grid-template-columns: minmax(6.5rem, 8rem) 1fr;
	gap: 0.25rem 0.9rem;
	padding-bottom: 0.55rem;
	border-bottom: 1px dashed var(--nck-line);
}

.nck-mtk__brand:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.nck-mtk__brand[hidden] {
	display: none;
}

.nck-mtk__bname {
	font-weight: 600;
	font-size: 0.875rem;
}

.nck-mtk__models {
	display: block;
	color: var(--nck-mute);
	font-size: 0.875rem;
}

.nck-mtk__model:not([hidden]) ~ .nck-mtk__model:not([hidden])::before {
	content: " · ";
	opacity: 0.5;
}

.nck-mtk__model[hidden] {
	display: none;
}

.nck-mtk__model--hit {
	color: inherit;
	font-weight: 600;
	background: color-mix(in srgb, var(--nck-accent) 18%, transparent);
	border-radius: 3px;
	padding: 0 0.15rem;
	margin: 0 -0.15rem;
}

.nck-mtk__model--plain {
	font-style: italic;
}

/* ---------- footer ---------- */

.nck-mtk__empty,
.nck-mtk__foot {
	margin: 1rem 0 0;
	font-size: 0.8rem;
	color: var(--nck-mute);
}

.nck-mtk__empty code {
	font-size: 0.95em;
	padding: 0.1rem 0.3rem;
	background: var(--nck-soft);
	border-radius: 4px;
}

.nck-mtk__error {
	padding: 0.85rem 1rem;
	border: 1px solid var(--nck-line);
	border-radius: var(--nck-radius);
	color: var(--nck-mute);
}

@media (max-width: 560px) {
	.nck-mtk__brand {
		grid-template-columns: 1fr;
		gap: 0.15rem;
	}

	/* Keep the code and its count on the first line; drop the family chip below. */
	.nck-mtk__sub {
		order: 3;
		flex-basis: 100%;
	}
}

/* Keep everything open and visible when the page is printed. */
@media print {
	.nck-mtk__tools,
	.nck-mtk__status {
		display: none;
	}

	.nck-mtk__body {
		display: block !important;
	}
}
