:root {
    --theme-colour: #368EFF;
    /* #EF6351; */

    --colour-1: #295498;
    --colour-2: #db4437;
    --colour-3: #f4b400;
    --colour-4: #0f9d58;
    --colour-5: #ab47bc;
    --colour-6: #00acc1;
    --colour-7: #ff7043;
    --colour-8: #9e9d24;
    --colour-9: #5c6bc0;
    --colour-10: #f06292;
}

@font-face {
    font-family: 'Source Sans 3';
    font-weight: 400;
    font-style: normal;
    font-stretch: normal;
    src: url('../fonts/SourceSans3-Regular.ttf.woff2') format('woff2'),
        url('../fonts/SourceSans3-Regular.otf.woff') format('woff');
}

@font-face {
    font-family: 'Source Sans 3';
    font-weight: 400;
    font-style: italic;
    font-stretch: normal;
    src: url('../fonts/SourceSans3-It.ttf.woff2') format('woff2'),
        url('../fonts/SourceSans3-It.otf.woff') format('woff');
}

@font-face {
    font-family: 'Source Sans 3';
    font-weight: 700;
    font-style: normal;
    font-stretch: normal;
    src: url('../fonts/SourceSans3-Bold.ttf.woff2') format('woff2'),
        url('../fonts/SourceSans3-Bold.otf.woff') format('woff');
}

@font-face {
    font-family: 'Source Sans 3';
    font-weight: 700;
    font-style: italic;
    font-stretch: normal;
    src: url('../fonts/SourceSans3-BoldIt.ttf.woff2') format('woff2'),
        url('../fonts/SourceSans3-BoldIt.otf.woff') format('woff');
}

html {
    font-family: 'Source Sans 3', Arial;
    margin: 0 auto;
    max-width: 1200px;
}

body {
    background-color: white;
    margin: 0;
    margin-bottom: 2px;
    /* margin-bottom: calc(20px + 2.5em); */
    padding: 0 3px;
}

