@media (max-width: 1020px) {
	.kl-header {
		align-items: center;
		flex-wrap: wrap;
	}

	.kl-header-actions {
		order: 2;
		margin-inline-start: auto;
	}

	.kl-header .wp-block-navigation {
		flex: 0 0 auto;
		order: 3;
		flex-basis: auto;
		justify-content: flex-end;
	}

	.kl-hero-grid,
	.kl-section-head,
	.kl-guide-grid {
		grid-template-columns: 1fr;
	}

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

	.kl-hero h1 {
		max-width: 12ch;
	}

	.kl-start-card h2 {
		max-width: 100%;
	}

	.kl-single-content .wp-block-post-content > .wp-block-table {
		width: 100%;
		max-width: 100% !important;
	}

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

	.kl-start-page-grid,
	.kl-start-browse-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.kl-guide-grid {
		background: transparent;
		border: 0;
		gap: 1rem;
		overflow: visible;
	}

	.kl-guide-card {
		border: 1px solid var(--kl-border);
		border-radius: var(--kl-radius);
	}
}

@media (max-width: 640px) {
	.kl-header {
		min-height: 0;
		gap: 0.85rem;
	}

	.kl-brand img {
		width: 38px;
		height: 38px;
	}

	.kl-brand-title,
	.kl-brand-title a {
		font-size: 1.16rem;
	}

	.kl-brand {
		flex: 1 0 100%;
	}

	.kl-header-actions {
		order: 2;
		flex-wrap: wrap;
		margin-inline-start: 0;
		max-width: calc(100% - 54px);
	}

	.kl-header .wp-block-navigation {
		order: 3;
		flex: 0 0 auto;
		flex-basis: auto;
	}

	.kl-header .wp-block-navigation__responsive-container-open,
	.kl-header .wp-block-navigation__responsive-container-close {
		width: 44px;
		height: 44px;
	}

	.kl-header-search {
		min-width: 44px;
	}

	.kl-header-search-toggle,
	.kl-header-search .wp-block-search__button {
		width: 44px;
		height: 44px;
		min-width: 44px;
	}

	.kl-header-search-form {
		inset-inline: 0 auto;
	}

	.kl-header-search.is-open .kl-header-search-form {
		width: min(24rem, calc(100vw - 2rem));
	}

	.kl-header-search input[type='search'] {
		min-height: 44px;
		font-size: 0.84rem;
	}

	.kl-header-cta {
		min-height: 44px;
		padding-inline: 0.8rem;
		font-size: 0.84rem;
	}

	.kl-theme-toggle {
		min-height: 44px;
		padding-inline: 0.72rem;
		font-size: 0.84rem;
	}

	.kl-header .wp-block-navigation-item__content {
		padding: 0.48rem 0.5rem;
		font-size: 0.84rem;
	}

	@media (max-width: 340px) {
		.kl-header-actions {
			max-width: calc(100% - 58px);
			gap: 0.45rem;
		}

		.kl-header-cta {
			width: 100%;
			flex: 1 0 100%;
		}

		.kl-header .wp-block-navigation {
			align-self: flex-start;
		}
	}

	.kl-header .wp-block-navigation__responsive-container.is-menu-open {
		padding-block-start: calc(env(safe-area-inset-top) + 7rem);
	}

	.kl-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
		position: fixed;
		inset-block-start: calc(env(safe-area-inset-top) + 4.95rem);
		inset-inline-end: 1rem;
		z-index: 1001;
	}

	.kl-hero {
		padding-block: 2.4rem 1.45rem;
	}

	.kl-hero h1,
	.kl-single-title {
		overflow-wrap: anywhere;
	}

	.kl-actions.wp-block-buttons {
		width: 100%;
	}

	.kl-actions .wp-block-button,
	.kl-actions .wp-block-button__link {
		width: 100%;
	}

	.kl-start-inner {
		padding: 1.05rem;
	}

	.kl-author-archive-card {
		grid-template-columns: 52px minmax(0, 1fr);
	}

	.kl-author-avatar,
	.kl-author-archive-card .kl-author-avatar {
		width: 52px;
		height: 52px;
		font-size: 0.92rem;
	}

	.kl-author-line {
		align-items: center;
	}

	.kl-single-content .wp-block-table table {
		min-width: 760px;
		font-size: 0.9rem;
	}

	.kl-single-content .wp-block-table th,
	.kl-single-content .wp-block-table td {
		min-width: 132px;
		padding: 0.78rem 0.82rem;
	}

	.kl-single-content .wp-block-table th:first-child,
	.kl-single-content .wp-block-table td:first-child {
		position: sticky;
		inset-inline-start: 0;
		z-index: 1;
		min-width: 148px;
		background: var(--kl-surface);
		box-shadow: 1px 0 0 var(--kl-border);
	}

	.kl-single-content .wp-block-table th:first-child {
		z-index: 2;
		background: color-mix(in srgb, var(--kl-mint) 54%, var(--kl-surface));
	}

	.kl-topics {
		grid-template-columns: 1fr;
	}

	.kl-start-page-grid,
	.kl-start-browse-grid {
		grid-template-columns: 1fr;
	}

	.kl-start-step {
		min-height: 0;
	}

	.kl-experiment-grid {
		grid-template-columns: 1fr;
	}

	.kl-topic-card {
		min-height: 0;
	}

	.kl-post-nav {
		grid-template-columns: 1fr;
	}

	.kl-post-nav .post-navigation-link-next a {
		align-items: flex-start;
		text-align: start;
	}

	.kl-comments-card .wp-block-comment-template ol {
		padding-inline-start: 0.7rem;
	}

	.kl-footer {
		grid-template-columns: 1fr;
		gap: 1.3rem;
	}
}

