body {
    margin: 0;
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    flex-direction: row;

    --color-primary-dark: #5E0B15;
    --color-primary-light: #90323D;

    --color-alt-dark: #BC8034;
    --color-alt-light: #CBA574;

    --color-gray-light: #C5C9C7;
    --color-gray-medium: #A0989F;
    --color-gray-dark: #7A6677;

    --color-white: #f0f0f0;
    --color-black: #101010;
}

body.resize-horizontal, body.resize-vertical {
    user-select: none;
}

body.resize-horizontal {
    cursor: col-resize;
}

body.resize-vertical {
    cursor: row-resize;
}

#editor {
    display: flex;
    flex-direction: column;
    width: calc(65% - 0.5em);
    height: 100%;
    align-items: flex-start;
}

#editor-canvas {
    width: 100%;
    height: 100%;
    flex-grow: 1;
    flex-shrink: 1;
}

#editor-canvas.drag {
    cursor: grab;
}

#editor-toolbox {
    color: #202020;
    width: 100%;
    flex-wrap: wrap;
    font-size: 10pt;
    min-height: 1.9em;
    font-family: monospace;

    display: flex;
    flex-direction: row;
    padding-left: 0.3em;
}

#editor-toolbox > span {
    margin-left: 0.2em;
    margin-right: 0.2em;
    line-height: 1.9em;
}

button, input[type="text"], .button {
    all: unset;
    font-size: inherit;
    color: inherit;
    font-family: inherit;
    height: 1.7em;
    line-height: 1.3em;
    box-sizing: border-box;
    padding: 0.2em 0.4em;
    margin-left: 0.2em;
    margin-right: 0.2em;
    margin-bottom: 0.1em;
    margin-top: 0.1em;
    border-radius: 1px;
}

button, .button {
    cursor: pointer;
    user-select: none;
    position: relative;
    margin-top: 0.1em;
    margin-bottom: 0.1em;
}

#editor-toolbox > button, #editor-toolbox > input[type="text"] {
    display: block;
    box-shadow: 0px -1px 4px -2px transparent;
    border: 1px solid #D9CAB3;
    background-color: transparent;
    transition: background-color 0.2s, box-shadow 0.2s, border 0.2s, color 0.2s;
}

#editor-toolbox > button:hover {
    cursor: pointer;
    box-shadow: 0px -1px 4px -2px rgba(0, 0, 0, 0.5);
    border-color: var(--color-alt-dark);
    background-color: var(--color-alt-light);
}

#editor-toolbox > button:active {
    background-color: var(--color-alt-dark);
    border-color: var(--color-primary-light);
}

#editor-toolbox > button.active:hover {
    background-color: var(--color-primary-dark);
    border-color: var(--color-black);
}

#editor-toolbox > button.active {
    border-color: var(--color-primary-dark);
    background-color: var(--color-primary-light);
    color: white;
}


#editor-toolbox > input[type="text"]:hover {
    border: 1px solid var(--color-primary-dark);
    background-color: rgba(0, 0, 0, 0.1);
}

#editor-toolbox > input[type="text"]:focus {
    border: 1px solid var(--color-black);
}

#editor-toolbox > input[type="text"]::placeholder {
    color: var(--color-gray-dark);
    opacity: 1;
}

#editor-info {
    color: var(--color-gray-dark);
}

#editor-info.loading {
    font-style: italic;
}

#manipulate {
    width: calc(35% - 0.5em);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: 100vh;
    justify-content: stretch;
}

#resizer {
    background: var(--color-gray-light);
    width: 1em;
    position: relative;
    cursor: col-resize;
}

#resizer > div, #resizer > div::before {
    content: "";
    position: absolute;
    width: 0.1em;
    height: 4em;
    background: var(--color-primary-light);
    transform: translate(-50%, -50%);
}

#resizer > div {
    left: calc(50% + 0.1em);
    top: 50%;
}

#resizer > div::before {
    left: -0.2em;
    top: 50%;
}

#settings {
    background: var(--color-gray-medium);
    font-family: monospace;
    font-size: 12pt;
}

