#preview {
	font-family: sans-serif;
		/* A clean, readable default font */
	line-height: 1.6;
		/* Improves readability of text blocks */
	color: #333;
		/* Dark grey for good contrast */;
}

#preview h1,
	#preview h2,
	#preview h3,
	#preview h4,
	#preview h5,
	#preview h6 {
	margin-top: 1em;
	margin-bottom: 0.5em;
	font-weight: bold;
	line-height: 1.2;
}

#preview h1 {
	font-size: 2em;
}

#preview h2 {
	font-size: 1.8em;
}

#preview h3 {
	font-size: 1.5em;
}

#preview h4 {
	font-size: 1.2em;
}

#preview h5 {
	font-size: 1em;
}

#preview h6 {
	font-size: 0.9em;
}

#preview p {
	margin-bottom: 1em;
}

#preview b,
	#preview strong {
	font-weight: bold;
}

#preview em,
	#preview i {
	font-style: italic;
}

#preview pre,
	#preview code {
	tab-size: 4;
	font-family: monospace;
		/* Monospaced font for code */
	padding: 0.5em;
	border-radius: 3px;
	overflow-x: auto;
		/* Enables horizontal scrolling for long code lines */;
}

#preview pre {
	margin-bottom: 1.2em;
	background-color: #ddefff;
		/* Light background for code blocks */;
}

#preview code {
	background-color: #dddddd;
}

#preview blockquote {
	margin: 1em 0;
	padding-left: 1em;
	border-left: 4px solid #ccc;
		/* Simple left border for blockquotes */
	color: #555;
	background: lightgray;
}

#preview ul,
	#preview ol {
	margin-bottom: 1em;
	padding-left: 3em;
		/* Indentation for list items */;
}

#preview li {
	margin-bottom: 0.5em;
}

#preview table {
	width: 100%;
	border-collapse: collapse;
		/* Removes space between table cells */
	margin-bottom: 1em;
}

#preview th,
	#preview td {
	border: 1px solid #ddd;
		/* Light borders for table cells */
	padding: 0.4em;
	text-align: left;
}

#preview th {
	background-color: #eee;
		/* Light background for table headers */
	font-weight: bold;
	text-align: center;
}

#preview figure {
	margin: 1em 0;
	text-align: center;
}

#preview img {
	max-width: 100%;
	height: auto;
	display: block;
	margin: 0 auto;
}

#preview figcaption {
	font-size: 0.9em;
	color: #777;
	margin-top: 0.5em;
}

#preview q {
	quotes: "“" "”" "‘" "’";
		/* Defines quotation marks for <q> */;
}

#preview q:before {
	content: open-quote;
}

#preview q:after {
	content: close-quote;
}

#preview var {
	font-family: serif;
	font-weight: 80;
	color: darkblue;
}

button {
	margin-top: 4px;
	margin-bottom: 4px;
}

.math-matrix {
	display: inline-table;
	border-collapse: collapse;
	margin: 0 6px;
	vertical-align: middle;
	font-style: normal;
}

.math-cell {
	padding: 4px 8px;
	text-align: center;
}

.math-parentheses {
	border-left: 2px solid black;
	border-right: 2px solid black;
	border-radius: 12px / 100%;
}

.math-brackets {
	border-left: 2px solid black;
	border-right: 2px solid black;
	position: relative;
}

.math-brackets::before, .math-brackets::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	height: 4px;
	border-left: 2px solid black;
	border-right: 2px solid black;
}

.math-brackets::before {
	top: 0;
}

.math-brackets::after {
	bottom: 0;
}

.sym span {
	font-size: 2.5em;
	vertical-align: middle;
	line-height: 1.8;
}

.sym sup,
	.sym sub {
	position: relative;
	margin-left: -1.0em;
	vertical-align: baseline;
}

.sym sup {
	font-size: smaller;
	top: -1.78em;
}

.sym sub {
	font-size: smaller;
	top: 1.85em;
}

.fraction {
	display: inline-block;
	vertical-align: middle;
	margin: 0 0.2em 0.4ex;
	text-align: center;
	& > span {
			display: block;
	padding-top: 0.15em;
}
		&span {
	&.fdn {
				border-top: thin solid black;
}
			&.bar {
	display: none;
}
		}
	}

span.frac {
	display: inline-block;
	text-align: center;
	vertical-align: middle;
}

