@font-face
{
    font-family: "Monaspace Krypton";
    src: url("https://cdn.jsdelivr.net/fontsource/fonts/monaspace-krypton@latest/monaspace-krypton-latin-400-normal.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

#dish
{
    position: fixed;
    z-index: -1;
    top: 0;
    left: 0;

    width: 100%;
    height: 100%;
    overflow: hidden;
    background: whitesmoke;
}

.dishCanvas,
.dishImage
{
    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    pointer-events: none;
}

.dishImage
{
    object-fit: cover;
}

body
{
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: "Monaspace Krypton", monospace;
}

button,
input,
select,
textarea,
pre
{
    font: inherit;
}

#appVersionBadge
{
    position: fixed;
    z-index: 20;
    top: .5em;
    right: .5em;

    /* padding: .2em .45em; */

    /* color: #101418; */
    /* border: 1px solid rgba(16, 20, 24, .25); */
    /* border-radius: .35rem; */
    /* background: rgba(255, 255, 255, .82); */

    font-size: .75rem;
    /* font-weight: 700; */
    /* line-height: 1; */
    /* pointer-events: none; */
}

button
{
    border: .5px solid #010101;
    border-radius: 1.3px;
    background: white;
    box-shadow: 1px 1px 1px rgba(0, 0, 0, .51),
    0 0 1px rgba(13, 13, 13, .51);
}

#picker
{
    --picker-control-width: min(28rem, calc(100vw - 5.5rem));
    --graph-axis-width: 3rem;
    --graph-axis-gap: .65rem;

    position: relative;
    z-index: 2;

    margin: 0 auto;
    padding: 1rem 1rem 2rem;

    color: #101418;
    text-align: center;
    transition: color 140ms ease-out;
}

#picker a,
#picker a:visited
{
    color: #1d4ed8;
    transition: color 140ms ease-out;
}

#picker small,
.temperatureBrightnessGraphSubtitle,
.temperatureBrightnessGraphYAxis,
.temperatureBrightnessGraphXAxis
{
    color: rgba(16, 20, 24, .8);
}

#brightnessStatus
{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .18rem;
    flex-wrap: wrap;
}

.hdrToggleInline
{
    display: inline-flex;
    align-items: center;
    gap: .3rem;

    width: auto;
}

#advanced textarea,
#advanced button
{
    color: #101418;
}

.pickerControlRow
{
    margin: .5rem 0 0;
}

.hdrToggleLabel
{
    display: inline-flex;
    align-items: center;
    gap: .45rem;

    width: auto;
    max-width: 100%;
}

.temperatureBrightnessGraph
{
    width: var(--picker-control-width);
    margin: 0 auto 1.15rem;
}

.temperatureBrightnessGraphHeader
{
    margin-bottom: .5rem;
}

.temperatureBrightnessGraphTitle,
.temperatureBrightnessGraphSubtitle
{
    margin: 0;
}

.temperatureBrightnessGraphTitle
{
    font-weight: 700;
}

.temperatureBrightnessGraphSubtitle
{
    font-size: .9rem;
}

.temperatureBrightnessGraphBody
{
    width: 100%;
}

.temperatureBrightnessGraphYAxis
{
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(-1 * (var(--graph-axis-width) + var(--graph-axis-gap)));

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    width: var(--graph-axis-width);
    padding: .2rem 0;

    text-align: right;
    font-size: .78rem;
}

.temperatureBrightnessGraphPlot
{
    display: flex;
    flex-direction: column;
    gap: .35rem;

    width: 100%;
}

.temperatureBrightnessGraphStageWrap
{
    position: relative;
    width: 100%;
}

.temperatureBrightnessGraphStage
{
    position: relative;

    overflow: visible;

    aspect-ratio: 5 / 4;
    border: 1px solid rgba(15, 15, 15, .35);
    border-radius: .9rem;

    cursor: crosshair;
    background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .02));
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

@media (pointer: coarse)
{
    .temperatureBrightnessGraphStage
    {
        touch-action: none;
    }
}

.temperatureBrightnessGraph--disabled .temperatureBrightnessGraphStage
{
    cursor: crosshair;
}

.temperatureBrightnessGraph--customColorActive .temperatureBrightnessGraphStage
{
    background: transparent;
}

#temperatureBrightnessGraphCanvas
{
    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 100%;
    border-radius: inherit;
    pointer-events: none;
}

.temperatureBrightnessGraphHandle
{
    position: absolute;
    z-index: 2;

    width: 16px;
    height: 16px;

    transform: translate(-50%, -50%);

    border: 2px solid #090909;
    border-radius: 50%;
    background: transparent;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .85);
    pointer-events: none;
}

