*,
*:before,
*:after {
	box-sizing: border-box;
}

:root {
	--gray50: #FAFAFA;
	--gray100: #F5F5F5;
	--gray200: #EEEEEE;
	--gray300: #E0E0E0;
	--gray400: #BDBDBD;

	--red100: #FFCDD2;
	--red200: #EF9A9A;
	--red300: #E57373;
	--red400: #EF5350;

	--green50: #E8F5E9;
	--green100: #C8E6C9;
	--green200: #A5D6A7;
	--green300: #81C784;

	--blue400: #42A5F5;
	--blue500: #2196F3;
	--blue600: #1E88E5;
	--blue700: #1976D2;
	--blue800: #1565C0;
	--blue900: #0D47A1;
}

@font-face {
	font-family: 'Univers';
	font-style: normal;
	font-weight: 500;
	src: url('/Univers-regular.woff');
}

@font-face {
	font-family: 'Univers';
	font-style: normal;
	font-weight: 600;
	src: url('/Univers-medium.woff');
}

@font-face {
	font-family: 'Univers';
	font-style: normal;
	font-weight: 700;
	src: url('/Univers-bold.woff');
}

body {
	font-family: 'Univers', 'Roboto', sans-serif;
	font-size: 16px;

	margin: 0;
	padding: 0;

	background-color: var(--gray);
}

p, h1, h2, h3, h4, h5, h6, button, input {
	margin: 0;
	padding: 0;
	font-family: inherit;
}

strong {
	font-weight: 600;
}

select {
	font-family: inherit;
	font-size: 100%;
}

a, a:visited {
	text-decoration: none;
}

button {
	background: none;
	border: none;
	outline: none;
	cursor: pointer;
	color: inherit;
	font-size: inherit;
	font-weight: inherit;
	font-family: inherit;
	padding: 0.25em;
	border: 1px solid var(--gray400);
}

label, button {
	display: block;
	width: 100%;
}

img {
	display: block;
	object-fit: contain;
	max-width: 100%;
}

#logo a {
	color: var(--blue400);
}

#logo a span {
	color: var(--blue700);
}

#lead {
	display: flex;
	flex-direction: column;
	gap: 2em;
}

#lead button, #lead > #logo {
	font-size: 200%;
	text-align: center;
}

#lead > div:nth-child(2) {
	text-align: center;
}

#lead > div:nth-child(3) {
	display: flex;
	gap: 1em;
}

#lead > div > div {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.5em;
}

.legend {
	width: 100%;
	padding: 0.25em;
	border: 1px solid var(--gray400);
	text-align: center;
	font-weight: 600;
}

code, kbd {
	color: var(--red400);
	font-weight: 600;
}

.gallery-link {
	background-color: white;
}

.gallery-link:visited, .legend-prev {
	background-color: var(--blue400);
	color: white;
}

.gallery-link:visited:hover {
	background-color: var(--blue500);
}

.gallery-link:visited:active {
	background-color: var(--blue600);
}

.gallery-link.visited, .legend-cur {
	background-color: var(--blue700);
	color: white;
}

.gallery-link.visited:hover {
	background-color: var(--blue800);
}

.gallery-link.visited:active {
	background-color: var(--blue900);
}

.gallery-link.not-visited {
	background-color: inherit;
	color: inherit;
}

input[type=text] {
	width: 100%;
	padding: 0.2em;
	border: 1px solid var(--gray400);
	outline: 0;
	font-family: inherit;
	font-size: 100%;
}

#title {
	font-size: 150%;
}

input[type=text]:hover, button:hover, .gallery-link:hover, .gallery-link.not-visited:hover, .grid-image:hover {
	background-color: var(--gray100);
}

input[type=text]:active, input[type=text]:focus, button:active, .gallery-link:active, .gallery-link.not-visited:active, .grid-image:active {
	background-color: var(--gray200);
}

#settings-container {
	margin-top: 1em;
}

