html {
	font-size: 16px;
	background-color: #f8f9fa;
}

body {
	font-weight: 400;
	font-size: 1em;
	color: #000;
	background-color: #fff;
	max-width: 950px;
	margin: 0 auto;
	padding: 0.5em 1.5em 2em 1.5em;
}

/* font families */

body, input[type=text], input[type=password], input[type=submit], .wikiheader h3 {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

h1, h2 {
	font-family: Georgia, serif;
}

pre, textarea {
	font-family: monospace;
}

/* links */

a {
	text-decoration: none;
}

a:link, a:visited, a:hover, a:active {
	color: #36c;
}

a:hover {
	text-decoration: underline;
}

.wikiheader h1 a {
	color: #000;
	text-decoration: none;
}

.wikitext a:visited, .wikipreview a:visited, .wikirc a:visited {
	color: #6b4ba1;
}

.wikitext a.wikipageedit, .wikipreview a.wikipageedit, .wikirc a.wikipageedit {
	color: #d73333;
}

/* lists */

dl, ol, ul {
	padding: 0;
}

ol, ul {
	margin: 0.5em 0 1em 1.5em;
}

dl {
	margin: 0.5em 0 1em 0;
}

dd {
	margin-left: 1.5em;
}

li ol, li ul {
	margin: 0 0 0 1.5em;
}

dd dl {
	margin: 0;
}

/* headings */

h1, h2, h3, h4, h5, h6 {
	line-height: 1.25;
}

h1, h2 {
	margin: 0.5em 0 0.5em 0;
}

h3, h4, h5, h6 {
	margin: 0.25em 0 0.25em 0;
}

h1 {
	font-weight: 400;
	font-size: 1.8em;
	border-bottom: 3px solid #c8ccd1;
}

h2 {
	font-weight: 400;
	font-size: 1.5em;
	border-bottom: 1px solid #c8ccd1;
}

h3 {
	font-size: 1.25em;
}

h4 {
	font-size: 1.125em;
}

h5 {
	font-size: 1em;
}

h6 {
	font-size: 1em;
	font-weight: normal;
}

/* horizontal lines */

hr {
	border: none;
	border-top: 1px dotted #72777d;
}

hr.wikilineheader, hr.wikilinefooter {
	border-top: 2px solid #72777d;
}

/* forms */

input[type=text], input[type=password], input[type=submit], textarea {
	-webkit-appearance: none !important;
	font-size: 1em;
	border: 1px solid #c8ccd1;
	border-radius: 2px;
}

input[type=text], input[type=password], input[type=submit] {
	padding: 0.1em 0.3em;
	max-width: 98%;
}

input[type=submit] {
	background-color: #36c;
	border: 1px solid #36c;
	color: #fff;
	text-decoration: none;
	cursor: pointer;
}

input[type=submit]:active {
	background-color: #2a4b8d;
	border: 1px solid #2a4b8d;
}

pre {
	background-color: #f8f9fa;
	border: 1px solid #c8ccd1;
	padding: 1em;
	overflow-x: auto;
	clear: both;
}

textarea {
	width: 98% !important;
	max-height: 400px;
	display: block;
	padding: 0.5em;
}

/* tables */

table.wikidiffold, table.wikidiffnew {
	background-color: #f8f9fa;
	margin: 0.5em 0;
	padding: 0.5em;
}

table.wikidiffold {
	border: 1px solid #fc3;
	border-left: 5px solid #fc3;
}

table.wikidiffnew {
	border: 1px solid #36c;
	border-left: 5px solid #36c;
}

.wikitext table, .wikipreview table {
	background-color: #f8f9fa;
	border: 1px solid #c8ccd1;
	border-collapse: collapse;
}

.wikitext th, .wikitext td, .wikipreview th, .wikipreview td {
	border: 1px solid #c8ccd1;
	padding: 0.3em 0.5em;
	overflow-wrap: break-word;
}

.wikitext th pre, .wikitext td pre, .wikipreview th pre, .wikipreview td pre {
	white-space: pre-wrap;
}

.wikitext tr:first-child, .wikitext tr:hover, .wikipreview tr:first-child, .wikipreview tr:hover {
	background-color: #eaecf0;
}

/* header */

.wikiheader {
	font-size: 0.9em;
}

.wikiheader h1, .wikiheader h3 {
	overflow-wrap: break-word;
}

.wikiheader h1 {
	font-size: 1.9rem;
	border-bottom: 0;
	margin: 0 0 0.15em 0;
}

.wikiheader h3 {
	font-size: 0.85rem;
	font-weight: 400;
	margin: 0.45em 0 0 0;
}

.wikiheader img {
	border: 0;
	margin-bottom: 0.5em;
}

/* body */

.wikibody {
	overflow-wrap: break-word;
}

.wikibody form {
	line-height: 2;
}

.wikibody img {
	max-width: 100%;
	max-height: 1440px;
}

.wikitext, .wikipreview {
	line-height: 1.6;
}

.wikipreview h2:first-child {
	margin-bottom: 0.5em;
}

.wikipreview h2:last-child {
	font-size: 1.2em;
	border-bottom: 0;
}

/* footer */

.wikifooter {
	font-size: 0.9em;
}

.wikifooter input[type=text], .wikifooter input[type=submit] {
	padding: 0.3em 0.5em;
	font-size: 1.05rem;
}

.wikifooter input[type=text] {
	margin: 0.3em 0;
}

.wikifooter input[type=submit] {
	background-color: #f8f9fa;
	border-color: #c8ccd1;
	color: #000;
	font-weight: 500;
	border-inline-start: 0;
}

.wikifooter input[type=submit]:active {
	background-color: #eaecf0;
}

/* dark mode */

@media (prefers-color-scheme: dark) {
	html {
		background-color: #101112; /* RGB 16, 17, 18 */
	}

	body {
		background-color: #202122;
		color: #f8f9fa;
	}

	/* links */

	a:link, a:visited, a:hover, a:active {
		color: #7faaff; /* HSB 220, 50%, 100% */
	}

	h1 a:link, h1 a:visited {
		color: #eaecf0;
	}

	.wikiheader h1 a {
		color: #f8f9fa;
	}

	.wikitext a:visited, .wikipreview a:visited, .wikirc a:visited {
		color: #b88ae6; /* HSB 270, 40%, 90% */
	}

	.wikitext a.wikipageedit, .wikipreview a.wikipageedit, .wikirc a.wikipageedit {
		color: #d96c6c; /* HSB 0, 50%, 85% */
	}

	/* headings */

	h1 {
		border-bottom: 3px solid #72777d;
	}

	h2 {
		border-bottom: 1px solid #72777d;
	}

	/* horizontal line */

	hr {
		border-top-color: #72777d;
	}

	/* forms */

	input[type=text], input[type=password], pre, textarea {
		background-color: #303132; /* RGB 48, 49, 50 */
		border: 1px solid #54595d;
		color: #fff;
	}

	input[type=submit], .wikifooter input[type=submit] {
		background-color: #2a4b8d;
		border: 1px solid #54595d;
		color: #fff;
	}

	.wikifooter input[type=submit] {
		border-inline-start: 0;
	}

	input[type=submit]:active, .wikifooter input[type=submit]:active {
		background-color: #202122;
	}

	/* tables */

	table.wikidiffold, table.wikidiffnew {
		background-color: #303132; /* RGB 48, 49, 50 */
	}

	table.wikidiffold {
		border-color: #edab00;
	}

	table.wikidiffnew {
		border-color: #447ff5;
	}

	.wikitext table, .wikipreview table {
		background-color: #303132; /* RGB 48, 49, 50 */
		border: 1px solid #72777d;
	}

	.wikitext th, .wikitext td, .wikipreview th, .wikipreview td {
		border: 1px solid #72777d;
	}

	.wikitext tr:first-child, .wikitext tr:hover, .wikipreview tr:first-child, .wikipreview tr:hover {
		color: #fff;
		background-color: #54595d;
	}
}

/* responsive */

@media screen and (max-width: 480px) and (orientation: portrait) {
	.wikiheader img, .wikifooter input[type=submit] {
		display: none;
	}
}

@media screen and (max-width: 768px) and (max-height: 1152px) and (orientation: portrait) {
	html {
		font-size: 20px;
	}

	body {	
		padding: 0.5em 1em 1.5em 1em;
	}

	table {
		word-break: break-all;
	}
}

@media screen and (max-width: 1152px) and (max-height: 768px) and (orientation: landscape) {
	html {
		font-size: 20px;
		text-size-adjust: none;
		-webkit-text-size-adjust: none;
	}
}
