
* {
    box-sizing: border-box;
}

html {
    background: black;
    color: #ccc;
    font-family: sans-serif;
    font-size: 16px;
    margin: 0;
    padding: 0;
}
body {
    margin: 0;
    padding: 0;
    padding-top: 2.5rem;
}
body > h1 {
    position: fixed;
    top: 0;
    right: 0;
    transform: rotate(-90deg) translateY(-1.25em) translateY(-1.25em);
    color: #222;
    font-size: calc(min(20vh, 40vw));
    margin: 0;
    transform-origin: top right;
    z-index: -10;
    width: 100vh;
    text-align: center;
}
body > aside {
    margin: 0 auto;
    font-size: 0.75rem;
    background: #333;
    position: fixed;
    z-index: 999;
    top: 0;
    left: 0;
    width: 100%;
    min-width: 19.5rem;
    line-height: 2.25rem;
    padding: 2px calc(max(0px, (100vw - 80rem) / 2) + 0.5rem);
    overflow-x: auto;
    _display: grid;
    grid-auto-flow: column;
    grid-gap: 0.5rem;
}
body > aside a[href='/login'],
body > aside a[href='/logout'] {
    _float: right;
}
body > main,
body > footer {
    margin: 0 auto;
    max-width: 80rem;
    padding: 0.5rem;
}
body.dialog > main {
    width: fit-content;
}
button {
    min-height: 2rem;
    min-width: 2rem;
    background: #999;
    border: 1px solid black;
    font-size: 1rem;
}
@keyframes clicked {
  from {outline-color: white;}
  to {outline-color: transparent;}
}
button:focus, a:focus {
    outline: 2px solid transparent;
    animation-name: clicked;
    animation-duration: 1s;
}
#lights, #outlets {
    display: grid;
    grid-gap: 2px;
    grid-template-columns: repeat(auto-fill, minmax(18.5rem, 1fr));
    grid-auto-rows: max-content;
}
div.light, div.outlet {
    width: 100%;
    /*box-shadow: 2px 2px 4px #333;*/
    border: 1px solid #333;
    padding: 1px 4px;
    background: #222222cc;
    margin: 0;
    position: relative;
    flex-grow: 1;
}

.toggler {
    display: block;
    color: inherit;
    text-decoration: none;
    line-height: 2rem;
    text-align: center;
    width: 1.5rem;
    float: right;
}
.toggler:hover,
.toggler:focus {
    color: #fff;
    outline: none !important;
}
.toggler::before {
    content: '\2716\FE0E';
}
div.light.collapsed .controls.modes {
    display: none;
}
div.light.collapsed .controls.tuning {
    display: none;
}
div.light.collapsed .toggler::before {
    content: '\25BC\FE0E';
}
div.light.is-on {
    border-left-color: #fff;
}

.light > div,
.outlet > div {
    margin: 0.25rem 0;
}
.light .controls > span {
    display: inline-block;
    vertical-align: middle;
    padding: 0;
}
.light .controls > span.modes-white {
    margin-right: 0.25rem;
    border-right: 1px solid black;
    padding-right: 0.5rem;
    padding-left: 0.5rem;
}
.light a.onoff {
    display: inline-block;
    height: 2rem;
    width: 4rem;
    line-height: 2rem;
    text-align: center;
    border: 1px solid black;
    text-decoration: none;
    background: white;
    color: black;
    border-radius: 1rem;
}
.light a.onoff.is-off {
    background: black;
    color: #999;
    border-color: #999;
}
.light:not(.is-off):not(.is-on) a.onoff.is-off {
    background: #333;
    color: #999;
}
.light a.onoff.is-on {
    background: white;
    color: black;
    border-color: black;
}
.light.is-on a.onoff.is-off,
.light:not(.is-on) a.onoff.is-on {
    display: none;
}
.light .controls.tuning a,
.light .controls.modes a {
    display:inline-block;
    width:2rem;
    height:2rem;
    border:1px solid black;
    border-radius: 1rem;
color: black;
text-decoration: none;
line-height: 2rem;
text-align: center;
font-weight: bold;
font-size: .75rem;
}
.light:not(.is-on):not(.is-off) .controls.tuning {
    display: none;
}
.light .controls.tuning .tuning-value {
    line-height: 2rem;
    vertical-align: top;
    font-size: 0.5rem;
    font-weight: bold;
}
.light .controls.modes a.state-active {
    box-shadow: 0px 0px 4px 3px #fff;
}
.light.is-off .controls.modes a.state-active {
    box-shadow: 0px 0px 4px 3px #ccc;
}
.outlet a.onoff {
    display: inline-block;
    height: 2rem;
    width: 4rem;
    line-height: 2rem;
    text-align: center;
    border: 1px solid black;
    text-decoration: none;
    background: white;
    color: black;
}
.outlet a.onoff.is-off {
    background: black;
    color: #999;
    border-color: #999;
}
.outlet .switch:not(:last-child) {
  margin-inline-end: 0.25rem;
}
.outlet .switch.is-on a.onoff.is-off,
.outlet .switch.is-off a.onoff.is-on {
    display: none;
}

