@font-face {
    font-family: "main";
    src: url("../fonts/Roboto/Roboto-Regular.ttf");
}

@font-face {
    font-family: "doto";
    src: url("../fonts/Doto/Doto-Regular.ttf");
}

:root {
    --main_white: #F2F2F2;
    --main_black: #222222;
    --main_main: #11B798;

    --square-w: 18.75rem;
    --square-h: 12.5rem;
    --track-w: 0.875rem;
    --thumb-d: 1.125rem;
    --radius: 0.4375rem;
    --tile: 0.625rem;
}

::selection {
    background: var(--main_black);
    color: var(--main_white);
}

li::marker {
    color: var(--main_main);
}

::placeholder {
    color: var(--main_black);
}

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: "main";
    letter-spacing: 0.1em;
    scroll-behavior: smooth;
}

body {
    background: var(--main_white);
    color: var(--main_black);
    min-height: 100vh;    
    display: flex;
    flex-direction: column;
}

body.dark {
    background: var(--main_black);
    color: var(--main_white);
}

body.dark .side {
    background: #111111;
}

body.dark .card, body.dark2 .card {
    border-color: var(--main_white);
}

body.dark input, body.dark textarea, body.dark ::placeholder, body.dark2 input, body.dark2 textarea, body.dark2 ::placeholder {
    color: var(--main_white);
    border-color: var(--main_white);
}

body.dark ::selection, body.dark2 ::selection {
    background: var(--main_white);
    color: var(--main_black);
}

body.dark2 {
    background: #111111;
    color: var(--main_white);
}

body.dark2 .side {
    background: #000000;
}

a {
    color: var(--main_main);
    text-decoration: none;
    cursor: pointer;
}

a:hover {
    text-decoration: underline;
}

a, u {
    text-underline-offset: 0.2rem;
}

button {
    background: var(--main_main);
    color: var(--main_white);
    border: none;
    padding: 0.75rem 1rem;
    margin: 0.25rem 0 0.25rem 0;
    border-radius: 0.5rem;
    cursor: pointer;
}

button:active {
    background: #0A8F76;
}

button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

button .active-hide {
    margin: 0 0 0 0.25rem;
    display: none;
}

button a, button a:hover, .footer_bar a, .footer_bar a:hover {
    color: inherit;
    text-decoration: none;
}

input {
    background: transparent;
    border: 0.1rem solid var(--main_black);
    color: var(--main_black);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    width: 100%;
    outline: none;
}

textarea {
    background: transparent;
    border: 0.1rem solid var(--main_black);
    color: var(--main_black);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    width: 100%;
    min-height: 60vh;
    resize: vertical;
    outline: none;
    line-height: 1.6;
}

textarea:focus {
    border-color: var(--main_main);
}

ul, ol {
    padding-left: 3rem;
}

img {
    width: 50%;
    height: auto;
    user-select: none;
    vertical-align: middle;
}

.container {
    content: "";
    display: table;
    clear: both;
}

.side {
    background: var(--main_black);
    color: var(--main_white);
    width: 20%;
    float: left;
    min-height: 100vh;    
    display: flex;
    flex-direction: column;
    position: fixed;
    z-index: 99999;
    height: 100vh;
    overflow-y: auto;
}

.side > * {
    flex-shrink: 0;
}

.side-title {
    padding: 4rem 0 2rem 4rem;
}

.side-title h1 {
    font-size: 3rem;
}

.side button {
    background: transparent;
    width: 100%;
    padding: 1rem 0 1rem 4rem;
    margin: 0;
    border-radius: 0;
    text-align: left;
}

.side button:hover, .side button.active, .side button.active:hover {
    background: #333;
}

.side button.active .active-hide {
    display: inline;
}

.body {
    padding: 4rem 3rem;
    margin-left: 20%;
    width: 80%;
    float: left;
}

.card {
    border: 0.1rem solid var(--main_black);
    padding: 1rem;
}

.tab-buttons {
    display: flex;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.25s ease forwards;
}

.col10 {
    width: 10%;
    float: left;
}

.col90 {
    width: 90%;
    float: left;
}

.item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
}

.doc-item {
    flex-wrap: wrap;
}

.doc-item a {
    overflow-wrap: anywhere;
    margin-right: auto;
}

button.link-btn, button.link-btn:hover, button.link-btn:active {
    background: none;
    color: var(--main_main);
    font-size: inherit;
    padding: 0;
    margin: 0;
    border-radius: 0;
}

button.link-btn:hover {
    text-decoration: underline;
    text-underline-offset: 0.2rem;
}

.note-status {
    margin-left: 1rem;
    opacity: 0.6;
}

.checkbox {
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
    width: 1rem;
    border: 0.1rem solid var(--main_main);
    border-radius: 0.5rem;
    cursor: pointer;
    position: relative;
    transition: background 0.15s;
}

.checkbox:hover {
    border: 0.1rem solid #0A8F76;
}

.checkbox:checked {
    background: var(--main_main);
    border: 0.1rem solid var(--main_main);
}

.checkbox:checked::after {
    content: "X";
    color: var(--main_white);
    font-size: 1rem;
    position: absolute;
    top: 0.2rem;
    left: 0.7rem;
}

.picker-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
 