header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-left: 10px;
    /* background-color: var(--theme-colour);
    color: #000; */
    /*#EF6351*/
    background: linear-gradient(-45deg, var(--theme-colour), color-mix(in srgb, var(--theme-colour) 80%, red), color-mix(in srgb, var(--theme-colour) 80%, #eeff00), color-mix(in srgb, var(--theme-colour) 80%, blue), var(--theme-colour));
    background-size: 400% 400%;
    animation: gradient 15s cubic-bezier(.79, .14, .15, .86) infinite;

    color: #fff;
    padding: 10px 20px;
    /* padding-top: 0; */

    h1 {
        a {
            color: inherit;
            text-decoration: none;
        }

        a:hover {
            text-decoration: underline;
        }
    }
}

a {
    color: var(--theme-colour);
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

header .top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0 10px;
    align-items: center;
    margin-bottom: 10px;

    .logo {
        display: flex;
        flex-direction: row;
        font-size: min(max(1.5vh, 1em), 1.5em);
        align-items: center;
        gap: 15px;
        line-height: 1em;

        img.site-logo {
            height: calc(min(max(1.0vh, 0.8em), 1.5em) * 3);
            filter: drop-shadow(1px 0px 0px #888) drop-shadow(-1px 0px 0px #888) drop-shadow(0px 1px 0px #888) drop-shadow(0px -1px 0px #888) drop-shadow(5px 5px 4px rgba(68, 68, 68, 0.46))
        }
    }

    .links {
        display: flex;
        gap: 0 15px;
        flex-wrap: wrap;

        a {
            color: white;
            text-decoration-style: dotted;
            text-decoration-thickness: from-font;
        }

        a.emphasis {
            font-weight: bold;
        }
    }
}

header .mid {
    height: 10vh;
    text-transform: capitalize;
    font-weight: bold;
    font-size: min(max(3vh, 1.5em), 3em);
    ;

    display: flex;
    align-items: center;
    justify-content: center;

    .content {
        align-self: center;
        text-align: center;
    }
}

div.tools {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.container {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 5px;
}

#input-command {
    /* min-height: 2.5em; */
    width: 100%;
    box-sizing: border-box;
    field-sizing: content;
    padding: 1em;
}

legend {
    font-size: larger;
    font-weight: bold;
}

legend>span {
    margin-right: 2px;
}

fieldset.collapsible>legend {
    cursor: pointer;
}

div.option {
    background: rgb(245, 245, 245);
    border-radius: 5px;
    color: black;
    font-size: small;
    font-weight: bold;
    display: flex;
    gap: 5px;
    padding: 2px;
}

div.option>div.title {
    display: flex;
}

div.body {
    flex-grow: 1;
}

.probs-container {
    float: right;
}

.probs-slider {
    width: 40px;
    border: 1px solid var(--theme-colour);
    color: var(--theme-colour);
}

div.option>div.drag {
    width: 30px;
    min-width: 30px;
    text-align: center;
    align-self: center;
    cursor: grab;
}

div.body input {
    accent-color: var(--theme-colour);
}

div.body input[type=text] {
    flex-grow: 1;
}

div.body input[type=text]:placeholder-shown,
div.body textarea:placeholder-shown {
    accent-color: rgb(202, 8, 8);
    border: 1px solid rgb(202, 8, 8);
    background: #f6e2e2;
    color: black;
}

div.suboptions {
    align-items: center;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    font-size: small;
    font-weight: normal;
    padding-left: 22px;
}

div.suboptions>div {
    display: flex;
    gap: 5px;
    flex-direction: column;
    flex-wrap: wrap;
}

div.suboptions>div>div.suboption {
    flex-grow: 1;
    display: flex;
    gap: 5px;
    align-items: center;
}

div.suboptions>div.flex-row {
    align-items: center;
    flex: 100%;
    flex-direction: row;
    justify-content: start;
}

div.suboptions>div.flex-row label {
    margin-right: 5px;
}

a.explain {
    color: inherit;
    text-decoration: underline dotted;
    text-decoration-thickness: from-font;
}

a.explain::after {
    color: #aaa;
    content: '?';
    background-color: #99abb0;
    font-size: small;
    margin: 3px;
    padding: 0px 4px;
    color: white;
    font-weight: normal;
    font-size: smaller;
    text-decoration: none;
}

#tokens,
#output-command {
    min-height: 1.5em;
}

#tokens div.token,
#input-command,
#output-command,
code,
.suboption textarea {
    font-family: Monaco, Menlo, Consolas, 'Droid Sans Mono', Inconsolata, 'Courier New', monospace;
}

#tokens {
    align-content: flex-start;
    counter-reset: token-counter 0;
    display: flex;
    flex-wrap: wrap;
    gap: 2px 4px;
}

#output-command {
    padding: 5px;
    overflow-wrap: anywhere;
}

#output-command>div {
    padding: 2px;
}

#tokens div.token {
    background: white;
    color: black;
    border: 1px solid #ccc;
    border-radius: 5px;
    counter-increment: token-counter 1;
    cursor: pointer;
    padding: 2px;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
}

#tokens div.token[data-type="disabled"] {
    background: #bbb;
    color: #666;
}

#tokens div.token[data-type="disabled"]::before {
    background: #666;
    color: #bbb;
}

#tokens div.token[data-type="command"]::before {
    background: var(--colour-2);
    color: white;
}

#tokens div.token[data-type="path"]::before {
    background: var(--colour-3);
    color: white;
}

#tokens div.token[data-type="url"]::before {
    background: var(--colour-4);
    color: white;
}

#tokens div.token[data-type="value"]::before {
    background: var(--colour-5);
    color: white;
}

#tokens div.token::before {
    background: var(--colour-1);
    color: white;
    content: counter(token-counter);
    font-size: x-small;
    margin-right: 5px;
    padding: 0 4px;
    font-family: Arial;
    border-radius: 3px;
}

