:root {
    color-scheme: dark;
    --paper: #16074e;
    --ink: #dbd9c9;
    --muted: #85867a;
    --line: #41433b;
    --ember: #db956f
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 12px 'Courier New', monospace;
    overflow: hidden
}

button,
input,
a {
    -webkit-tap-highlight-color: transparent
}

button,
a {
    color: inherit
}

button {
    font: inherit;
    background: none;
    border: 0;
    cursor: pointer
}

button:hover,
a:hover {
    color: #fff
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 1px solid var(--ember);
    outline-offset: 5px
}

button:disabled {
    opacity: .35;
    cursor: wait
}

#field {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    touch-action: none
}

header {
    position: fixed;
    left: 42px;
    top: 38px;
    pointer-events: none
}

h1 {
    letter-spacing: .23em;
    margin: 0 0 12px
}

header p {
    font-size: 8px;
    letter-spacing: .19em;
    color: var(--muted);
    margin: 0
}

#orientation {
    position: fixed;
    right: 42px;
    top: 37px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--muted)
}


#orientation i {
    width: 38px;
    height: 1px;
    background: var(--line)
}

#orientation small {
    font-size: 9px
}

#empty {
    position: absolute;
    left: 50%;
    top: 49%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 340px;
    padding: 25px;
    background: radial-gradient(ellipse, #16074e 30%, transparent 72%)
}

#empty p {
    letter-spacing: .02em;
    margin: 0 0 23px
}

#empty button {
    display: block;
    margin: 12px auto;
    font-size: 10px;
    border-bottom: 1px solid var(--line);
    padding: 4px 0
}

#empty span {
    font-size: 9px;
    color: var(--muted)
}

#annotation {
    position: fixed;
    pointer-events: none;
    width: 112px;
    text-shadow: 0 1px 6px #111210
}

#spectrogram {
    display: block;
    width: 112px;
    height: 56px;
    border: 1px solid rgba(222, 220, 198, .18);
    background: #111210
}

#annotation small {
    display: block;
    font-size: 9px;
    color: var(--muted);
    margin-top: 4px;
    text-align: right
}

#readout {
    position: fixed;
    left: 42px;
    bottom: 93px;
    color: var(--muted);
    font-size: 9px;
    max-width: 70vw;
    pointer-events: none
}

.transport {
    position: fixed;
    left: 42px;
    bottom: 35px;
    display: flex;
    align-items: center;
    gap: 24px
}

.transport button {
    font-size: 10px;
    letter-spacing: .12em;
    padding: 8px 0
}

#play {
    display: flex;
    align-items: center;
    gap: 13px;
    width: 94px;
    text-align: left
}

#playGlyph {
    line-height: 20px
}

#playWord {
    font-size: 9px;
    letter-spacing: .15em
}

.separator {
    width: 1px;
    height: 16px;
    background: var(--line)
}

.volume {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 8px;
    color: var(--muted);
    letter-spacing: .1em
}

input[type=range] {
    appearance: none;
    background: var(--line);
    height: 1px;
    width: 80px;
    cursor: pointer
}

input[type=range]::-webkit-slider-thumb {
    appearance: none;
    width: 7px;
    height: 7px;
    border: 1px solid var(--ink);
    border-radius: 50%;
    background: var(--paper)
}

input[type=range]::-moz-range-thumb {
    width: 7px;
    height: 7px;
    border: 1px solid var(--ink);
    border-radius: 50%;
    background: var(--paper)
}

#indexButton {
    font-size: 8px;
    color: var(--muted)
}

#operatorButton {
    font-size: 20px;
    color: var(--muted)
}

.footnote {
    position: fixed;
    right: 42px;
    bottom: 45px;
    display: flex;
    gap: 26px;
    font-size: 8px;
    letter-spacing: .12em;
    color: var(--muted);
    pointer-events: none
}

dialog {
    color: var(--ink);
    background: #171914;
    border: 1px solid #4b4e43;
    padding: 26px;
    width: 440px;
    max-width: calc(100vw - 32px);
    max-height: 85vh;
    overflow: auto;
    box-shadow: 0 0 0 1px #000;
    font-size: 11px
}

dialog::backdrop {
    background: #080a08b8;
    backdrop-filter: blur(2px)
}

.dialog-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px
}

.dialog-head h2 {
    margin: 0
}

.dialog-head button {
    font-size: 24px
}

.muted {
    color: var(--muted);
    line-height: 1.8
}

.drop {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 13px;
    align-items: center;
    padding: 24px 15px;
    border: 1px dashed var(--line);
    margin: 24px 0;
    cursor: pointer;
    text-align: center
}

.drop input {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    cursor: pointer
}

.drop small {
    color: var(--muted);
    line-height: 1.8;
    font-size: 9px
}

.drop.dragover {
    border-color: var(--ember)
}

#fileName {
    max-width: 100%;
    overflow-wrap: anywhere;
    color: var(--ember);
    font-size: 10px
}

.control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 22px 0;
    color: var(--muted)
}

.control-row input {
    width: 130px
}

.token {
    display: block;
    color: var(--muted);
    margin-top: 25px;
    font-size: 9px
}

.token input {
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font: 10px monospace;
    width: 100%;
    padding: 9px 0;
    margin-top: 3px
}

#uploadButton {
    border: 1px solid var(--line);
    padding: 12px 15px;
    width: 100%;
    text-align: left;
    margin: 24px 0 8px;
    color: var(--ink)
}

progress {
    width: 100%;
    height: 2px;
    accent-color: var(--ember);
    margin-top: 16px
}

#jobMessage {
    font-size: 10px;
    line-height: 1.7
}

#operatorError {
    color: #e5a38d;
    line-height: 1.7;
    margin: 10px 0
}

.material-heading {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--line);
    padding-top: 22px;
    margin-top: 20px;
    font-size: 9px;
    letter-spacing: .1em
}

.material-heading a {
    text-decoration: none;
    color: var(--muted)
}

.source {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    border-bottom: 1px solid #2f322a;
    padding: 15px 0;
    line-height: 1.6
}

.source span {
    overflow-wrap: anywhere
}

.source small {
    font-size: 9px;
    color: var(--muted)
}

.source button {
    grid-column: 2;
    grid-row: 1/3;
    color: var(--muted);
    font-size: 18px
}

.tiny {
    font-size: 9px;
    margin-top: 22px
}

#indexList {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px
}

#indexList button {
    padding: 12px;
    border: 1px solid var(--line);
    text-align: left
}

#indexList small {
    display: block;
    color: var(--muted);
    margin-top: 5px
}

[hidden] {
    display: none !important
}

@media(max-width:650px) {
    header {
        left: 24px;
        top: 27px
    }

    h1 {
        font-size: 19px
    }

    #orientation {
        right: 24px;
        top: 26px
    }

    #orientation i {
        display: none
    }

    .transport {
        left: 24px;
        bottom: 25px;
        gap: 17px
    }

    .footnote {
        right: 24px;
        bottom: 81px
    }

    #mode {
        display: none
    }

    #readout {
        left: 24px;
        bottom: 84px;
        max-width: 65vw
    }

    .volume input {
        width: 45px
    }

    .volume {
        gap: 8px
    }

    #indexButton {
        font-size: 7px
    }

    header p {
        font-size: 7px
    }

    .transport button {
        padding: 12px 0
    }
}