@font-face {
	font-family: 'Merienda';
	src: local('Merienda'),
		url('Merienda-Regular.woff') format('woff');
}
@font-face {
	font-family: 'Merienda';
	font-weight: bold;
	src: local('Merienda Bold'),
		url('Merienda-Bold.woff') format('woff');
}
@font-face {
	font-family: 'Noto Sans';
	src: local('Noto Sans'),
		url('NotoSans-Regular.woff') format('woff');
}
@font-face {
	font-family: 'Noto Sans';
	font-weight: bold;
	src: local('Noto Sans Bold'),
		url('NotoSans-Bold.woff') format('woff');
}
@font-face {
	font-family: 'Noto Sans';
	font-style: italic;
	src: local('Noto Sans Italic'),
		url('NotoSans-Italic.woff') format('woff');
}
@font-face {
	font-family: 'Noto Serif';
	src: local('Noto Serif'),
		url('NotoSerif-Regular.woff') format('woff');
}
@font-face {
	font-family: 'Noto Serif';
	font-weight: bold;
	src: local('Noto Serif Bold'),
		url('NotoSerif-Bold.woff') format('woff');
}
@font-face {
	font-family: 'Noto Serif';
	font-style: italic;
	src: local('Noto Serif Italic'),
		url('NotoSerif-Italic.woff') format('woff');
}


/*** BASICS ***/

* {
	box-sizing: border-box; /* includes the padding and border in an element's total width and height */
}
header, section, footer, aside, nav, main, article, figure {
    display: block; /* for older browsers */
}

[hidden], .hidden {
	display: none !important;
}
p {
	display: inline-block;
	margin: 0 1em 1em 0;
}
p.block, span.block {
	display: block;
	margin-right: 0;
}
p.multiline {
	/* vertical-align: -1em; */
}
p + p, p.success, p.error {
	/* margin-top: .25rem; */
}
span {
	display: inline;
	font-style: normal;
}
b, .strong {
	font-weight: bold;
}
i, .italic {
	font-style: italic;
}
u {
	text-decoration: underline;
}
.dim {
	opacity: .7;
}
.center {
	text-align: center;
}
h1, h2, h3, h4, h5, h6 {
	margin: 0 0 .75em 0;
	color: #024;
}
h1 {
	font-size: 2rem;
}
h2 {
	font-size: 1.5rem;
}
h3, h4 {
	font-size: 1.25rem;
}
h5, h6 {
	font-size: .8rem;
}
sup {
	font-size: .75em;
}
hr {
	border: none;
	border-top: thin solid #666;
	margin: .5em 0;
}

.success {
	font-style: italic;
	color: #060;
}
.error {
	font-style: italic;
	color: #900;
}
.info {
	color: #333;
	font-size: .8rem;
	/* line-height: 1.2; */
}
.floatRight {
	float: right;
	margin-left: 1em;
	margin-right: 0;
}
p[title] {
	cursor: help;
}
p[title]::after {
	content: "";
	display: inline-block;
	width: 1em;
	height: 1em;
	background-image: url("info_icon.png");
	background-size: 1em 1em;
	margin-left: .5em;
}

.preline p, .preline span {
	white-space: pre-line;
}
.justify p, .justify span {
	text-align: justify;
}
.nowrap {
	white-space: nowrap;
}

body {
	min-width: 30em;
	width: 100%;
	max-width: 60em;
	margin: 0 auto;
	background: #EEE;
	font: 1em/1.375 'Noto Sans', sans-serif;
}


/*** BIG AREAS ***/

header {
	position: relative;
	margin: 0 auto 1em auto;
	padding: 2px 2px 0 2px;
	max-width: 60em;
}
main {
	position: relative;
	min-height: 20em;
	padding: 1em;
	margin: 0 auto;
	clear: both;
	background: #FFF;
}
main > :last-child {
	margin-bottom: 0;
}
footer {
	margin: 1em auto;
	padding: 0 2px;
	max-width: 60em;
}