#tokens div.token[data-type="disabled"]::before {
    color: #333;
}

#tokens .token-holder, .controls {
    position: relative;
}

@media screen and (max-width: 700px) {
    .container {
        flex-wrap: wrap;
    }

    img.pct80-width {
        width: 100% !important;
    }
}

@media screen and (max-width: 1200px) {
    header {
        margin: 0 -3px;
    }
}

.picker {
    position: relative;
}

.context-menu {
    background: white;
    color: black;
    border: 1px solid grey;
    display: none;
    padding: 1px;
    position: absolute;
    z-index: 2;
    max-height: 15em;
    overflow-y: auto;
    min-width: max-content;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
}

.context-menu>* {
    padding: 2px 10px;
}

.context-menu>li {
    cursor: pointer;
    list-style-type: none;
}

.context-menu>li:hover {
    background-color: #ddd;
}

.context-menu>li[data-active="true"] {
    background: color-mix(in srgb, var(--theme-colour) 50%, #000000);
    /*(19, 75, 163);*/
    color: white;
}

section {
    background-color: color-mix(in srgb, var(--theme-colour) 7%, white);
    /*#fbfbfb;*/
    padding: 1em;
    margin: 10px 0;

    h1,
    h2 {
        margin-top: 0;
    }
}

section:last-of-type {
    margin-bottom: 0;
}


fieldset {
    background: color-mix(in srgb, var(--theme-colour) 5%, white);
    margin: 0;
    border: 0;
    border: 1px solid #ddd;
    border-radius: 3px;
}

fieldset,
#options-panel-options {
    display: flex;
    flex-direction: column;
    gap: 5px 0px;
}

#options-panel-options {
    margin-top: 10px;
}

fieldset[disabled] {
    background: lightgray;
    color: gray;
}

fieldset>legend {
    background: white;
    border-radius: 5px;
    color: color-mix(in srgb, var(--theme-colour) 80%, black);
    padding: 0 5px;
}

.button,
.button-inverted {
    cursor: pointer;
    display: inline-block;
    padding: 5px;
    text-decoration: none;
    user-select: none;
    border-radius: 5px;
}

.button {
    border: 1px solid var(--theme-colour);
    color: var(--theme-colour);
}

.button-inverted {
    background-color: var(--theme-colour);
    color: white;
}

.button-primary {
    background: white;
}

.button:hover,
.button-inverted:hover,
.button:hover a,
.button-inverted:hover a {
    transition: all .2s ease-in;
}

.button:hover {
    background: var(--theme-colour);
    color: white;
    border-color: white;
}

.button-inverted:hover {
    background: white;
    color: var(--theme-colour);
    border-color: var(--theme-colour);
}

.button:hover a {
    color: white;
}

.button-inverted:hover a {
    color: var(--theme-colour);
}

/*** Drag & drop ***/
.slist>div {
    border: 1px solid #dfdfdf;
    background: #f5f5f5;
}

.slist>div.hint {
    border: 1px solid var(--theme-colour);
    /* background: ; */
}

.slist>div.active {
    border: 1px dotted #ffa5a5;
    background: var(--theme-colour);
    color: white;
}

footer {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    background: color-mix(in srgb, var(--theme-colour) 10%, white);
    color: black;
    border-top: 1px solid white;
    margin: 0 auto;
}

#obfuscation-bar {
    max-width: 1200px;
    position: relative;
    margin: 0px auto;
    padding: 10px 10px;
    display: flex;
    gap: 3px;
}

#obfuscation-bar span>a {
    color: black;
}

#obfuscation-bar>div.fill {
    flex-grow: 1;
}

#obfuscation-bar>* {
    align-self: center;
}

.inbetween {
    height: 5px;
    background: grey;
}

#json-file {
    display: none;
}

