body {
	margin: 0;
	font-family: var(--font);
	line-height: 1.5;
	color: var(--main-text);
	background-color: var(--main-bg);

	--font: Roboto, -apple-system, BlinkMacSystemFont, Segoe UI, Oxygen, Ubuntu,
		Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
	--header-font: Segoe UI, -apple-system, BlinkMacSystemFont, Ubuntu, Robot,
		Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
	--mono-font: Cascadia Mono, Consolas, Monaco, Menlo, monospace;

	--main-text: rgb(51, 51, 51);
	--main-bg: white;
	--main-border: rgb(200, 200, 200);
	--main-hover: rgb(247, 247, 247);

	--dim-text: rgb(60, 60, 60);
	--dim-bg: white;
	--dim-border: rgb(100, 100, 100);

	--panel-bg: rgb(153, 153, 153);
	--modal-bg: white;

	--input-bg: white;
	--input-border: rgb(100, 100, 100);
	--code-text: rgb(80, 80, 80);
	--code-bg: rgb(240, 240, 240);
	--preview-bg: rgb(249, 252, 255);
	--breadcrumb-text: rgb(99, 16, 16);
	--disabled-text: rgb(120, 120, 120);

	--link-text: rgb(32, 100, 163);
	--link-visited: rgb(51, 7, 77);
}

@media (prefers-color-scheme: dark) {
	body {
		--main-text: white;
		--main-bg: rgb(20, 20, 20);
		--main-border: rgb(60, 60, 60);
		--main-hover: rgb(45, 45, 45);

		--dim-text: rgb(200, 200, 200);
		--dim-bg: rgb(30, 30, 30);
		--dim-border: rgb(60, 60, 60);

		--panel-bg: rgb(30, 30, 30);
		--modal-bg: rgb(45, 45, 45);

		--input-bg: rgb(30, 30, 30);
		--input-border: rgb(60, 60, 60);
		--code-text: rgb(160, 160, 160);
		--code-bg: rgb(30, 30, 30);
		--preview-bg: rgb(30, 30, 60);
		--breadcrumb-text: rgb(131, 81, 81);
		--disabled-text: rgb(150, 150, 150);

		--link-text: rgb(110, 174, 235);
		--link-visited: rgb(134, 58, 179);
	}
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 0.5em 0;
	font-weight: 400;
	line-height: 1.2;
}

h1 {
	font-size: 2em;
}

a {
	color: inherit;
}

code {
	font-family: var(--mono-font);
	color: var(--code-text);
	background-color: var(--code-bg);
	border: 1px solid var(--main-border);
	padding: 0.2em 0.4em;
	border-radius: 4px;
}

.mono {
	font-family: var(--mono-font);
}

.table {
	display: grid;
	border-left: 1px solid var(--main-border);
	border-top: 1px solid var(--main-border);
	font-size: 110%;
}

.table .header {
	font-weight: bold;
}

.table > a {
	display: contents;
}

.table div {
	border-right: 1px solid var(--main-border);
	border-bottom: 1px solid var(--main-border);
	padding: 0.3em;
}

.table ul {
	margin: 0;
	padding: 0;
	list-style: inside circle;
}

.radio {
	display: flex;
	flex-direction: row;
}

.radio label {
	display: block;
	border: 1px solid var(--dim-border);
	background-color: var(--dim-bg);
	color: var(--dim-text);
	border-right: none;
	padding: 0.2em 0.5em;
	position: relative;
	overflow: hidden;
}

.radio input {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	display: block;
	width: 0;
	height: 0;
	margin: 0;
	padding: 0;
}

.radio label:hover {
	background-color: var(--main-hover);
}

.radio input:focus + label {
	background-color: rgb(232, 232, 255);
	border-color: rgb(113, 179, 255);
}

.radio label:active {
	background-color: rgb(196, 196, 255);
}

.radio input:checked + label {
	box-shadow: inset 3px 3px 5px 0px rgba(0, 0, 0, 0.17);
	background-color: rgb(93, 163, 255);
	color: white;
}

.radio input:focus {
	outline: none;
}

.radio label:first-of-type {
	margin-left: 0;
	border-top-left-radius: 5px;
	border-bottom-left-radius: 5px;
}

.radio label:last-of-type {
	border-right: 1px solid var(--dim-border);
	border-top-right-radius: 5px;
	border-bottom-right-radius: 5px;
}

.radio label::after {
	display: none;
	content: "";
	position: absolute;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, 0.3);

	width: 100px;
	height: 100px;
	margin-top: -50px;
	margin-left: -50px;

	/* Center the ripple */
	top: 50%;
	left: 50%;

	animation: ripple 1s;
	opacity: 0;
}

.radio input:focus:not(:active) + label::after {
	display: block;
}

.button {
	padding: 0.2em 0.5em;
	margin: 0.25em;
	background-color: var(--dim-bg);
	border: 1px solid var(--dim-border);
	border-radius: 5px;
	color: var(--dim-text);
	font: var(--header-font);
	font-size: 1rem;
	position: relative;
	overflow: hidden;
	display: inline-block;
	text-decoration: none;
}

.button:hover {
	background-color: rgb(93, 163, 255);
	border-color: rgb(30, 91, 170);
	color: white;
}

.button:focus {
	border-color: rgb(113, 179, 255);
	outline: none;
}

.button::after {
	display: none;
	content: "";
	position: absolute;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, 0.3);

	width: 100px;
	height: 100px;
	margin-top: -50px;
	margin-left: -50px;

	/* Center the ripple */
	top: 50%;
	left: 50%;

	animation: ripple 1s;
	opacity: 0;
}

.button:focus:not(:active)::after {
	display: block;
}

.button > .icon {
	transform: scale(75%);
}

@keyframes ripple {
	from {
		opacity: 1;
		transform: scale(0);
	}
	to {
		opacity: 0;
		transform: scale(10);
	}
}

.text-preview {
	border: 1px solid rgb(153, 197, 255);
	background-color: var(--preview-bg);
	border-radius: 3px;
	font-size: unset;
	font-family: var(--mono-font);
	white-space: pre-wrap;
	overflow-wrap: break-word;
	overflow-x: auto;
	padding: 0.5em;
}

.repr-box {
	display: inline-block;
	padding: 0.25em;
	border: 1px solid var(--main-border);
	font-family: var(--mono-font);
}