#header img {
	position: absolute;
	max-height: 50px;
	max-width: 25%;
}
#header h1 {
	max-width: calc(100% - 20rem);
	margin: 0 auto;
	padding: .5rem 0 .75rem 0;
	text-align: center;
	font: bold 3rem/1 Merienda, serif;
}
#header h2 {
	float: right;
	margin: -2.75em 0 0 0;
	border: medium solid #900;
	padding: 0 .25em;
	color: #600;
	text-align: center;
	line-height: 1.1;
}
#header a {
	color: #024;
	text-decoration: none !important;
}

section {
	margin: 0 0 2em 0;
}
article {
	margin: 0 0 1.5em 0;
}
article:last-of-type {
	margin-bottom: .5em;
}
section h2, section h3, section h4, section ol, section p, section ul {
	display: block;
	margin: 0 0 .5rem 0;
	padding: 0;
}
section ol, section ul {
	padding-left: 2em;
}

.buttonBar {
	display: flex;
	flex-flow: row wrap;
	align-items: center;
	gap: 1em;
}
.buttonBar > *, .buttonGroup > * {
	margin: 0;
}
.buttonBar .flexEnd {
	margin-left: auto;
}
.buttonGroup {
	display: flex;
	align-items: center;
}
.buttonGroup > a + *, .buttonGroup > button + * {
	border-left: none;
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
}
.buttonGroup > :not(:last-child) {
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}

.gridLayout {
	display: grid;
	grid-template-columns: repeat(12, auto);
	gap: 1em 3em;
	align-items: baseline;
}

.gridLayout > .colSpan-2, .child-colSpan-2 > * {
	grid-column: span 2 / span 2;
}
.gridLayout > .colSpan-3, .child-colSpan-3 > * {
	grid-column: span 3 / span 3;
}
.gridLayout > .colSpan-4, .child-colSpan-4 > * {
	grid-column: span 4 / span 4;
}
.gridLayout > .colSpan-5, .child-colSpan-5 > * {
	grid-column: span 5 / span 5;
}
.gridLayout > .colSpan-6, .child-colSpan-6 > * {
	grid-column: span 6 / span 6;
}
.gridLayout > .colSpan-8, .child-colSpan-8 > * {
	grid-column: span 8 / span 8;
}
.gridLayout > .colSpan-10, .child-colSpan-10 > * {
	grid-column: span 10 / span 10;
}
.gridLayout > .colSpan-12, .child-colSpan-12 > * {
	grid-column: span 12 / span 12;
}
.gridLayout > .colStart-auto {
	grid-column-start: auto;
}
.gridLayout > .colStart-1 {
	grid-column-start: 1;
}
.gridLayout > .colStart-2 {
	grid-column-start: 2;
}
.gridLayout > .colStart-3 {
	grid-column-start: 3;
}
.gridLayout > .colEnd-auto {
	grid-column-end: auto;
}
.gridLayout > .colEnd-1 {
	grid-column-end: -1;
}
.gridLayout > .colEnd-2 {
	grid-column-end: -2;
}
.gridLayout > .rowSpan-2 {
	grid-row: span 2 / span 2;
}
.gridLayout > .rowSpan-3 {
	grid-row: span 3 / span 3;
}


/*** NAVIGATION + BUTTONS ***/

a {
	color: #048;
	text-decoration: none;
	/* white-space: nowrap; */
	cursor: pointer;
}
a:active, a:focus, a:hover {
	color: #024;
	text-decoration: underline;
}

