body {
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 1em;
}

header {
	display: flex;
}

div.horizontal {
	display: flex;
	flex-wrap: wrap;
}

output {
	display: flex;
	flex-direction: row;
	flex: 1 1 12em;
	align-items: center;
	white-space: nowrap;
	font-family: "Times New Roman", Times, serif;
}

span.frac {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	margin-left: 0.3em;
	white-space: nowrap;
}

#library .frac {
	margin-left: auto; /* right justfity */
}

span.frac > span {
	text-align: center;
}

span.frac>span:not(:first-child) {
	border-top-width: 1px;
	border-top-style: solid;
}


ul.vert {
	list-style-type: none;
	padding: 0;
	margin: 0.2em;
	flex: 1 0 18em;
	max-width: 48em;
	background-color: whitesmoke;
}

.vert > li {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	margin: 0.8em 0.5em;
}

li > * { /* flex items */
	margin: 0em 0.1em;
}

li > label {
	flex: 0 1 12em; /* max width */
	position: relative; /* to make popup position work */
}

li > input {
	font-size: 1em;
	flex: 1 1 12em;
	min-width: 0em;
	width: 1em;
}

li.tall {
	height: 4em;
}

output var, #consistent var {
	font-style: normal; /* don't italicize units */
}

textarea {
	flex: 1;
	font-size: 1em;
	resize: none;
	min-width: 3em;
}

.error {
	background-color: #fbd0d0;
}

.inline-example {
	font-weight: bold;
	white-space: nowrap;
}

.button-bar {
	display: flex;
	flex: 2;
	flex-wrap: wrap;
	justify-content: flex-end;
}

button {
	background-color: green;
	color: white;
	padding: 0.2em;
	font-size: 0.7em;
	border-style: solid;
	border-color: green;
	transition: border-color 0.4s;
}

button:hover {
	border-color: black;
}
button:active {
	background-color: white;
	color: black;
}

.button-bar button {
	width: 4em;
	margin: 0.2em;
	border-radius: 1em;
}

#conversion button {
	border-radius: 50%;
	flex: 0 0 2em;
	font-size: 1.5em;
	height: 2em;
	width: 2em;
	display: flex;
	justify-content: center;
	align-items: center;
}


label .popup {
	visibility: hidden;
	background-color: #555;
	color: #fff;
	border-radius: 3px;
	padding: 2px;
	font-size: 0.7em;
	text-align: center;
	width: 100%;
	position: absolute;
	z-index: 1;
	bottom: 105%;
	left: 100%;
}

label .popup::after { /* little arrow under popup */
	content: "";
	position: absolute;
	top: 100%;
	left: 20%;
	margin-left: -5px;
	border-width: 5px;
	border-style: solid;
	border-color: #555 transparent transparent transparent;
}

.popup.show {
	visibility: visible;
	animation: fadeIn 0.5s;
}

a.ref { /* link to reference */
	font-size: 0.5em;
	font-weight: normal;
	vertical-align: top;
}

@keyframes fadeIn {
	from {opacity: 0;}
	to {opacity: 1;}
}

#library h3 { text-transform: capitalize; }

@media (prefers-color-scheme: dark) {
	body { background: black; color:  #ddd; }
	ul.vert { background-color: #222; }
	a { color: lightblue; }
	input,textarea {
		background-color: #333;
		color: #ddd;
		border-style: solid;
		border-color: #555;
	}
	button:hover {
		border-color: #888;
	}
	button:active {
		background-color: #888;
	}
	.error {
		background-color: #800;
		color: #ddd;
	}
	label .popup {
		background-color: #bbb;
		color: #222;
	}
	label .popup::after {
		border-color: #bbb transparent transparent transparent;
	}
}
/* vim: set ts=4 noexpandtab :*/