#outlets {
    margin-top: 1rem;
}

a.button,
button[type="submit"] {
    display: inline-block;
    line-height: 2rem;
    padding: 0 0.5rem;
    background: #000;
    color: #666;
    text-decoration: none;
    border: 1px solid #666;
    border-radius: 0.25rem;
}
a.button.primary,
button[type="submit"].primary {
    background: #33f;
    color: #fff;
    font-weight: bold;
    border-color: #fff;
}
a.button.secondary,
button[type="submit"].secondary {
  background-color: #393;
  color: white;
  font-weight: bold;
  border-color: #060;
}
a.button:focus, button[type="submit"]:focus,
a.button:hover, button[type="submit"]:hover {
    background: #999;
    color: #000;
    border: 1px solid #666;
}
input[type="text"].password,
input[type="password"] {
    font-size: 1rem;
    padding: 0 0.5rem;
    margin: 0;
    line-height: 2rem;
    color: white;
    background: black;
    border: 2px solid white;
    outline: none;
    border: 1px solid #666;
    border-radius: 0.25rem;
}
input[type="text"].password:focus,
input[type="password"]:focus {
    outline: 1px solid white;
}

a.button.svg {
    padding: 0;
    color: #999;
    background: #000;
    min-width: 3rem;
    text-align: center;
}
a.button.svg:hover {
    color: #fff;
    background: #000;
}
a.button svg {
    display: inline;
    width: 2rem;
    height: 2rem;
    margin: 0;
    padding: 0;
    vertical-align: top;
}
a.button svg path.filled {
    fill: currentColor;
    stroke: none;
}
a.button svg path.open {
    fill: #000;
    stroke: currentColor;
    stroke-width: 1;
}

/* from loading.io/css/ */
/* HTML:
<div class="lds-ripple"><div></div><div></div></div>
*/

.lds-ripple {
  --ripple-size: 80px;
  --ripple-border-width: 4px;
  display: inline-block;
  position: relative;
  width: var(--ripple-size);
  height: var(--ripple-size);
  margin: 0 !important;
}
.light .controls.main .lds-ripple {
    float: right;
    --ripple-size: 2rem;
    --ripple-border-width: 3px;
}
.lds-ripple div {
  margin: 0 !important;
  position: absolute;
  border: var(--ripple-border-width) solid #fff;
  opacity: 1;
  border-radius: 50%;
  animation: lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;
  box-sizing: content-box;
}
.lds-ripple div:nth-child(2) {
  animation-delay: -0.5s;
}
@keyframes lds-ripple {
  0% {
    top: 36px;
    top: calc(var(--ripple-size) / 2 - var(--ripple-border-width));
    left: 36px;
    left: calc(var(--ripple-size) / 2 - var(--ripple-border-width));
    width: 0;
    height: 0;
    opacity: 0;
  }
  1% {
    opacity: 1;
  }
  100% {
    top: 0px;
    left: 0px;
    width: 72px;
    width: calc(var(--ripple-size) - 2 * var(--ripple-border-width));
    height: 72px;
    height: calc(var(--ripple-size) - 2 * var(--ripple-border-width));
    opacity: 0;
  }
}