nav a, .navButton {
	display: inline-block;
	border: thin solid #024;
	border-radius: .5em;
	padding: .5em .75em;
	background: linear-gradient(#05A, #048);
	color: #FFF;
	font: inherit;
	line-height: 1.125;
	white-space: nowrap;
}
nav a:active, nav a:focus, nav a:hover,
.navButton:active, .navButton:focus, .navButton:hover {
	text-decoration: none;
	color: #FFF;
	background: linear-gradient(#048, #05A);
}
nav a.current, .navButton.current {
	background: linear-gradient(#036, #024) !important;
	font-weight: bold;
}

.navDropdown {
	position: relative;
	width: 12.5em;
	text-align: center;
	cursor: default;
}
.navDropdown:active, .navDropdown:focus-within, .navDropdown:hover {
	border-bottom-right-radius: 0 !important;
}
.navDropdown:active .navSubmenu, .navDropdown:focus-within .navSubmenu, .navDropdown:hover .navSubmenu {
	display: block;
}
.navSubmenu {
	position: absolute;
	top: 2.125em;
	left: -1px;
	display: none;
	width: calc(100% + 2px);
	z-index: 50;
	margin: 0;
	border: none;
	border-radius: 0;
	padding: 0;
	list-style: none;
}
.navSubmenu a {
	width: 100%;
	margin: 0 0 -1px 0;
	border-radius: 0;
	padding: .5em;
}
.navSubmenu a:last-child {
	border-bottom-left-radius: .5em;
	border-bottom-right-radius: .5em;
}

button, .button {
	display: inline-block;
	margin: 0 1rem 1rem 0;
	border: thin solid #777;
	border-radius: .5em;
	padding: .5em .75em;
	background: #DDD;
	color: #000;
	font: inherit;
	line-height: 1.125;
	white-space: nowrap;
	cursor: pointer;
}
button:active, button:focus, button:hover,
.button:active, .button:focus, .button:hover {
	border-color: #048;
	background: #EEE;
	color: #024;
	text-decoration: none;
}

.mainButton {
	box-shadow: 0 0 .25em 0 #048 inset;
}
.smallButton {
	font-size: .8rem;
	line-height: 1.1875;
}
.roundButton {
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 50%;
	padding: 0 0 .2rem 0;
	vertical-align: middle;
	font-size: 1.5rem;
	line-height: 1;
}
.roundButton img {
	width: .75rem;
	height: .75rem;
	margin: 0 !important;
}
.cancelButton:active, .cancelButton:focus, .cancelButton:hover {
	border-color: #900;
	color: #600;
}
.buttons .left {
	margin-right: -1px !important;
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}
.buttons .center {
	margin-left: 0 !important;
	margin-right: -1px !important;
	border-radius: 0;
}
.buttons .right {
	margin-left: 0 !important;
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
}

a.icon::after, table a[class]::after, #derivSelection p::before {
	content: "";
	display: inline-block;
	width: 1em;
	height: 1em;
	background: none;
	background-size: contain;
	margin: 0 .125rem 0 .375rem;
	vertical-align: -2px;
}
a:active::after, a:focus::after, a:hover::after {
	-webkit-filter: brightness(50%);
	filter: brightness(50%);
}
a[download]::after {
	background-image: url("download_icon.png");
}
a[href^=mailto]::after {
	background-image: url("mail_icon.png");
}
a[title*=external]::after {
	background-image: url("goto_icon.png");
}
table a.calc::after {
	background-image: url("calc_icon.png");
}
table a.edit::after {
	background-image: url("edit_icon.png");
}
table a.goto::after {
	background-image: url("goto_icon.png");
}
#derivSelection p::before {
	background-image: url("derivative_icon.png");
	margin: 0 .5rem 0 0;
}
table a[class]::after, #derivSelection p::before {
	width: .75rem;
	height: .75rem;
	vertical-align: -1px;
}


/*** SPECIALS ***/

input {
	accent-color: #05A;
}
input[type=checkbox], input[type=radio] {
	font-size: inherit;
	margin: .25em;
}
select .default {
	font-weight: bold;
}

details {
	margin: 0 0 1em 0;
}
details summary {
	max-width: 20em;
	margin-bottom: .25em;
	color: #05A;
	cursor: default;
}
details summary:active, details summary:hover {
	color: #036;
}

object, #fallback {
	display: block;
	min-width: 25em;
	width: 100%;
	min-height: 20em;
	height: calc(100vh - 16.5em);
	margin: 0 0 1.5em 0;
}
#fallback {
	resize: none;
	/* height: calc(100vh - 22.4rem); */
}
#popup object, #popup #fallback {
	height: calc(100vh - 21.5rem);
}

