:root {
    --bg: #171e26;
    --bg2: #1f2630;
    --bg3: #29313c;
    --btn: rgb(133, 142, 157);
    --btn2: #2196f3;
    --ylw: rgb(253, 194, 30);
    --red: rgb(246, 70, 93);
    --green: rgb(14, 203, 129);
    --text--primary: whitesmoke;
    --text--secondary: #878f9c;
}

* {
    margin: 0;
    padding: 0;
}

html {
    position: relative;
    background-color: var(--bg);
    font-family: "Monospace", sans-serif;
    color: var(--text--primary);
    font-size: 0.875rem;
    width: 100%;
}

body {
    position: relative;
    width: 100%;
}

.container {
    margin: auto;
    width: 350px;
    border-radius: 5px;
}

h1 {
    font-size: 16px;
}
h2 {
    font-size: 14px;
    color: var(--text--secondary);
}
h1,
h2 {
    padding: 0 5px;
    margin-bottom: 10px;
    text-align: center;
}

.legend {
    display: block;
    width: 17rem;
    margin: auto;
    padding: 5px 7px;
    text-align: center;
    background-color: var(--bg3);
    border-radius: 2px;
    color: var(--btn);
    font-size: 0.8rem;
}

.grid {
    display: grid;
    grid-template-columns: auto;
    grid-template-rows: auto 1fr 1fr 1fr;
}

.group {
    margin: 2.5% 5%;
    padding: 5%;
    background-color: var(--bg2);
    border-radius: 5px;
}
.group:first-child {
    margin-top: 5%;
}
.group:last-child {
    margin-bottom: 5%;
}

.grid__item {
    width: 17rem;
    margin: 3px auto;
    padding: 2px 5px;
    display: grid;
    grid-template-columns: 8.5rem auto;
    grid-template-rows: auto;
    background-color: var(--bg3);
    border-radius: 2px;
    color: var(--btn);
}

input {
    width: 6.25rem;
    padding-right: 0.8ch;
    text-align: right;
    justify-self: end;
    border: 0;
    background-color: var(--bg3);
    color: whitesmoke;
}

span {
    justify-self: end;
    padding-right: 0.625rem;
}
span.qty {
    padding-right: calc(0.625rem + 1.4ch);
}
span.percent {
    padding-right: calc(0.625rem - 0.6ch);
}

label,
span {
    color: var(--text--secondary);
}
label,
span:first-child {
    justify-self: end;
    padding-right: 0.4375rem;
}

.red :last-child {
    color: var(--red);
}

.green :last-child {
    color: var(--green);
}

.yellow {
    color: var(--ylw);
}

/* slider */
.switch {
    position: relative;
    display: inline-block;
    width: 1.75rem;
    height: 1.063rem;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--green);
    -webkit-transition: 0.4s;
    transition: 0.4s;
    border-radius: 0.25rem;
}
.slider:before {
    position: absolute;
    content: "";
    height: 0.75rem;
    width: 0.75rem;
    left: 0.25rem;
    bottom: 0.188rem;
    background-color: var(--text--primary);
    -webkit-transition: 0.4s;
    border-radius: 25%;
    transition: 0.4s;
}

input:checked + .slider {
    background-color: var(--red);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--red);
}

input:checked + .slider:before {
    -webkit-transform: translateX(0.938rem);
    -ms-transform: translateX(0.938rem);
    transform: translateX(0.938rem);
}

@media only screen and (min-height: 750px) {
    .container {
        margin: 10% auto;
    }
}