.sv-square {
    position: relative;
    width: var(--square-w);
    height: var(--square-h);
    /* First layer is painted on top: black (value) must sit above white (saturation) */
    background:
        linear-gradient(to top, #000, transparent),
        linear-gradient(to right, #fff, transparent),
        hsl(0, 100%, 50%);
    cursor: crosshair;
    touch-action: none;
    user-select: none;
}
 
.sv-cursor {
    position: absolute;
    width: 0.75rem;
    height: 0.75rem;
    border: 0.125rem solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(0, 0, 0, 0.6);
    transform: translate(-50%, -50%);
    pointer-events: none;
}
 
.checkerboard {
    background: repeating-conic-gradient(#ccc 0% 25%, #fff 0% 50%) 0 0 / var(--tile) var(--tile);
}

.hue-slider,
.alpha-slider {
    -webkit-appearance: none;
    appearance: none;
    writing-mode: vertical-lr;
    direction: rtl;
    width: var(--track-w);
    height: calc(var(--square-h) + var(--thumb-d));
    margin: calc(var(--thumb-d) / -2) 0;
    border-radius: var(--radius);
    outline: none;
    padding: 0 0.65rem 0 0.4rem;
}

.hue-slider {
  background: linear-gradient(to top, red, yellow, lime, cyan, blue, magenta, red);
}

.hue-slider::-webkit-slider-thumb,
.alpha-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: var(--thumb-d);
    height: var(--thumb-d);
    border-radius: 50%;
    background: #fff;
    border: 0.125rem solid #666;
    cursor: pointer;
}

.hue-slider::-moz-range-thumb,
.alpha-slider::-moz-range-thumb {
    width: var(--thumb-d);
    height: var(--thumb-d);
    border-radius: 50%;
    background: #fff;
    border: 0.125rem solid #666;
    cursor: pointer;
}

.hue-slider::-webkit-slider-runnable-track,
.alpha-slider::-webkit-slider-runnable-track {
    width: var(--track-w);
    border-radius: var(--radius);
}

input.hex-output {
    width: 15%;
}

input.fltr-output {
    width: 70%;
}

.swatch {
    width: 2.5rem;
    height: 2.5rem;
}

.swatch-fill {
    width: 100%;
    height: 100%;
}

.four-input-flex input {
    width: 10%;
}

#converterNav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
}

.unit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 1rem;
}

.unit-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.ref-row {
    margin-top: 1rem;
}

.ref-row input {
    width: 15%;
    display: block;
    margin-top: 0.5rem;
}

.icon {
    width: 2em;
    margin: 0 0.5rem 0 0;
}

.tally {
    background: #898989;
    border: 0.3rem solid var(--main_black);
    border-right: 0.8rem solid var(--main_black);
    border-bottom: 0.8rem solid var(--main_black);
    border-radius: 0.5rem;
    padding: 1rem;
    width: 30rem;
    text-align: center;
}

.tally button, .tally button:hover {
    background: var(--main_black);
    border: 0.3rem solid var(--main_black);
    transition: 0.1s;
}

.tally button:active {
    scale: 0.9;
}

.tally-counter {
    background: #367845;
    border: 0.3rem solid var(--main_black);
    color: #0C4619;
    padding: 1rem;
    border-radius: 0.5rem;
}

#count {
    font-family: "doto";
    font-weight: bold;
    font-size: 5rem;
}

.wb-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    margin-bottom: 1rem;
}

.wb-toolbar button {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0.6rem 0.8rem;
}

.wb-toolbar button.active {
    background: #0A8F76;
}

.wb-toolbar input[type="color"] {
    width: 3rem;
    height: 2.75rem;
    padding: 0.2rem;
    cursor: pointer;
}

.wb-toolbar input[type="range"] {
    width: 10rem;
    padding: 0;
    border: none;
    accent-color: var(--main_main);
}

.wb-toolbar input[type="color"][disabled] {
    opacity: 0.3;
    cursor: not-allowed;
}

.wb-zoom-label {
    min-width: 4.5rem;
    font-size: 1rem !important;
}

.wb-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 1600 / 1000;
    overflow: hidden;
    outline: 0.1rem solid var(--main_black);
    background: #D9D9D9;
    cursor: none;
    touch-action: none;
    user-select: none;
}

.wb-canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: #FFFFFF;
    transform-origin: 0 0;
    cursor: none;
    touch-action: none;
    user-select: none;
}

.wb-viewport.panning {
    cursor: grab;
}

.wb-viewport.panning-active {
    cursor: grabbing;
}

.wb-cursor {
    position: fixed;
    display: none;
    border: 0.0625rem solid #FFFFFF;
    border-radius: 50%;
    mix-blend-mode: difference;
    pointer-events: none;
    z-index: 100000;
}

.wb-cursor-fill::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0.25rem;
    height: 0.25rem;
    background: #FFFFFF;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

body.dark .wb-viewport, body.dark2 .wb-viewport {
    outline-color: var(--main_white);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@media screen and (max-width: 70.3125rem) {
    button {
        font-size: 1rem;
    }
    .container {
        display: block;
    }
    .side {
        width: 100%;
        padding: 5rem 0 0 0;
        float: unset;
        min-height: auto;
        height: auto;
        display: flex;
        flex-direction: row;
        position: fixed;
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
    }
    .side .side-title {
        position: fixed;
        top: 0;
        left: 0;
        padding: 1rem 0;
        flex: 0 0 auto;
        transform: translateX(20%);
    }
    .side button {
        font-size: 0.75rem;
        width: auto;
        padding: 1rem;
        display: flex;
        white-space: nowrap;
        align-items: center;
    }
    .side button .icon {
        width: 2.5em;
        height: 2.5em;
        flex-shrink: 0;
    }
    .body {
        width: 100%;
        float: unset;
        padding: 12rem 2rem 3rem;
        margin-left: 0%;
    }
    .picker-row {
        text-align: center;
    }
    input.hex-output {
        width: 65%;
    }
    input.clr-output, input.fltr-output {
        width: 100%;
        margin: 0.5rem 0;
    }
    .ref-row input {
        width: 75%;
    }
    .tally {
        width: 100%;
    }
    .tally-panel {
        text-align: center;
    }
}