#currentUser span {
	height: 2.375rem;
	margin: 0 1em;
	text-align: right;
	font-size: .8rem;
}
#header > .navButton {
	margin-top: 5px;
}
#noscript, .warning {
	clear: both;
	width: max-content;
	max-width: 40rem;
	margin: .75rem auto;
	border: thin solid #900;
	padding: .25rem .5rem;
	text-align: center;
	font-size: .8rem;
}
#contents {
	position: sticky;
	top: 1em;
	float: right;
	margin: 0 0 1em 2em;
	border: thin solid #666;
	border-radius: .5em;
	padding: .5em .75em;
	color: #333;
	background-color: #FFF;
	box-shadow: 0 0 2em 1em #FFF;
}
#contents ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

#popup {
	position: fixed;
	top: 7.5em;
	width: 100vw;
	max-width: 60em;
	min-height: 20em;
	padding: 1em;
	border: thin solid #333;
	background: #FFF;
	box-shadow: 0 0 2em .5em #333;
	z-index: 50;
}
/* #popup::backdrop { */
	/* position: absolute; */
	/* max-width: 60em; */
	/* margin: 7.6em auto; */
	/* height: calc(100% - 2.15em); */
/* } */
#popup .background {
	position: fixed;
	z-index: -20;
	top: 7em;
	left: 0;
	width: 100vw;
	height: calc(100vh - 10em);
}
#popup > :last-child {
	margin-bottom: 0;
}

#usersTable + #popup {
	position: fixed;
	min-height: 30em;
	max-height: calc(100vh - 7.4em);
	margin-left: -1em;
	overflow: auto;
}

#sponsors {
	padding: .75em 0 0 0;
	text-align: center;
}
#sponsors p {
	display: block;
	margin: -.75rem 0 0 0;
}
.sponsor {
	display: inline-block;
	width: calc(25% - 4em);
	margin: 2em;
	vertical-align: baseline;
}
.sponsor img {
	max-width: 100%;
	max-height: 8em;
	margin-bottom: 1em;
}
.sponsor a {
	display: inline-block;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	color: #000;
}

#visitors {
	width: 100%;
	margin: .25rem 0 .75rem 0;
	border-collapse: collapse;
	overflow: hidden;
	font-size: .8em;
}
#visitors th, #visitors td {
	position: relative;
	padding: .25em;
}
#visitors thead th {
	min-width: 3em;
	padding-left: .75em;
	writing-mode: vertical-lr;
	writing-mode: sideways-lr;
}
#visitors thead tr > :last-child {
	padding-left: 1.5em;
}
#visitors tr > :first-child {
	min-width: 5em;
	text-align: left;
}
#visitors tbody td {
	text-align: center;
}
#visitors tr > :nth-last-child(2) {
	font-style: italic;
}
#visitors tr > :last-child {
	min-width: 5em;
	font-style: italic;
	font-weight: bold;
}
#visitors tbody tr:hover {
	background: rgba(0,0,0,.2);
}
#visitors td:hover::after, #visitors th:not(:first-child):hover::after {
	content: "";
	position: absolute;
	background-color: rgba(0,0,0,.2);
	left: 0;
	top: -5000px;
	height: 10000px;
	width: 100%;
	pointer-events: none;
}
#visitors td:hover {
	background: #FFF;
}

ul.downloads {
	list-style: none;
	line-height: 1.5;
}
.pgpKey {
	display: inline-block;
	margin-left: 1rem;
	padding: 2px;
	line-height: 0;
}
.pgpKey img {
	width: 1em;
	height: 1em;
}
.pgpKey:active img, .pgpKey:focus img, .pgpKey:hover img {
	-webkit-filter: brightness(50%);
	filter: brightness(50%);
}

