* {
	box-sizing: border-box;
	-moz-box-sizing: border-box;
	
	margin: 0; 
	padding: 0;
}

label {
	display: inline-block;
	width: 140px;
	margin: 0;
}

form {
	display: block;
}

h1 {
	margin: 10px 0;
	padding: 0 40px;
	
	height: 32px;
	line-height: 32px;
	border-radius: 4px 0 0 4px;	
}

.hidden {
	display: none;
}

.pre {
	font-size: 16px;
	white-space: pre;
}

.left {
	float: left;
}

.right {
	float: right;
}

.clear {
	clear: both;
	display: block;
}

.user {
	display: inline-block;
	float: right;
}

.container {
	position: relative;
}

.box {
	padding: 5px;	
}

.circle {
	display: inline-block;
	position: relative;
	border-radius: 50%;
}

.circle > * {
	top: 50%;
	left: 50%;
	display: block;
	position: absolute;
	transform: translate(-50%, -50%);
	text-align: center;
}

#main {
	position: relative;
	padding: 10px;
	width: 100%;
	min-width: 360px;
	max-width: 500px;
	margin-left: auto;
	margin-right: auto;
	border-bottom: solid 1px lightgrey;
}

#status {
	position: relative;
	font-size: 13px;
	height: 20px;
	line-height: 20px;
	overflow: hidden;
}

#status span {
	position: relative;
	top: -30px;
	transition: top 0.5s;
}

#status.visible span {
	top: 0px;
}

#icon,
#back {
	display: inline-block;
	margin-top: 10px;
}

#icon a,
#back a {
	display: inline-block;
	width: 32px;
	height: 32px;
}

#icon {
	float: left;
}

#icon a {
	background: url(/images/home-iot-32.png) no-repeat;
}

#back {
	float: left;
}

#back a {
	width: 20px;
	        mask: url(/images/back.svg) no-repeat 5px 7px;
	-webkit-mask: url(/images/back.svg) no-repeat 5px 7px;
}

#logout {
	display: inline-block;
	margin-left: 5px;
}

#logout a {
	display: inline-block;
	width: 20px;
	height: 20px;
	        mask: url(/images/exit.svg) no-repeat;
	-webkit-mask: url(/images/exit.svg) no-repeat;
}

#login input {
	width: 100%;
	margin-bottom: 10px;
}

#login button {
	float: right;
	width: 90px;
}

#all-valves,
#clock {
	display: inline-block;
	
	position: absolute; 
	top: 85px;
	right: 10px;
	
	height: 35px;
	line-height: 35px;
	
	overflow: hidden;
}

#all-valves {
	top: 70px;
	height: 52px;
}

#all-valves legend {
	font-size: 12px;
	line-height: 10px;
	padding: 0 3px;
}

#all-valves fieldset,
#clock span {
	display: inline-block;
	position: relative;
	
	top: 36px;
	
	height: 35px;
	line-height: 35px;
	
	transition: top 0.5s;
}

#all-valves fieldset {
	top: -50px;
	height: 44px;
	line-height: 30px;
	padding: 4px 10px;
	
	display: flex;
	gap: 10px;
	align-items: center;
	justify-content: center;
	
	border: solid 1px grey;
	border-radius: 5px;
}

#all-valves.visible fieldset {
	top: 8px;	
}

#clock.visible span {
	top: 0px;
}

#clock.visible span {
	margin-left: 7px;
}

#clock span.local {
	padding-right: 7px;
	border-right: solid 1px grey;
}

#room-unify {
	margin-bottom: 10px;
	display: flex;
	gap: 3px;
}

#all-valves button,
#room-unify span {
	display: inline-block;
	border: 1px solid grey;
	border-radius: 5px;
	width: 40px;
	height: 40px;
	vertical-align: top;
	padding: 0;
}

#all-valves button {
	width: 23px;
	height: 23px;
	border: none;
	background: none;
}

#all-valves button.ForceOpen {
	width: 33px;
}

#all-valves button::before,
#room-unify span::before {
	content: '\00A0';
	display: inline-block;
	width: 30px;
	height: 30px;
	margin: 5px;
	background: grey;
}

#all-valves button::before {
	width: 23px;
	height: 23px;
	margin: 0;
}

#all-valves button.ForceOpen::before {
	width: 33px;
}

#all-valves button.active::before,
#room-unify span.active::before {
	background: darkcyan;
}

@media(hover: hover) and (pointer: fine) {
	#room-unify span:hover::before {
		background: blue;
	}
}

#room-unify span.temperature::before {
			mask: url(/images/temperature.svg) no-repeat 7px 0;
	-webkit-mask: url(/images/temperature.svg) no-repeat 7px 0;
}

#room-unify span.humidity::before {
	width: 24px;
	height: 24px;
	margin: 8px;
			mask: url(/images/humidity.svg) no-repeat 2px 0;
	-webkit-mask: url(/images/humidity.svg) no-repeat 2px 0;
}

#room-unify span.valve::before {
			mask: url(/images/valve.svg) no-repeat 0 3px;
	-webkit-mask: url(/images/valve.svg) no-repeat 0 3px;
}

#room-unify span.target::before {
			mask: url(/images/temperature-settings.svg) no-repeat 4px 0;
	-webkit-mask: url(/images/temperature-settings.svg) no-repeat 4px 0;
}

#all-valves button.PowerOff::before {
			mask: url(/images/on-off.svg) no-repeat 0 0;
	-webkit-mask: url(/images/on-off.svg) no-repeat 0 0;
}

#all-valves button.ForceOpen::before {
			mask: url(/images/valve-open.svg) no-repeat 0 0;
	-webkit-mask: url(/images/valve-open.svg) no-repeat 0 0;
}

#content {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

#modal {
	display: none;
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	height: 100%;
	z-index: 9999;

	background: rgba(0, 0, 0, 0.2);
	backdrop-filter: blur(2px) grayscale(40%);
}

#modal > div {
	display: none;
	position: absolute;
	
	top: min(50%, 50vh);
	left: 50%;

	width: 80%;
	min-width: 300px;
	max-width: 440px;
	
	height: auto;
	transform: translate(-50%, -50%);
	
	padding: 10px;
	background: white;
	box-shadow: 5px 5px 15px black;
}

#modal .confirm p {
	text-align: center;
	margin-bottom: 10px;
}

#modal .confirm button {
	width: 30%;
	margin: 10px 10% 0 10%;
}

#modal .confirm .yes {
	float: left;
}

#modal .confirm .no {
	float: right;
}
