.sh-toc {
	margin: 2em 0;
	padding: 1.5em 1.75em;
	border: 1px solid #d9d9d9;
	border-left: 4px solid #dd3333;
	border-radius: 4px;
	background: #f8f8f8;
	box-sizing: border-box;
}

.sh-toc-title {
	margin: 0 0 1em;
	padding-bottom: 0;
	border-bottom: none;
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.3;
	color: #1a1a1a;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.sh-toc-list {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: toc-main;
}

.sh-toc-sublist {
	margin: 0.35em 0 0.65em;
	padding-left: 0;
	list-style: none;
	counter-reset: toc-sub;
}

.sh-toc-list > .sh-toc-h1,
.sh-toc-list > .sh-toc-h2 {
	counter-increment: toc-main;
}

.sh-toc-sublist > .sh-toc-h2 {
	counter-increment: toc-sub;
}

.sh-toc-item {
	margin: 0;
	line-height: 1.45;
}

.sh-toc-item + .sh-toc-item {
	margin-top: 0.15em;
}

.sh-toc-link {
	display: flex;
	align-items: baseline;
	gap: 0.35em;
	padding: 0.5em 0.65em;
	text-decoration: none !important;
	border-bottom: none !important;
	box-shadow: none !important;
	border-radius: 3px;
	color: #1a1a1a;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.sh-toc-link:hover,
.sh-toc-link:focus,
.sh-toc-link:active,
.sh-toc-link:visited {
	text-decoration: none !important;
	border-bottom: none !important;
	box-shadow: none !important;
	outline: none;
}

.sh-toc-link::before {
	flex-shrink: 0;
	font-weight: 600;
	font-size: 0.88rem;
	color: #888;
	min-width: 1.5em;
}

.sh-toc-list > .sh-toc-h1 > .sh-toc-link::before,
.sh-toc-list > .sh-toc-h2 > .sh-toc-link::before {
	content: counter(toc-main) ".";
}

.sh-toc-sublist > .sh-toc-h2 > .sh-toc-link::before {
	content: counter(toc-main) "." counter(toc-sub);
}

.sh-toc-link-text {
	display: block;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sh-toc-h1 > .sh-toc-link {
	font-weight: 600;
	font-size: 0.98rem;
}

.sh-toc-h2 > .sh-toc-link {
	font-weight: 400;
	font-size: 0.92rem;
	color: #444;
	padding-left: 1.25em;
}

.sh-toc-link:hover,
.sh-toc-link:focus {
	color: #b32d2e;
	background: rgba(221, 51, 51, 0.06);
}

.sh-toc-link:hover::before,
.sh-toc-link:focus::before,
.sh-toc-link.is-active::before {
	color: #dd3333;
}

.sh-toc-link.is-active {
	color: #b32d2e;
	background: rgba(221, 51, 51, 0.1);
	font-weight: 600;
}

.sh-toc-h1 > .sh-toc-link.is-active {
	border-left: 3px solid #dd3333;
	padding-left: calc(0.65em - 3px);
}

.sh-toc-heading {
	scroll-margin-top: 220px;
}

@media (max-width: 768px) {
	.sh-toc {
		padding: 1.25em 1.15em;
	}

	.sh-toc-title {
		font-size: 0.98rem;
	}

	.sh-toc-h1 > .sh-toc-link {
		font-size: 0.95rem;
	}

	.sh-toc-h2 > .sh-toc-link {
		font-size: 0.9rem;
	}

	.sh-toc-heading {
		scroll-margin-top: 56px;
	}
}