.settings input[type="text"], .settings button, .settings .button {
    background: var(--color-white);
    border: 1px solid var(--color-primary-dark);
    border-radius: 2px;
    box-shadow: 0px 2px 4px -2px transparent;
    transition: background-color 0.2s, box-shadow 0.2s, border 0.2s, color 0.2s;
}

.settings input::placeholder {
    opacity: 1;
    color: var(--color-gray-dark);
}

.settings input:hover, .settings input:focus {
    box-shadow: 0px 2px 4px -2px rgba(0, 0, 0, 0.5);
}

.settings input.small {
    width: 5em;
}

.settings button:hover, .settings .button:hover {
    border: 1px solid var(--color-black);
    background-color: var(--color-alt-light);
    box-shadow: 0px 2px 4px -2px rgba(0, 0, 0, 0.5);
}

.settings button:active, .settings .button:active,
.settings button.active, .settings .button.active {
    border: 1px solid var(--color-black);
    background-color: var(--color-alt-dark);
}


h2 {
    margin: 0.5em 0;
    font-size: inherit;
}

#settings .flex {
    display: flex;
    flex-direction: row;
    margin-left: auto;
    margin-right: auto;
}

#settings .flex * {
    margin-left: 0.2em;
    margin-right: 0.2em;
}

#settings .flex.wrap {
    flex-wrap: wrap;
}

#import-menu {
    position: absolute;
    background: rgba(16, 16, 16, 0.3);
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none !important;
}

#import-menu > div {
    background: var(--color-white);
    width: calc(100% - 24em);
    min-height: calc(100% - 24em);
    display: flex;
    flex-direction: column;
    padding-left: 2em;
    padding-right: 2em;
    padding-bottom: 2em;
    padding-top: 1em;
    align-items: flex-start;
    font-family: monospace;
    font-size: 12pt;
}

#import-menu textarea {
    width: 100%;
    height: 24em;
    margin-bottom: 1em;
    font-family: monospace;
    font-size: 12pt;
}

#import-menu button, #import-menu .button {
    background: white;
}

#import-menu button:hover, #import-menu .button:hover {
    background: var(--color-alt-light);
}

#import-menu button:active, #import-menu .button:active,
#import-menu button.active, #import-menu .button.active {
    background: var(--color-alt-dark);
}

#import-menu-close {
    margin-bottom: 1em;
}

.upload {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
}

.upload > span {
    color: var(--color-gray-dark);
    margin-left: 0.5em;
    margin-right: 0.5em;
}

.flex-horizontal {
    display: flex;
    flex-direction: row;
    width: 100%;
}

.flex-end {
    justify-content: flex-end;
}

#preview {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;

    background: var(--color-white);
    color: var(--color-primary-dark);
    flex-grow: 1;
    flex-shrink: 1;
}

#preview-prompt {
    flex-grow: 0;
    flex-shrink: 0.5;
    height: 4em;
    margin: 0.5em 1em;
    resize: none;
}

#preview-canvas {
    flex-grow: 1;
    flex-shrink: 1;
    height: 4em;
}

#github-link {
    /* position: absolute;
    right: 1em;
    top: 1em; */
    order: 1;
}

.tabbed .tab {
    display: none;
}

.tabbed .tab.shown {
    display: block;
}

#settings > div:first-of-type {
    background: var(--color-gray-dark);
    display: flex;
    justify-content: space-between;
    padding-top: 0.2em;
    padding-bottom: 0.2em;
    padding-left: 1em;
    padding-right: 1em;
}

#settings > div:first-of-type button, #settings > div:first-of-type .button {
    background: var(--color-gray-dark);
    color: var(--color-white);
}

#settings > div:first-of-type button:hover, #settings > div:first-of-type .button:hover {
    background: var(--color-primary-light);
}

#settings > div:first-of-type button:active, #settings > div:first-of-type .button:active,
#settings > div:first-of-type button.active, #settings > div:first-of-type .button.active {
    background: var(--color-primary-dark);
}

#settings > div:nth-of-type(2) {
    padding: 0.5em 1em;
}

.button > select {
    appearance: none;
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    padding-right: 1em;
}

.button > select + i {
    font-style: normal;
    position: absolute;
    right: 0.5em;
    top: 0.1em;
}

.pad-vertical {
    padding-top: 0.2em;
    padding-bottom: 0.2em;
}