.temperatureBrightnessGraph--disabled .temperatureBrightnessGraphHandle
{
    opacity: .45;
}

.temperatureBrightnessGraph--customColorActive .temperatureBrightnessGraphHandle
{
    opacity: 0;
}

.temperatureBrightnessGraphNotice
{
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 50%;

    max-width: 80%;
    padding: .55rem .75rem;

    transform: translate(-50%, -50%);

    color: #fffaf1;
    border-radius: .75rem;
    background: rgba(10, 12, 14, .72);

    font-size: .82rem;
    line-height: 1.35;
    pointer-events: none;
}

.temperatureBrightnessGraphXAxis
{
    display: flex;
    justify-content: space-between;

    font-size: .78rem;
}

label
{
    display: inline-block;

    width: 100%;
}

input
{
    width: 100%;
    margin: .4rem;
}

input[type='checkbox']
{
    width: auto;
    margin: 0;
}

#advanced
{
    display: block;
    box-sizing: border-box;
    width: var(--picker-control-width);
    margin: 1rem auto 0;
    padding: 1em;

    border: 2px solid white;
    background: rgba(255, 255, 255, .35);
}

textarea
{
    overflow: auto;
    box-sizing: border-box;
    width: 100%;
}

#thumbnail
{
    display: inline-block;

    width: 1em;
    height: 1em;
    margin-right: .2em;

    content: ' ';

    border: .5px solid white;
    background: whitesmoke;
}

.hidden
{
    display: none !important;
}

#webcamPreview
{
    position: fixed;
    z-index: 3;
    bottom: .5em;
    left: calc(env(safe-area-inset-left, 0px) + .5em);

    margin: 0;
}

#videoContainer
{
    position: fixed;
    z-index: 3;
    bottom: .5em;
    left: calc(env(safe-area-inset-left, 0px) + .5em);

    margin: 0;
    overflow: visible;
    box-sizing: border-box;
    width: 8em;
    min-width: 8em;
    max-width: 24em;
    height: 6em;
    min-height: 6em;
    max-height: min(18em, calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 1em));

    user-select: none;

    touch-action: none;
}

@media (min-width: 900px)
{
    #videoContainer
    {
        width: 12em;
        min-width: 12em;
        height: 9em;
        min-height: 9em;
    }
}

#videoContainer:not(.hidden):hover #resizeWebcamPreview
{
    display: block;
}

@media (pointer: coarse)
{
    #videoContainer:not(.hidden) #resizeWebcamPreview
    {
        display: block;
    }
}

#videoElement
{
    display: block;
    width: 100%;
    height: 100%;
    border-radius: .35rem;
    object-fit: cover;
    object-position: center;
}

#resizeWebcamPreview
{
    position: absolute;
    z-index: 999;
    top: -.75em;
    right: -.75em;

    display: none;

    width: 1.5em;
    height: 1.5em;
    margin: 0;
    padding: 0;

    transform: rotate(-45deg);

    border-radius: 50%;
    background: white;
    box-shadow: 1px 1px 1px #000,
    0 0 1px #0d0d0d;
}

#resizeWebcamPreview:hover
{
    cursor: nesw-resize;
}
#resizeWebcamPreview:focus
{
    outline: none;
}

#debugOverlay
{
    position: fixed;
    z-index: 4;
    top: .75rem;
    right: .75rem;

    max-width: min(28rem, calc(100vw - 1.5rem));
    margin: 0;
    padding: .75rem .875rem;

    color: #f4f0eb;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: .5rem;
    background: rgba(12, 17, 20, .82);

    font-size: .8rem;
    line-height: 1.4;
    white-space: pre-wrap;
    pointer-events: none;
}