span.frac > sup,
	span.frac > sub {
	display: block;
	font: inherit;
	padding: 0 0.3em;
}

span.frac > sup {
	border-bottom: 0.08em solid;
}

span.frac > span {
	display: none;
}

.math .frac {
	display: inline-flex;
	vertical-align: middle;
	flex-direction: column;
	text-align: center;
	margin-top: -1px;
}

.math .frac > *:first-child {
	border-bottom: 2px solid currentColor;
	padding-bottom: 5px;
}

.math .frac > *:last-child {
	padding-top: 5px;
}

.math .frac > * {
	padding: 0 0.5em;
}

.math .sqrt {
	border-top: 2px solid currentColor;
	margin-left: 10px;
	padding-left: 5px;
	position: relative;
	display: inline-block;
}

.math .sqrt::before {
	content: '';
	position: absolute;
	top: -2px;
	left: -10px;
	bottom: 0px;
	width: 10px;
	background: currentColor;
	clip-path: polygon(
    0 50%,
    2px 50%,
    50% calc(100% - 2px),
    calc(100% - 2px) 0,
    100% 0,
    100% 2px,
    calc(50% + 2px) 100%,
    calc(50% - 2px) 100%,
    0 calc(50% + 2px)
  );
}

.math .vmatrix {
	padding: 0 10px;
	position: relative;
	display: inline-block;
}

.math .vmatrix::before {
	content: '';
	width: 5px;
	position: absolute;
	top: 0px;
	left: 0px;
	bottom: 0px;
	border-left: 2px solid currentColor;
}

.math .vmatrix::after {
	content: '';
	width: 5px;
	position: absolute;
	top: 0px;
	right: 0px;
	bottom: 0px;
	border-right: 2px solid currentColor;
}

.math .surround {
	padding: 0 10px;
	position: relative;
	display: inline-block;
	--round: 0px;
	--off: 0;
}

.math .surround::before {
	content: '';
	width: 5px;
	position: absolute;
	top: 0px;
	left: var(--off);
	bottom: 0px;
	border-top: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	border-left: 2px solid currentColor;
	border-top-left-radius: var(--round);
	border-bottom-left-radius: var(--round);
}

.math .surround::after {
	content: '';
	width: 5px;
	position: absolute;
	top: 0px;
	right: var(--off);
	bottom: 0px;
	border-top: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	border-right: 2px solid currentColor;
	border-top-right-radius: var(--round);
	border-bottom-right-radius: var(--round);
}

.math .surround.round {
	--round: 10px 30px;
}

.math .surround.square {
	--round: 0;
}

.math .surround.curly {
	--round: 10px;
	--off: 5px;
	padding: 0 15px;
	background-image: linear-gradient(0deg, currentColor 25%, currentColor 25%),
    linear-gradient(0deg, currentColor 25%, currentColor 25%);
	background-repeat: no-repeat;
	background-size: 5px 2px;
	background-position: 0 center, 100% center;
}

.math .surround.sys {
	--round: 10px;
	--off: 5px;
	padding: 0 15px;
	background-image: linear-gradient(0deg, currentColor 25%, currentColor 25%);
	background-repeat: no-repeat;
	background-size: 5px 2px;
	background-position: 0 center;
}

.math .surround.sys::after {
	content: unset;
}

.math .cs {
	position: relative;
	display: inline-block;
}

.math .cs > sup {
	position: absolute;
	bottom: calc(100% - 5px);
	left: 50%;
	transform: translate(-50%);
	width: max-content;
}

.math .cs > sub {
	position: absolute;
	top: calc(100% - 0px);
	left: 50%;
	transform: translate(-50%);
	width: max-content;
}

.math .big {
	font-size: 3em;
	font-weight: 110;
}

.math .vector {
	position: relative;
	display: inline-block;
}

.math .vector::before {
	content: "\2192";
 /* Unicode for right arrow → */
	position: absolute;
	top: -0.6em;
       /* Adjust height above the letter */
	left: 0;
	width: 100%;
	font-size: 1em;
  /* Scales the arrow smaller */
	text-align: left;
}

.math .surround.vec {
	display: inline-flex;
	flex-direction: column;
	vertical-align: middle;
}

.math .matrix {
	display: inline-grid;
	grid-template-columns: repeat(var(--c), 1fr);
	grid-gap: 5px;
	padding: 5px 15px;
	vertical-align: middle;
}