@media (width >= 1000px) {
    html, body {
        height: 100%;
    }

    body {
        display: flex;
        flex-direction: column;
    }

    #middle {
        flex: 1 0 0;
        width: 100%;
        margin: 1em auto;
        padding: 0 0.75rem;
        display: flex;
        gap: 1em;
        justify-content: center;
    }

    #editor-frame,
    #output {
        flex: 1 0 0;
    }

    #editor-frame {
        display: flex;
        flex-direction: column;
    }

    #editor {
        flex: 1 0 0;
    }
}

@media (width < 1000px) {
    #editor-frame,
    #output {
        margin: 0.75em;
    }

    #editor {
        resize: vertical;
    }

    #editor:not([style*="height"]) {
        /* set a default max-height of 20 lines that is resizable (resizing will set
         * style="height: ..." which invalidates this style) */
        max-height: calc(20em * var(--bs-body-line-height) + .375rem * 2);
    }
}

#editor {
    /* make the editor scrollable */
    overflow: auto;
}

/* Match the appearance of a Bootstrap <textarea>, including the focused state
 * (for accessibility). */
#editor {
    border: solid 1px var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    box-shadow: var(--bs-box-shadow-inset);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
#editor > .cm-editor {
    background-color: var(--bs-body-bg);
    outline: initial;
    height: 100%;
}
#editor .cm-content {
    padding: .375rem 0; /* match Bootstrap in vertical padding */
}
#editor .cm-scroller {
    line-height: var(--bs-body-line-height); /* match Bootstrap */
}
#editor:has( > .cm-focused) {
    box-shadow: var(--bs-box-shadow-inset), 0 0 0 0.25rem rgba(4, 110, 143, 0.25);
    border-color: #82b7c7;
}

/* Integrate editor into the tabbar */
#editor {
    border-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}
