.ezechax-toc {
	box-sizing: border-box;
	margin: 0 0 2rem;
	padding: 1rem 1.1rem;
	border: 1px solid rgba(0, 0, 0, .12);
	border-radius: 8px;
	background: #fff;
}

.ezechax-toc,
.ezechax-toc * {
	box-sizing: border-box;
}

.ezechax-toc__title {
	margin: 0 0 .65rem;
	font-weight: 700;
}

.ezechax-toc__viewport {
	position: relative;
}

/*
 * Compact state (only when the TOC has more H2 sections than the configured limit).
 * The server writes an approximate height so the layout does not jump; the script then
 * replaces it with the exact height of the last normal H2 section.
 */
.ezechax-toc--clipped:not(.ezechax-toc--expanded) .ezechax-toc__viewport {
	max-height: var(--ezechax-toc-collapsed-height, none);
	overflow: hidden;
}

.ezechax-toc--clipped:not(.ezechax-toc--expanded) .ezechax-toc__viewport::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	height: 3.5rem;
	pointer-events: none;
	background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 92%);
}

/* H3 subsections stay out of the compact view and appear only after expansion (a toggle always exists in this case). */
.ezechax-toc--collapsible:not(.ezechax-toc--expanded) .ezechax-toc__sublist {
	display: none;
}

/* Keep semantic ordered lists while replacing numeric markers with a simple visual hierarchy. */
.ezechax-toc__list,
.ezechax-toc__sublist {
	margin: 0;
	padding-left: 0;
	list-style: none;
}

.ezechax-toc__sublist {
	margin: .25rem 0 .45rem 1.15rem;
}

.ezechax-toc__item {
	position: relative;
	margin: .25rem 0;
}

.ezechax-toc__item--h2 > a,
.ezechax-toc__item--h3 > a {
	display: inline;
}

.ezechax-toc__item--h2 > a::before {
	content: "›";
	display: inline-block;
	margin-right: .45rem;
	color: #8DD85E;
	font-weight: 700;
	font-size: 1.15em;
	line-height: 1;
}

.ezechax-toc__item--h3 > a::before {
	content: "•";
	display: inline-block;
	margin-right: .5rem;
	color: #8DD85E;
	font-size: .9em;
	line-height: 1;
}

.ezechax-toc a {
	color: #0A0B08;
	text-decoration: none;
}

.ezechax-toc a:hover,
.ezechax-toc a:focus {
	color: #6cc33c;
	text-decoration: underline;
}

.ezechax-toc__toggle {
	display: inline-block;
	margin-top: .85rem;
	padding: .55rem .8rem;
	border: 1px solid #8DD85E;
	border-radius: 5px;
	background: #8DD85E;
	color: #0A0B08;
	font: inherit;
	cursor: pointer;
}

.ezechax-toc__toggle:hover {
	background: #6cc33c;
	border-color: #6cc33c;
}

.ezechax-toc__toggle:focus-visible {
	outline: 2px solid #6cc33c;
	outline-offset: 2px;
}
