html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font: 14px sans-serif;
}

#content {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-size: 0
}

#mainUI {
    position: absolute;
    top: 0;
    right: 20px;
    width: 330px;
    color: #ddd;
    /* Hide controls */
    opacity: 0.3;
    transform: translateY(calc(1.2rem - 100%));
    transition: transform 0.15s ease-in-out, opacity 0.2s ease-in-out;
}

#mainUI:hover {
    opacity: 1;
}

#mainUI.showControls {
    /* Show controls */
    transform: translateY(0);
    opacity: 1;
}

.rowUI {
    background: #222;
    border-bottom: 1px solid #444;
    padding: 0.4em 0.7rem;
}

.radioButtons {
    display: flex;
    flex-flow: row nowrap;
}

.radioButtons label {
    position: relative;
    display: inline-block;
    background-color: #1D4D7C;
    cursor: pointer;
    padding: 0 0.5rem;
    margin: 0.4rem 0 0.6rem;
    text-align: center;
    flex: 1;
}

.radioButtons label:not(:last-child) {
    margin-right: 0.5rem;
}

.radioButtons label::before {
    content: ' ';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    border-top: 0.5rem solid #1D4D7C;
    border-left: 0.5rem solid transparent;
    border-bottom: 0.1rem solid transparent;
}

.radioButtons label::after {
    content: ' ';
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    border-bottom: 0.3rem solid #1D4D7C;
    border-right: 0.3rem solid transparent;
}

/* The "active" class is applied by a knockout binding to the selected engine. */
.radioButtons label.active {
    background-color: #307ccb;
    color: white;
}

.radioButtons label.active::before {
    border-top-color: #307ccb;
    border-left-color: white;
    border-bottom-color: white;
}

.radioButtons label.active::after {
    border-bottom-color: #307ccb;
}

.radioButtons label:hover {
    background-color: #3c9cff;
    color: white;
}

.radioButtons label:hover::before {
    border-top-color: #3c9cff;
}

.radioButtons label:hover::after {
    border-bottom-color: #3c9cff;
}

.radioButtons label input {
    position: absolute;
    top: -100vh;
}

.topUI {
    position: relative;
    border-bottom: 0.7rem solid #222;
    border-right: 0.7rem solid transparent;
}

.topUI span {
    position: absolute;
    bottom: -1.0rem;
    left: 0.8rem;
    font-size: 0.7rem;
}

.bottomUI {
    position: relative;
    border-top: 1.2rem solid black;
    border-left: 1.2rem solid transparent;
    text-align: center;
    cursor: pointer;
    transition: border-top-color 0.2s ease-in-out;
}

.bottomUI:hover {
    border-top-color: #555;
}

.bottomUI span {
    position: absolute;
    top: -1.0rem;
    left: -0.8rem;
    right: 0;
    font-size: 0.7rem;
}

.smallHeading {
    font-size: 0.7rem;
    margin-bottom: 0.2rem;
}

.embeddedList {
    overflow-y: auto;
    max-height: 30vh;
    margin-bottom: 0.2rem;
}

.checkboxLabel {
    display: block;
    cursor: pointer;
    padding: 0.25rem 0;
}

.checkboxLabel:hover {
    background: rgba(200, 200, 200, 0.15);
    color: white;
}

.checkboxLabel input[type="checkbox"] {
    position: absolute;
    top: -100vh;
}

.angleBox {
    display: inline-block;
    position: relative;
    width: 16px;
    height: 11px;
    background: #1D4D7C;
    vertical-align: top;
}

.angleBox::before {
    content: ' ';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    border-top: 5px solid #1D4D7C;
    border-left: 5px solid transparent;
}

.active .angleBox {
    background-color: #307ccb;
}

.active .angleBox::before {
    border-top-color: #307ccb;
}

.active .angleBox > span {
    position: absolute;
    top: 2px;
    left: 2px;
    border-left: 8px solid white;
    border-bottom: 4px solid white;
    border-right: 4px solid transparent;
}

.active .angleBox > span::before {
    content: ' ';
    position: absolute;
    top: 4px;
    left: -8px;
    width: 12px;
    height: 4px;
    background: white;
}

.active .angleBox > span::after {
    content: ' ';
    position: absolute;
    top: 8px;
    left: -8px;
    border-right: 8px solid white;
    border-top: 4px solid white;
    border-left: 4px solid transparent;
}

label:hover .angleBox {
    background: #3c9cff;
}

label:hover .angleBox::before {
    border-top-color: #3c9cff;
}

.combo {
    margin-bottom: 10px;
}

.rowUI input[type=range i] {
    margin-top: 12px;
    margin-bottom: 15px;
    width: 220px;
    position: relative;
    top: -2px;
}

.rowUI input[type=range i]::-webkit-slider-runnable-track {
    -webkit-appearance: none;
    height: 2px;
    cursor: pointer;
    background: #307ccb;
}

.rowUI input[type=range i]::-webkit-slider-thumb {
    margin-top: -11px;
}

/* Small mode */
@media (max-width: 400px) {
    html, body {
        font-size: 10px;
    }

    #mainUI {
        width: 255px;
    }

    .topUI {
        border-bottom-width: 0.9rem;
        border-right-width: 0.9rem;
    }

    .topUI span {
        bottom: -1.3rem;
    }

    .bottomUI span {
        top: -1.2rem;
    }

    .topUI span,
    .bottomUI span,
    .smallHeading {
        font-size: 0.9rem;
    }

    .angleBox {
        height: 7px;
    }

    .active .angleBox > span::before {
        height: 0;
    }

    .active .angleBox > span::after {
        top: 4px;
    }

    .rowUI input[type=range i] {
        width: 156px;
    }
}