#settings {
	display: flex;
	margin-bottom: 1em;
	border-bottom: 1px solid var(--gray400);
}

label {
	padding-top: 0.15em;
	padding-bottom: 0.15em;
}

@media screen and (max-width: 64em) {
	#settings, #lead > div:nth-child(3) {
		flex-direction: column;
	}
}

#settings {
	gap: 1em;
	padding: 1em 0;
}

#settings > div {
	flex: 1;

	display: flex;
	flex-direction: column;
	gap: 0.25em;
}

#container {
	margin: 1em;
}

.gallery {
	display: grid;
	gap: 2em 0.25em;
	grid-auto-rows: minmax(32em, 1fr);
	grid-template-columns: repeat(auto-fill, minmax(12em, 1fr));
}

.grid-element {
	position: relative;
	border: 1px solid var(--gray400);
	display: flex;
	flex-direction: column;
}

.grid-title {
	display: flex;
	border-bottom: 1px solid var(--gray400);
}

.grid-title > div:first-child, .grid-title > div:nth-child(2) {
	padding: 0.25em;
	font-family: monospace;
	font-size: 75%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.grid-title > div {
	display: flex;
	align-items: center;
}

.grid-title > div:first-child {
	border-right: 1px solid var(--gray400);
	font-weight: 600;
	justify-content: center;
}

.grid-title > div:nth-child(2) {
	flex: 1;
}

.grid-title > div:last-child {
	background-color: var(--red100);
	font-weight: 600;
	text-align: center;
	border-left: 1px solid var(--gray400);
}

.grid-title > div:last-child > button {
	border: none;
}

.grid-image {
	flex: 1 10em;
	display: flex;
	justify-content: center;
	min-width: 0;
	min-height: 0;
}

.grid-buttons {
	display: flex;
	flex-direction: column;
	align-items: stretch;
}

#grid-add, #create-workspace {
	background-color: var(--green100);
	font-weight: 600;
}

#grid-add:hover, #create-workspace:hover {
	background-color: var(--green200);
}

#grid-add:active, #create-workspace:active {
	background-color: var(--green300);
}

.button-red:hover {
	background-color: var(--red200);
}

.button-red:active {
	background-color: var(--red300);
}

@keyframes apply {
	from {
		background-color: var(--green100);
		box-shadow: 0 0 0 0.5em var(--green100);
	}

	to {
		background-color: inherit;
	}
}

.applied {
	animation-name: apply;
	animation-duration: 1s;
}

#grid-add {
	justify-content: center;
	align-items: center;
}

#footer {
	text-align: center;
	margin-top: 4em;
	margin-bottom: 4em;
}

#stack {
	display: flex;
	flex-direction: column;
	gap: 0.25em;
}

#stack > div {
	display: flex;
	gap: 0.25em;
}

#stack > div > div:first-child {
	display: flex;
	justify-content: center;
	width: 2em;
}

#stack input {
	height: 100%;
}

#stack > div > div:nth-child(2) {
	flex: 1;
}

#stack > div > div:nth-child(3) {
	flex: 4;
}

#stack > div > div:nth-child(3) > input {
	font-family: monospace;
}

#stack > div > div:last-child {
	width: 2em;
}

.button-red {
	background-color: var(--red100);
}

.gallery-link {
	padding: 0.5em;
	text-align: center;
	text-decoration: none;
	color: inherit;
	font-weight: 600;
	border-top: 1px solid var(--gray400);
}

.loader-container {
	background-color: white;
	opacity: 0.75;
	display: flex;
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 100%;
	align-items: center;
	justify-content: center;
}

.loader {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--blue900);
	position: relative;
}

.loader:before,
.loader:after {
	content: "";
	position: absolute;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	background: var(--blue400);
	transform: rotate(0deg) translate(30px);
	animation: rotate 1s ease infinite;
}

.loader:after {
	animation-delay: 0.5s;
}

@keyframes rotate {
	100% {
		transform: rotate(360deg) translate(30px)
	}
}
