.h1 {
	color: var(--sb-heading-color);
	font-weight: 400;
	font-size: 2.25em;
	margin-top: 0;
	margin-bottom: 0.88em;
	line-height: 1.11;
}

.h2,
h2[id="footnote-label"] {
	color: var(--sb-heading-color);
	font-weight: 400;
	font-size: 1.5em;
	margin-top: 2em;
	margin-bottom: 1em;
	line-height: 1.33;
}

.h3 {
	color: var(--sb-heading-color);
	font-weight: 400;
	font-size: 1.25em;
	margin-top: 1.6em;
	margin-bottom: 0.6em;
	line-height: 1.6;
}

.h4 {
	color: var(--sb-heading-color);
	font-weight: 400;
	margin-top: 1.5em;
	margin-bottom: 0.5em;
	line-height: 1.5;
}

.h5 {
	color: var(--sb-heading-color);
	font-weight: 400;
	margin-top: 1.33em;
	margin-bottom: 0.4em;
	line-height: 1.4;
}

.h6 {
	color: var(--sb-heading-color);
	font-weight: 400;
	margin-top: 1.2em;
	margin-bottom: 0.2em;
	line-height: 1.3;
}

:global(.sb-kbd) {
	border-radius: var(--sb-border-radius);
	border: 1px solid var(--sb-decoration-color);
	border-bottom-width: 3px;
	background: color-mix(in hsl, var(--sb-decoration-color) 10%, transparent);
	color: var(--sb-heading-color);
	padding: 0.1em 0.4em;
}

.a,
a[data-footnote-backref],
a[data-footnote-ref] {
	color: var(--sb-heading-color);
	text-decoration: none;
	box-shadow: var(--sb-link-underline-color) 0 -2px 0 0 inset;
	outline: none;

	&:hover,
	&:focus {
		box-shadow: var(--sb-link-underline-color) 0 -6px 0 0 inset;
	}
}

a[data-footnote-backref],
a[data-footnote-ref] {
	font-size: 0.8em;
}

.a-auto {
	color: inherit;
	text-decoration: none;
}

.p {
	margin: 1.25em 0;
	color: var(--sb-text-color);
}

.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
	& + .p,
	& + .ul,
	& + .ol {
		margin-top: 0;
	}
}

.hr {
	margin: 2rem 0;
	border-top: 1px solid
		color-mix(in hsl, var(--sb-decoration-color) 15%, transparent);
	color: transparent;
}

.ul {
	list-style-type: disc;
}

.ol {
	list-style-type: decimal;
}

.ul,
.ol {
	margin: 1.25em 0;
	padding-left: 1.625em;

	& .ul,
	& .ol {
		padding-left: 1.2em;
	}
}

.li {
	padding-left: 0.375em;
	margin: 0.5em 0;
	color: var(--sb-text-color);

	&::marker {
		font-weight: 400;
		color: var(--sb-decoration-color);
	}

	& .p,
	& .ul,
	& .ol {
		margin: 0.4em 0;
	}
}

.ul:global(.contains-task-list) {
	list-style: none;
	padding: 0;

	& .li > input:first-child {
		margin-right: 0.5em;
	}
}

.code {
	font-size: 0.9em;
	color: var(--sb-code-text-color);
	background: var(--sb-highlight-background-color);
	padding: 0.1em 0.3em;
	border-radius: var(--sb-border-radius);
	overflow-wrap: break-word;
}

.table td > .code {
	font-size: 1em;
}

.blockquote {
	border-left: 0.15em solid var(--sb-decoration-color);
	padding-left: 1em;
}

.custom-container {
	padding: 1em 1.25em;
	border-radius: var(--sb-border-radius);
	margin: 1.25em 0;

	& > span:first-child {
		text-transform: capitalize;
		font-family: var(--sb-font-headings);
		font-weight: 400;
		margin-bottom: 0.5em;
		line-height: 1.5;
		display: inline-block;

		& + .p,
		& + .ul,
		& + .ol {
			margin-top: 0;
		}
	}

	& > .p:first-child,
	& > .ul:first-child,
	& > .ol:first-child {
		margin-top: 0;
	}

	& > .p:last-child,
	& > .ul:last-child,
	& > .ol:last-child {
		margin-bottom: 0;
	}

	& > summary {
		text-transform: capitalize;
		font-family: var(--sb-font-headings);
		font-weight: 400;
		line-height: 1.5;
		cursor: var(--sb-button-cursor);
		user-select: none;

		& + .p,
		& + .ul,
		& + .ol {
			margin-top: 0.5em;
		}
	}

	&[data-custom-container="info"],
	&[data-custom-container="note"],
	&[data-custom-container="details"] {
		background: var(--sb-info-background-color);
		color: var(--sb-info-text-color);
	}

	&[data-custom-container="tip"] {
		background: var(--sb-tip-background-color);
		color: var(--sb-tip-text-color);
	}

	&[data-custom-container="important"] {
		background: var(--sb-important-background-color);
		color: var(--sb-important-text-color);
	}

	&[data-custom-container="warning"] {
		background: var(--sb-warning-background-color);
		color: var(--sb-warning-text-color);
	}

	&[data-custom-container="danger"],
	&[data-custom-container="caution"] {
		background: var(--sb-danger-background-color);
		color: var(--sb-danger-text-color);
	}
}