@media (prefers-contrast: more) {
	:root {
		--kl-border: rgb(23 33 28 / 32%);
		--kl-border-strong: rgb(23 33 28 / 50%);
	}

	:root[data-kl-theme='dark'] {
		--kl-border: rgb(246 251 244 / 32%);
		--kl-border-strong: rgb(246 251 244 / 50%);
	}
}

@media (prefers-color-scheme: dark) and (scripting: none) and (prefers-contrast: more) {
	:root {
		--kl-border: rgb(246 251 244 / 32%);
		--kl-border-strong: rgb(246 251 244 / 50%);
	}
}

@media (forced-colors: active) {
	a {
		color: LinkText;
	}

	.kl-header-wrap,
	.kl-topic-card,
	.kl-post-card,
	.kl-start-card,
	.kl-start-step,
	.kl-start-browse-grid a,
	.kl-guide-intro,
	.kl-guide-card,
	.kl-toc details,
	.kl-experiment-block,
	.kl-experiment-grid,
	.kl-experiment-card,
	.kl-post-pattern,
	.kl-pattern-panel,
	.kl-single-content .wp-block-post-content > .wp-block-table,
	.kl-post-boundary,
	.kl-author-archive-card,
	.kl-related-card,
	.kl-post-nav a,
	.kl-search-form .wp-block-search__inside-wrapper,
	.kl-comments-card {
		border-color: CanvasText;
		box-shadow: none;
	}

	.kl-header-search-toggle,
	.kl-header-search .wp-block-search__button,
	.kl-theme-toggle,
	.kl-header-cta,
	.kl-search-form .wp-block-search__button {
		border: 1px solid ButtonText;
	}

	.kl-experiment-card h3::before {
		border: 1px solid CanvasText;
		background: CanvasText;
		forced-color-adjust: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	body:not(.block-editor-iframe__body)::before {
		display: none;
	}

	.kl-brand,
	.kl-single-title,
	.wp-block-post-featured-image {
		view-transition-name: none !important;
	}

	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}

@page {
	margin: 0.75in;
}

@media print {
	:root,
	:root[data-kl-theme='dark'] {
		color-scheme: light;
		--kl-paper: #ffffff;
		--kl-oat: #ffffff;
		--kl-ink: #000000;
		--kl-muted: #333333;
		--kl-leaf: #000000;
		--kl-mint: #ffffff;
		--kl-tomato: #000000;
		--kl-tomato-readable: #000000;
		--kl-blue: #000000;
		--kl-lemon: #000000;
		--kl-lemon-readable: #000000;
		--kl-surface: #ffffff;
		--kl-surface-2: #ffffff;
		--kl-button-text: #000000;
		--kl-tomato-text: #000000;
		--kl-lemon-text: #000000;
		--kl-border: #999999;
		--kl-border-strong: #000000;
		--kl-shadow-soft: none;
		--kl-shadow-card: none;
		--kl-shadow: none;
		--kl-body-bg: none;
		--kl-header-bg: #ffffff;
		--kl-start-bg: none;
	}

	*,
	*::before,
	*::after {
		background: transparent !important;
		box-shadow: none !important;
		color: #000000 !important;
		text-shadow: none !important;
	}

	html {
		scroll-behavior: auto;
	}

	body {
		background: #ffffff !important;
		color: #000000 !important;
		font-size: 11pt;
		line-height: 1.5;
	}

	.kl-header-wrap,
	.kl-footer-wrap,
	.kl-breadcrumbs-wrap,
	.kl-post-nav,
	.kl-comments,
	.kl-header-actions,
	.kl-theme-toggle,
	.kl-header-search,
	.wp-block-post-featured-image {
		display: none !important;
	}

	.kl-main,
	.kl-shell,
	.kl-single-hero,
	.kl-single-content,
	.kl-single-content .wp-block-post-content,
	.kl-page-content {
		width: auto !important;
		max-width: none !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	.kl-single-title,
	.kl-page-title,
	.kl-archive-title {
		font-size: 24pt !important;
		line-height: 1.1;
	}

	.kl-reading-time,
	.kl-single-meta,
	.kl-author-line,
	.kl-post-boundary {
		border: 0 !important;
		padding: 0 !important;
	}

	.kl-toc,
	.kl-toc details,
	.kl-toc ol {
		display: block !important;
	}

	.kl-toc details:not([open]) > :not(summary) {
		display: block !important;
	}

	.kl-toc details {
		border: 1px solid #999999 !important;
		padding: 0.8rem !important;
	}

	.kl-single-content a[href]::after,
	.kl-page-content a[href]::after {
		content: ' [' attr(href) ']';
		font-size: 0.85em;
		overflow-wrap: anywhere;
	}

	.kl-single-content a[href^='#']::after,
	.kl-page-content a[href^='#']::after,
	.kl-single-content a[href^='mailto:']::after,
	.kl-page-content a[href^='mailto:']::after,
	.kl-single-content a[href^='tel:']::after,
	.kl-page-content a[href^='tel:']::after {
		content: '';
	}
}
