html {
    height: 100%;
    display: flex;
    color-scheme: light dark;
}

body {
    flex: 1;
    display: flex;
    flex-flow: column;
    gap: 0.25em;
}

#io {
    font-family: consolas, monospace;       /* 9.0 */
    
    &:empty {
        display: none;
    }
    
    .output {
        line-break: anywhere;
        white-space: pre-wrap;
    }

    .input {
        white-space: pre-wrap;
    }

    .input>b {
        line-break: anywhere;
        outline: none;
    }
}

#ui {
    position: relative;

    &:empty {
        display: none;
    }

    output:empty {
        border-left: dotted;

        &::before {
            content: '\200B';
        }
    }

    fieldset {
        width: fit-content;
        margin: 0.5em 0;
    }

    label {
        &.block {
            display: flex;
            margin: 0.25em 0;
        }

        &.inline {
            display: inline-flex;
            margin: 0.25em 0.5em 0.25em 0;

            &:last-of-type {
                margin-right: 0;
            }
        }

        &.top {
            flex-direction: column;
            align-items: flex-start;
        }

        &.right {
            flex-direction: row-reverse;
            gap: 0.25em;
            justify-content: flex-end;
        }

        &.bottom {
            flex-direction: column-reverse;
            align-items: flex-start;
        }

        &.left {
            flex-direction: row;
            align-items: flex-start;
            gap: 0.25em;
        }
    }
}

#canvas {           /* 9.0 */
    flex: 1;
    position: relative;
    
    &:focus {
        outline: dotted;
    }
    
    canvas {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        min-height: 150px;
    }
}

.error {
    background-color: red;
    color: white;
    position: fixed;
    bottom: 4px;
    left: 0;
    width: 100%;
    z-index: 1
}