* {
    box-sizing: border-box;
    -webkit-user-drag: none;
    -webkit-user-select: none;
    user-select: none;
    font-family: the, sans-serif;
}

:root {
    --theme-text: rgb(197, 184, 255);
    --theme-border: #3fa1a8;
    --theme-accent: #936cff;
    --theme-bg: rgba(47, 75, 126, .8);
    --theme-bg-strong: rgb(49, 31, 114);
    --theme-gradient-bottom: rgba(71, 0, 204, .322);
    --theme-gradient-top: rgba(99, 86, 145, 0.486);
    --theme-window-top: rgba(10, 15, 40, .62);
    --theme-window-bottom: rgba(20, 30, 70, .42);
    --theme-border-soft: rgba(63, 161, 168, .45);
    --theme-panel-bg: linear-gradient(var(--theme-gradient-top), var(--theme-gradient-bottom));
    --dot-color-a: rgba(147, 108, 255, .18);
    --dot-color-b: rgba(63, 161, 168, .14);
}

@font-face {
	font-family: 'the';
	src: url('the.woff2') format('woff2');
	font-weight: normal;
	font-style: normal;
    font-display: swap;
}

html,
body {
    height: 100%;
background-color: black;
}

body {
    margin: 0;
    font-family: the, sans-serif;
    background-color: #000;
    background-image: radial-gradient(circle at 2px 2px, var(--dot-color-a) 2px, transparent 0), radial-gradient(circle at 2px 2px, var(--dot-color-b) 2px, transparent 0);
    background-position: 0 0, 25px 25px;
    background-size: 50px 50px, 50px 50px;
    color: var(--theme-text);
    display: grid;
    place-items: center;
    animation: dot-drift 2s linear infinite
}

@keyframes dot-drift {
    0% {
        background-position: 0 0, 25px 25px
    }

    100% {
        background-position: 50px 50px, 75px 75px
    }
}

body.monochrome-theme {
    --theme-text: rgb(222, 222, 222);
    --theme-border: #8b8b8b;
    --theme-accent: #b3b3b3;
    --theme-bg: rgba(78, 78, 78, .82);
    --theme-bg-strong: rgb(56, 56, 56);
    --theme-gradient-bottom: rgba(36, 36, 36, .56);
    --theme-gradient-top: rgba(124, 124, 124, .44);
    --theme-window-top: rgba(26, 26, 26, .76);
    --theme-window-bottom: rgba(10, 10, 10, .58);
    --theme-border-soft: rgba(139, 139, 139, .45);
    --theme-panel-bg: linear-gradient(var(--theme-gradient-top), var(--theme-gradient-bottom))
}

body.monochrome-theme .header,
body.monochrome-theme .panel-actions,
body.monochrome-theme .formats {
    filter: grayscale(1) saturate(0) contrast(1.08)
}

body.monochrome-theme .picker-ui,
body.monochrome-theme .picker-ui * {
    filter: none
}

body.monochrome-theme .empty {
    color: rgba(222, 222, 222, .74)
}

body.monochrome-theme .color-code-input::placeholder {
    color: rgba(222, 222, 222, .72)
}

.toast {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translate(-50%, -14px);
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    padding: 9px 14px;
    border-radius: 10px;
    border: 1px solid var(--theme-border);
    background: linear-gradient(to right, var(--theme-bg), var(--theme-bg-strong));
    color: var(--theme-text);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .38);
    font-size: 12px;
    transition: transform .2s cubic-bezier(.22, .61, .36, 1), opacity .2s cubic-bezier(.22, .61, .36, 1)
}

.toast.is-visible {
    transform: translate(-50%, 0);
    opacity: 1
}

.container {
    width: 100%;
    padding: 16px;
    display: flex;
    justify-content: center
}

.window {
    width: min(35.5vw, 980px);
    min-width: 640px;
    max-width: calc(100vw - 32px);
    background: linear-gradient(180deg, var(--theme-window-top), var(--theme-window-bottom));
    border: 2px ridge var(--theme-border);
    outline: 2px solid var(--theme-gradient-top);
    outline-offset: 3px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
    padding: 16px
}

body.app-booting .window {
    opacity: 0;
    transform: translateY(2px)
}

body.app-ready .window {
    opacity: 1;
    transform: none;
    transition: opacity .16s ease-out, transform .16s ease-out
}

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
    gap: 16px;
    align-items: stretch
}

.left-panel {
    min-width: 0;
}

.header h1 {
    margin: 0 0 16px 0;
    font-weight: 600;
    font-size: 18px;
    text-shadow: 1px 1px var(--theme-text), -1px -1px var(--theme-accent);
    color: var(--theme-gradient-top)
}

.controls.compact {
    margin-bottom: 20px
}

.picker-ui {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 58px;
    gap: 10px;
    align-items: start
}

