:root {
	--transparency: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" fill-opacity=".05">\
			<rect width="50" height="50" />\
			<rect x="50" y="50" width="50" height="50" />\
		</svg>') 0 0 / 20px 20px #f8f8f8;
}

body {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	box-sizing: border-box;
	height: 100vh;
	padding: 1em 2em;
	margin: 0;
	font: 100%/1.6 Helvetica Neue, sans-serif;
	background: var(--transparency);
}

input[type=number]::-webkit-inner-spin-button {
	opacity: .5;
	transform: scale(1.2)
}

h1 {
	display: flex;
	align-items: center;
	margin: 0 0 .5em;
	font-size: 300%;
	line-height: 1;
	letter-spacing: -.05em;
}

	h1 .name {
		margin-left: auto;
		font-size: 50%;
		letter-spacing: normal;
		opacity: .1;
		font-weight: normal;
	}

	h1 button[mv-action] {
		margin-top: .3em;
		margin-left: 1em;
	}

main {
	padding: 1.5em;
	border-radius: .5em;
	width: 40em;
	max-width: 90vw;
	margin: 1em auto;
	background: #f0f0f0;
	box-shadow: .05em .05em .1em rgba(0,0,0,.2), 0 0 0 100vmax var(--color);
}

label,
details summary {
	display: block;
	text-transform: uppercase;
	font-size: smaller;
	margin-top: 1em;
	font-weight: bold;
	color: rgba(0,0,0,.5);
}

abbr {
	text-transform: initial;
}

.color-slider {
	display: block;
	margin: 0 1em auto 0;
	width: 100%;
	-moz-appearance: none;
	-webkit-appearance: none;
	background: linear-gradient(to right, var(--stops)), var(--transparency);
	height: 2.2em;
	border-radius: .3em;
	box-shadow: 0 0 1px rgba(0, 0, 0, 0.5);
}

.color-slider::-webkit-slider-thumb {
	width: 1em;
	height: 2.3em;
	-webkit-appearance: none;
	border-radius: .15em;
	border: 1px solid black;
	box-shadow: 0 0 0 1px white;
}

.color-slider::-moz-range-thumb {
	width: 1em;
	height: 2.3em;
	border-radius: .15em;
	border: 1px solid black;
	box-shadow: 0 0 0 1px white;
	background: transparent;
}

.color-slider::-moz-range-track {
	 background: none;
}

.color-slider-label {
	position: relative;
 }

.color-slider + input[type=number] {
	position: absolute;
	margin-top: -4em;
	left: calc(100% * var(--percentage));
	transform: translateX(-50%);
	padding: .2em .5em;
	width: 3em;
	border: 0;
	border-radius: .3em;
	text-align: center;
	color: white;
	background: rgba(0,0,0,.8);
	font: inherit;
	font-size: 120%;
	transition: .3s left cubic-bezier(.17,.67,.49,1.48) ;
}

	/* Prevent input from moving all over the place as we type */
	.color-slider + input[type=number]:focus {
		transition-delay: .5s;
	}

	label:not(:focus-within):not(:hover) > .color-slider + input[type=number] {
		display: none;
	}

input[property^=color] {
	padding: .3em .5em .2em;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: .3em;
	box-shadow: 0 0.05em 0.2em rgba(0, 0, 0, 0.2) inset;
	background: rgba(26, 26, 26, 0.05);
	width: 100% !important;
	box-sizing: border-box;
	font: 150% Consolas, Monaco, monospace;
}

input[property^=color] {
	padding: .3em .5em .2em;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: .3em;
	box-shadow: 0 0.05em 0.2em rgba(0, 0, 0, 0.2) inset;
	background: rgba(26, 26, 26, 0.05);
	width: 100% !important;
	box-sizing: border-box;
	font: 150% Consolas, Monaco, monospace;
}

.out-of-gamut input {
	border-color: rgba(200, 0, 0, 0.5);
}

.out-of-gamut-warning {
	color: #b00;
	font-weight: bold;
	font-size: smaller;
	text-transform: initial;
}

.out-of-gamut-warning::before {
	content: "⚠️ ";
	filter: invert() hue-rotate(-200deg);
}

label:not(.out-of-gamut) .out-of-gamut-warning {
	display: none;
}

main > footer {
	background: rgba(0,0,30,.05);
	padding: inherit;
	padding-top: 1rem;
	padding-bottom: 1rem;
	margin: -1.5rem;
	margin-top: 1rem;
	color: rgba(0,0,30,.6);
	font-size: smaller;
}

	main > footer a {
		color: inherit;
		font-weight: bold;
	}

#saved {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax(10em, 1fr) );
	grid-gap: .5em;
}

[property="storedColor"] {
	position: relative;
	display: inline-grid;
	grid-template-columns: 1fr 1fr;
	grid-gap: .2em;
	padding: .8em;
	border: 8px solid white;
	background: linear-gradient(var(--color), var(--color)), var(--transparency);
	box-shadow: .05em .05em .1em rgba(0,0,0,.2);
	font-weight: bold;
	text-align: center;
	color: white;
}

[property="storedColor"].light {
	color: black;
}

	[property="storedColor"] > span {
		display: block;
	}

		[property="storedColor"] > span::before {
			content: attr(data-letter) " ";
			font-weight: 300;
		}

	[property="storedColor"] > [mv-action] {
		position: absolute;
		top: 0; right: 0; bottom: 0; left: 0;
		cursor: pointer;
	}

	[property="storedColor"] [property="name"] {
		display: block;
		max-width: 100%;
		position: relative;
		z-index: 1;
		grid-column-end: span 2;
	}

	[property="storedColor"] .gamut {
		font-size: 70%;
		font-weight: bold;
		grid-column-end: span 2;
	}

#gradient {
	width: 100%;
	height: 3em;
	margin-top: 1em;
	border-radius: 4px;
	background: linear-gradient(to right, var(--stops)), var(--transparency);
}

.mv-add.mv-add.mv-add.mv-add {
	display: none;
}

h2 {
	display: flex;
	line-height: 1;
}

	button:not(.mv-ui) {
		padding: .4em .6em;
		border: 0;
		margin: 0 .5em;
		background: rgba(0,0,0,.15);
		border-radius: .3em;
		font-weight: bold;
		text-transform: uppercase;
		cursor: pointer;
	}

		h2 button:hover {
			background: rgba(0,0,0,.25);
		}

		h2 .clear {
			margin-left: auto;
		}

		h2 .clear:hover {
			background: #c00;
			color: white;
		}

details {
	margin-top: 1em;
}

[mv-app]:not(.show-advanced) .decimals {
	visibility: hidden;
}


/* Carbon Ads */

#carbonads {
	display: block;
	margin: 2em 0;

	font-size: 14px;
	line-height: 1.35;
	overflow: hidden;
	max-width: 330px;
}

#carbonads a {
	color: #5b5b6f;
}

#carbonads span {
	display: block;
	position: relative;

	overflow: hidden;
}

.carbon-img {
	float: left;
	margin-right: 1em;
}

.carbon-img img {
	display: block;
}

.carbon-text {
	display: block;
	float: left;
	margin-bottom: 20px;

	max-width: calc(100% - 130px - 1em);
	text-align: left;
	text-decoration: none;
}

.carbon-poweredby {
	display: block;
	position: absolute;
	bottom: 0;
	left: 144px;

	font-size: 10px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 1px;
	text-transform: uppercase;
}