#error-messages {
    min-width: min-content;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#error-messages>* {
    background: #fff3cd;
    border-radius: 0.2em;
    border: 1px solid rgb(240, 163, 48);
    color: #856404;
    flex-grow: 1;
    line-height: 1.4em;
    padding: 5px;
}

#error-messages a {
    color: var(--theme-colour);
}

#error-messages code {
    word-break: break-all;
}

.drag-list {
    list-style: none;
    padding: 0;
}

.drag-item {
    background-color: #CC56FF;
    padding: 10px;
    margin-bottom: 5px;
    cursor: move;
}

.collapsed {
    display: none !important;
}

.button-selection {
    display: flex;
    gap: 2px 5px;
    flex-wrap: wrap;
}

.button-selection .fill {
    flex-grow: 1;
}

.button-selection .button {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-wrap: nowrap;
}

.suboption textarea {
    width: 100%;
    height: 65px;
}

.command-bar {
    display: flex;
    gap: 5px;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
}
.command-bar > div {
    position: relative;
}

.command-bar>a {
    min-width: fit-content;
}

.command-bar #feeling-lucky a {
    color: #ededed;
    text-decoration: underline dotted;
    text-decoration-thickness: from-font;
    cursor: pointer;
}

@media (prefers-color-scheme: dark) {
    body {
        background-color: #282828;
        color: white;
    }

    .slist>div,
    .context-menu {
        border-color: #555;
        background: #3e3e3e;
        color: white;
    }

    fieldset,
    section {
        background: rgb(70, 70, 70);
        color: white;
        border-color: #555;

        .button {
            border: 1px solid #555;
            background-color: color-mix(in srgb, var(--theme-colour) 80%, #000000);
            color: white;
            /* color-contrast(var(--theme-colour) vs white, black); */
        }

        .button:hover {
            border-color: color-mix(in srgb, var(--theme-colour) 80%, #000000);
            color: color-mix(in srgb, var(--theme-colour) 80%, #000000);
            background: white;
        }

        .suboption textarea,
        input[type=text] {
            background: #666;
            color: white;
        }
    }

    fieldset>legend {
        background-color: color-mix(in srgb, var(--theme-colour) 80%, #000000);
        color: white;
    }

    .context-menu>li:hover {
        background-color: #555;
    }

    code {
        color: color-mix(in srgb, var(--theme-colour) 80%, #ffffff) !important;
    }

    section a {
        color: color-mix(in srgb, var(--theme-colour) 80%, #ffffff);
    }

    table.comparison tbody {
        background-color: color-mix(in srgb, var(--theme-colour) 5%, #555) !important;
    }
}

h2>a {
    color: white;
    text-decoration: none;
    ;
}

h2 {
    margin-bottom: 5px;
}

ul {
    padding-left: 1em;
}

ul.dynamic-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    grid-gap: 0 2em;
}

table.comparison thead>tr {
    background-color: var(--theme-colour);
    color: white;
}

table.comparison td:first-child {
    padding-left: 0.5em;
}

table.comparison td:not(:first-child) {
    text-align: center;
}

table.comparison tbody {
    background-color: color-mix(in srgb, var(--theme-colour) 5%, color-mix(in srgb, var(--theme-colour) 7%, white));
}

div.comparison-container {
    overflow-x: auto;
}

code {
    color: color-mix(in srgb, var(--theme-colour) 70%, #000000);
    font-size: calc(100% - 2px);
}

img.full-width {
    width: 100%;
}

img.pct80-width {
    display: block;
    margin: auto;
    width: 80%;
}

#output-command .hidden,
#output-command>.hidden+.space {
    display: none;
}

#options-accepted-arguments {
    display: flex;
    flex-wrap: wrap;
}

#options-accepted-arguments textarea {
    flex: 1;
    height: 150px;
}

div.output-controls {
    position: relative;
}

div.output-controls > .button {
    position: absolute;
    top: 0;
    right: 0;
}

#profile-selected {
    font-size: small;
}