.sv {
    position: relative;
    width: 100%;
    height: 165px;
    max-width: 100%;
    border-radius: 10px;
    border: 1px solid var(--theme-border);
    overflow: hidden;
    background: linear-gradient(0deg, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0)), linear-gradient(90deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
    background-color: hsl(var(--h, 260) 100% 50%);
    transition: background-color .22s cubic-bezier(.22, .61, .36, 1)
}

.sv-cursor {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .6);
    transform: translate(-7px, -7px);
    pointer-events: none;
    will-change: left, top
}

.bars {
    grid-column: 1/-1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px
}

.hue {
    position: relative;
    width: 100%;
    height: 14px;
    border-radius: 10px;
    border: 1px solid var(--theme-border);
    overflow: hidden;
    background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00)
}

.hue-thumb {
    position: absolute;
    top: 0;
    width: 4px;
    height: 100%;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .6);
    will-change: left
}

.alphaTrack {
    position: relative;
    height: 14px;
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--theme-border);
    background: linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 12px 12px;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0;
    overflow: hidden
}

.alphaTrack::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(var(--r, 108), var(--g, 92), var(--b, 231), 0), rgba(var(--r, 108), var(--g, 92), var(--b, 231), 1));
    transition: background .22s cubic-bezier(.22, .61, .36, 1);
    z-index: 1;
    pointer-events: none
}

.alpha-thumb {
    position: absolute;
    top: -3px;
    width: 4px;
    height: 20px;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .6);
    will-change: left;
    z-index: 2
}

.alpha-readout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #aab;
    font-size: 13px
}

.preview {
    grid-column: 2;
    grid-row: 1;
    height: 165px;
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--theme-border);
    background: linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 12px 12px;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0;
    position: relative;
    overflow: hidden;
    transition: box-shadow .22s cubic-bezier(.22, .61, .36, 1)
}

.preview::after {
    content: \"\";
    position: absolute;
    inset: 0;
    border-radius: 8px
}

.panel-actions {
    grid-column: 1/-1;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid var(--theme-border);
    background: rgba(0, 0, 0, .25);
    color: var(--theme-text)
}

.theme-toggle input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: var(--theme-accent)
}

.theme-toggle span {
    font-size: 12px;
    line-height: 1
}

.btn {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--theme-border);
    background: linear-gradient(to right, var(--theme-bg), var(--theme-bg-strong));
    color: var(--theme-text);
    cursor: pointer
}

.btn:hover {
    background: linear-gradient(to right, var(--theme-bg), var(--theme-bg-strong), var(--theme-gradient-top));
    color: #fff
}

.color-code-input {
    flex: 1 1 220px;
    min-width: 180px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--theme-border);
    outline: none;
    background: rgba(0, 0, 0, .28);
    color: var(--theme-text)
}

.color-code-input::placeholder {
    color: rgba(197, 184, 255, .7)
}

.color-code-input:focus {
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 1px rgba(147, 108, 255, .5)
}

.color-code-input.invalid {
    border-color: #ff7c9b;
    box-shadow: 0 0 0 1px rgba(255, 124, 155, .45)
}

formats {
    width: 300px;
}

.formats h2,
.swatches h2 {
    font-size: 13px;
    font-weight: 600;
    margin: 8px 0 12px;
    color: var(--theme-accent)
}

.swatches {
    height: 100%;
    border: 2px ridge var(--theme-border);
    border-radius: 12px;
    padding: 10px;
    background: var(--theme-panel-bg);
    align-self: stretch
}

.swatch-section {
    margin-bottom: 14px
}

.swatch-section:last-child {
    margin-bottom: 0
}

.format-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border: 2px ridge var(--theme-border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--theme-panel-bg)
}

.format-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 12px;
    border-top: 1px solid var(--theme-border-soft)
}

.format-item:first-child {
    border-top: none
}

.format-label {
    color: rgba(197, 184, 255, .78);
    font-size: 10px
}

.format-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    overflow: auto;
    white-space: nowrap;
    font-size: 12px;
}

.copy-btn {
    margin-left: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--theme-border);
    background: linear-gradient(to right, var(--theme-bg), var(--theme-bg-strong));
    color: var(--theme-text);
    cursor: pointer
}

.copy-btn:hover {
    background: linear-gradient(to right, var(--theme-bg-strong), var(--theme-accent));
    color: #fff
}

.swatch-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px
}

.swatch-pill {
    width: 35px;
    height: 20px;
    border-radius: 999px;
    border: 2px solid;
    cursor: pointer;
    background: linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 12px 12px;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0
}

.swatch-pill:hover {
    transform: translateY(-1px)
}

.empty {
    color: rgba(197, 184, 255, .7);
    margin: 8px 0 16px
}

@media (max-width: 600px) {
    .window {
        width: min(94vw, 980px);
        min-width: 0
    }

    .workspace {
        grid-template-columns: 1fr
    }

    .left-panel {
        order: 1
    }

    .swatches {
        order: 2;
        height: auto
    }

    .formats,
    .format-list {
        width: 100%
    }
}
