html {
    height: 100%;
}

body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
}

main {
    flex-grow: 1;
    flex-basis: 0;
    display: flex;
    flex-direction: column;
}

#frame {
    order: 1;
    flex-basis: 0;
    flex-grow: 1;
}

#frame.mobile {
    width: 400px !important;
    height: 100%;
    flex-basis: auto;
    margin: 0 auto;
}

._left #frame.mobile, ._right #frame.mobile {
    flex-grow: 0;
}

main._top #frame, main._bottom #frame {
    height: 60%;
    width: 100%;
}

main._left #frame, main._right #frame {
    width: 60%;
    height: 100%;
}

#adjustbar {
    height: 8px;
    background-image:linear-gradient(45deg,rgba(251,249,246,.15) 25%,transparent 25%,transparent 50%,rgba(251,249,246,.15) 50%,rgba(251,249,246,.15) 75%,transparent 75%,transparent);
    background-size:1rem 1rem;
    background-color: #806e59 !important;
    margin-top: -5px;
    cursor: ns-resize;
    order: 2;
    z-index: 100;
}

main._left #adjustbar, main._right #adjustbar {
    height: 100%;
    width: 8px;
    cursor: ew-resize;
}

.editor-stack {
    height: 40%;
    display: flex;
    align-items: stretch;
    gap: 2px;
    background-color: var(--bs-light);
    order: 3;
    position: relative;
}

main._left .editor-stack, main._right .editor-stack {
    flex-direction: column;
}

main._left, main._right {
    flex-direction: row;
}

main._left .editor-stack, main._top .editor-stack {
    order: 1;
}

main._left #frame, main._top #frame {
    order: 3;
}

@media screen and (max-width: 768px) {
    .editor-stack {
        flex-direction: column;
    }
}

.editor-wrapper {
    flex-grow: 1;
    flex-basis: 0;
    display: flex;
    flex-direction: column;
}

.editor-header h3 {
    font-size: 12pt;
    margin: 0;
}

.ace-editor {
    flex-basis: 0;
    flex-grow: 1;
}

#editor-toggle {
    border: none;
    z-index: 1000;
    position: absolute;
    white-space: nowrap;
    margin: 15px;
}
._bottom #editor-toggle {
    bottom: 102%;
    right: 0;
}
._top #editor-toggle {
    top: 102%;
    right: 0;
}
._left #editor-toggle {
    left: 102%;
    top: 0;
}
._right #editor-toggle {
    right: 102%;
    top: 0;
}

._top .editor-stack.hidden #editor-toggle-arrow, ._bottom .editor-stack.hidden #editor-toggle-arrow {
    transform: scaleY(-1);
}
._left .editor-stack.hidden #editor-toggle-arrow, ._right .editor-stack.hidden #editor-toggle-arrow {
    transform: scaleX(-1);
}

._top .editor-stack.hidden, ._bottom .editor-stack.hidden {
    height: 0 !important;
}

._left .editor-stack.hidden, ._right .editor-stack.hidden {
    width: 0 !important;
}

.editor-stack.hidden .editor-header, .editor-stack.hidden .ace-editor {
    display: none !important;
}

#footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    padding: 5px 10px;
    order: 4;
    position: relative;
}

#footer.hidden {
    height: 0;
    overflow: hidden;
    padding: 0;
}

.footer-subsection {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

#footer label {
    margin-bottom: 0;
}

#footer-toggle {
    border: none;
    z-index: 1000;
}


.show-small {
    display: none;
}

@media only screen and (max-width: 575px) {

    #footer, .footer-subsection {
        display: inline;
    }

    .hide-small {
        display: none;
    }
    
    .show-small {
        display: initial;
    }
}