.table {
	overflow-x: auto;
	border-radius: var(--sb-border-radius);
	margin-top: 2em;
	margin-bottom: 2em;
	border: 1px solid
		color-mix(in hsl, var(--sb-decoration-color) 10%, transparent);

	& > table {
		width: 100%;
		table-layout: auto;
		text-align: left;
		font-size: 0.875em;
		line-height: 1.7;
		border-collapse: collapse;

		& > thead {
			color: var(--sb-heading-color);
			font-family: var(--sb-font-headings);
			background: color-mix(
				in hsl,
				var(--sb-background-color) 70%,
				var(--sb-tint-color)
			);
			border: 1px solid
				color-mix(in hsl, var(--sb-decoration-color) 10%, transparent);
			border-bottom: none;
			border-top: none;
		}

		td:not(:last-child),
		th:not(:last-child) {
			border-right: 1px solid
				color-mix(in hsl, var(--sb-decoration-color) 10%, transparent);
		}

		& tr {
			color: var(--sb-text-color);

			& > * {
				padding: 0.5rem 0.75rem;
			}
		}

		& > tbody tr {
			border: 1px solid
				color-mix(in hsl, var(--sb-decoration-color) 10%, transparent);
			border-top: none;

			html[data-theme*="light"] & {
				background: color-mix(
					in hsl,
					var(--sb-background-color) 97%,
					var(--sb-tint-color-opposite)
				);
			}

			&:last-child {
				border-bottom: none;
			}
		}
	}
}

.tabs-container {
	margin: 1.5rem 0;
	width: 100%;
	display: flex;
	flex-direction: column;
}

.tabs-list {
	position: relative;
	display: flex;

	border-top-left-radius: var(--sb-border-radius);
	border-top-right-radius: var(--sb-border-radius);
	border: 1.5px solid var(--sb-code-background-color);
	border-bottom: 1.5px solid
		color-mix(
			in hsl,
			var(--sb-code-background-color) 95%,
			var(--sb-tint-color-opposite)
		);
}

.tabs-indicator {
	background: var(--sb-code-background-color);
	transition: transform 150ms, width 50ms;
	z-index: 1;
	overflow: hidden;
}

.tabs-trigger {
	appearance: none;
	outline: none;
	background: none;
	border: none;
	padding: 5.5px 16px;
	z-index: 2;
	position: relative;
	overflow: hidden;
	border-top-right-radius: calc(var(--sb-border-radius) - 1.5px);
	border-top-left-radius: calc(var(--sb-border-radius) - 1.5px);
	cursor: var(--sb-button-cursor);
	font-family: var(--sb-font-mono);
	font-size: 0.9rem;
	transition: background-color 150ms, border 150ms;
	color: color-mix(in hsl, var(--sb-text-color) 75%, transparent);

	&[data-selected],
	&:hover,
	&:focus {
		color: var(--sb-text-color);
		background: color-mix(
			in hsl,
			var(--sb-code-background-color) 75%,
			transparent
		);
	}

	&[data-selected] {
		background: var(--sb-code-background-color);

		&::before {
			content: "";
			height: 100%;
			width: 100%;
			inset: 0;
			position: absolute;
			border-top: 1.5px solid var(--sb-active-link-color);
		}
	}
}

.tabs-content {
	&[data-selected] {
		display: block;
	}

	display: none;

	:global(.expressive-code) {
		margin: 0;

		figure pre {
			border-top-right-radius: 0;
			border-top-left-radius: 0;
		}
	}

	&:not(:has(figure)) {
		border-bottom-left-radius: var(--sb-border-radius);
		border-bottom-right-radius: var(--sb-border-radius);
		border: 1.5px solid var(--sb-code-background-color);
		padding: 0 1.25rem;
	}
}

.steps {
	counter-reset: step;
	border: 0 solid;
	border-left-width: 1px;
	border-color: var(--sb-code-background-color);
	margin-left: 1rem;
	padding-left: 1.75rem;
	position: relative;
}

.step {
	&:before {
		background-color: var(--sb-code-background-color);
		color: var(--sb-text-color);
		content: counter(step);
		counter-increment: step;
		border-radius: 9999px;
		justify-content: center;
		align-items: center;
		width: 2rem;
		height: 2rem;
		font-size: 0.875rem;
		line-height: 1.25rem;
		display: flex;
		position: absolute;
		left: -1rem;
	}
}