#video-container {
	position: relative;
	overflow: hidden;
	line-height: 0;
}
video {
	max-width: 100%;
	max-height: 40em;
	transform: none !important;
}
#qrScan #video-container .scan-region-highlight {
	outline: rgba(0, 0, 0, .25) solid 50vmax;
	transform: none !important;
}
#qrScan #video-container .scan-region-highlight svg {
	display: none;
}

#calculateConstants section h4 {
	position: sticky;
	top: -1em;
	background: #FFF;
	margin: 0;
	padding: 1em 0;
	z-index: 5;
}
#calculateConstants .dialogToggle {
	justify-content: center;
}


/* MEDIA QUERIES */

@media screen {
	.onlyPrint {
		display: none !important;
	}
}

@media screen and (max-width: 40em) {
	header {
		padding: 0;
	}
	header .buttonBar, footer {
		gap: .5em;
		background: linear-gradient(170deg, #06C, #05A);
		margin-bottom: 0;
		/* justify-content: center; */
	}
	header .buttonGroup, footer .buttonGroup {
		flex-wrap: wrap;
	}
	header .buttonBar > .flexEnd, footer > .flexEnd {
		/* margin-left: 0 !important; */
	}
	header nav a, header .navButton, footer .navButton {
		min-height: 2rem;
		padding: .625em .75em;
		background: none;
		border: none;
		border-radius: 0 !important;
	}
	#header a {
		color: #036;
	}
	#currentUser span {
		color: #FFF;
	}
	.navSubmenu {
		background: linear-gradient(#05A, #06C);
	}
	
	.gridLayout {
		grid-template-columns: repeat(6, 1fr) !important;
		justify-content: stretch;
		gap: 1.5em 4em;
	}
	.gridLayout > .colSpan-4, .child-colSpan-4 > *,
	.gridLayout > .colSpan-5, .child-colSpan-5 > *,
	.gridLayout > .colSpan-6, .child-colSpan-6 > *,
	.gridLayout > .colSpan-8, .child-colSpan-8 > *,
	.gridLayout > .colSpan-10, .child-colSpan-10 > *,
	.gridLayout > .colSpan-12, .child-colSpan-12 > * {
		grid-column: 1 / -1;
	}
	.gridLayout > .colSpan-2, .child-colSpan-2 > * {
		grid-column: span 3 / span 3;
	}
	.gridLayout > .colSpan-3, .child-colSpan-3 > * {
		grid-column: span 3 / span 3;
	}
	.gridLayout > .colStart-1,
	.gridLayout > .colStart-2,
	.gridLayout > .colStart-3 {
		grid-column-start: 1;
	}
	.gridLayout > .colEnd-1,
	.gridLayout > .colEnd-2,
	.gridLayout > .colEnd-auto {
		grid-column-end: -1;
	}
	.gridLayout > .rowSpan-2 {
		grid-row: span 2 / span 2;
	}
	.gridLayout > .rowSpan-3 {
		grid-row: span 3 / span 3;
	}
	.roundButton {
		width: 2rem;
		height: 2rem;
		font-size: 1.75rem;
	}
}

@media screen and (max-width: 50em) {
	.gridLayout {
		grid-template-columns: repeat(10, auto);
	}
}

@media screen and (min-width: 100em) {
	body, header, footer, #popup {
		max-width: 75em;
	}
	.gridLayout {
		grid-template-columns: repeat(12, 1fr);
		column-gap: 6em;
	}
}

@media print {
	body {
		background: #FFF;
		font: 1em/1.4 'Noto Serif', serif;
	}
	main {
		padding: 0;
		font-size: .8rem;
		line-height: 1.4;
	}
	
	#header h1 {
		font-size: 2rem;
		padding: 0;
	}
	.buttonBar, .buttonGroup, .dontPrint {
		display: none !important;
	}
	
	form legend {
		margin: 0 auto !important;
	}
	fieldset {
		box-shadow: none !important;
	}
	form .gridLayout {
		row-gap: .9em !important;
	}
	form input, form select {
		background: inherit !important;
		border-color: #CCC !important;
		border-top: none !important;
		border-left: none !important;
		border-right: none !important;
	}
}
