.ddoc > div:not(#categoryPanel) {
	min-width: 0;
}

.markdown pre {
	width: auto;
	max-width: 100%;
}

section.section:has(> div > h2 .contextLink) {
	border-top: 1px solid rgb(209 213 219);
	margin-top: 1.25rem;
	padding-top: 1.25rem;
}

.dark section.section:has(> div > h2 .contextLink) {
	border-color: rgb(55 65 81);
}

section.section:has(> div > h2 .contextLink):not(section.section:has(> div > h2 .contextLink) + *) {
	border-top: 3px solid rgb(156 163 175);
	margin-top: 2.5rem;
	padding-top: 1.5rem;
}

section.section:has(> div > h2 .contextLink):not(section.section:has(> div > h2 .contextLink) + *)::before {
	content: "Categories";
	display: block;
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 2rem;
	margin-bottom: 1.25rem;
}

.dark section.section:has(> div > h2 .contextLink):not(section.section:has(> div > h2 .contextLink) + *) {
	border-color: rgb(107 114 128);
}

.catNav summary {
	display: none;
}

.catToggle {
	display: none;
}

@media (width < 1024px) {
	.ddoc:has(#categoryPanel) {
		flex-direction: column;
		position: relative;
		padding: 0.5rem;
	}

	.ddoc:has(#categoryPanel) > div:not(#categoryPanel) {
		width: 100%;
		box-sizing: border-box;
		padding-left: 0.75rem;
		padding-right: 0.75rem;
	}

	#categoryPanel {
		display: block;
		position: static;
		width: 100%;
		height: auto;
		padding: 0;
		box-sizing: border-box;
	}

	.catNav > ul {
		position: absolute;
		top: 3.4rem;
		left: 0.75rem;
		right: 0.75rem;
		z-index: 40;
		display: flex;
		flex-wrap: wrap;
		gap: 0.5rem;
		padding: 0.75rem;
		border: 1px solid rgb(209 213 219);
		border-radius: 0.75rem;
		background: rgb(255 255 255);
		box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
	}

	.dark .catNav > ul {
		border-color: rgb(55 65 81);
		background: rgb(17 24 39);
	}

	.catNav > ul > li {
		white-space: nowrap;
	}

	#categoryPanel ul > :not([hidden]) ~ :not([hidden]) {
		margin-top: 0;
	}

	.catNav > ul a {
		display: inline-block;
		padding: 0.3rem 0.8rem;
		border: 1px solid rgb(209 213 219);
		border-radius: 9999px;
		font-size: 0.875rem;
	}

	.catNav > ul li.active a {
		background: rgb(229 231 235);
		font-weight: 600;
	}

	.dark .catNav > ul a {
		border-color: rgb(55 65 81);
	}

	.dark .catNav > ul li.active a {
		background: rgb(55 65 81);
	}

	.catToggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 2.4rem;
		height: 2.4rem;
		flex: 0 0 auto;
		border: 1px solid rgb(209 213 219);
		border-radius: 0.5rem;
		background: rgb(249 250 251);
		font-size: 1.2rem;
		line-height: 1;
		cursor: pointer;
	}

	.dark .catToggle {
		border-color: rgb(55 65 81);
		background: rgb(31 41 55);
		color: rgb(229 231 235);
	}

	#topnav {
		height: auto;
	}

	#topnav .h-full {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto auto;
		gap: 0.5rem;
		align-items: center;
	}

	#topnav .h-full > div:first-child {
		min-width: 0;
		overflow: hidden;
	}

	#topnav .breadcrumbs :is(li, a, ul, span) {
		font-size: 1.25rem;
	}

	#topnav .breadcrumbs {
		display: block;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	#topnav .breadcrumbs li,
	#topnav .breadcrumbs ul {
		display: inline;
	}

	#topnav .breadcrumbs span {
		display: inline-block;
		vertical-align: middle;
	}

	#searchbar {
		width: 6rem;
		min-width: 0;
	}

	.symbolTitle .break-all {
		word-break: normal;
		overflow-wrap: anywhere;
	}

	.markdown pre {
		margin-left: 0;
		margin-right: 0;
	}
}
