
:root{
    --acc-color: darkgrey;
    --border-width: 1px;
    --fs: 0.75rem;
    --border: var(--border-width) solid var(--acc-color);
}

/*  LAYOUT
===================================================================== */

body{
    display: grid;
    background-color: whitesmoke;
    min-height: 100vh;
    box-sizing: border-box;

    display: grid;
    grid-template-rows: min-content 1fr;

    line-height: 1.5;
    font-family: monospace;
    font-size: var(--fs);
}

body > header{
    padding: 1em;
    background-color: var(--acc-color);
    border-bottom: var(--border);
    
    display: flex;
    justify-content: space-between;
    gap: 1em;
}
h1{
    font-weight: bold;
}

body > main{
    padding: 0 1em 1em;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-row: auto;
    gap: 1em;
}

section{
    display: grid;
    grid-template-rows: min-content 1fr;
    overflow: hidden;

    position: relative;
}
section > header{
    padding-top: 1em;
}
strong{
    font-weight: bold;
}
hr{
    border: 0;
    margin: 1em 0;
    border-top: var(--border);
}
section > header button{
    display: block;

    line-height: 1.5;
    font-family: monospace;
    text-transform: lowercase;
    font-size: var(--fs);

    padding: 0.6em 1em 0.5em;
    border: var(--border);
    background-color: var(--acc-color);
    cursor: pointer;
    border-radius: 5em;

    font-weight: bold;
}
section > header label{
    display: block;
    color: dimgrey;
    padding-top: 0.5em;
}

/* section > header label::before{
    content: '(';
}
section > header label::after{
    content: ')';
} */

a, a:visited{
    color: currentColor;
    word-break: break-all;
}


/*  STDOUT
===================================================================== */

.stdout{
    background: white;
    border: var(--border);
    margin-top: 1em;
    white-space: pre;
    font-family: monospace;
    line-height: initial;
    overflow: auto;
    padding: 0.5em;
    min-height: 50vh;
}
.stdout hr{
    border: none;
    border-bottom: var(--border);
}


/*  loading state
===================================================================== */

section > .loading{
    position: absolute;
    inset: 0;
    pointer-events: none;

    display: flex;
    justify-content: center;
    align-items: center;
    align-content: center;
}
section.running > *:not(.loading){
    opacity: 0.5;
}
section.running > .loading::after{
    content: "waiting for server response...";
    display: inline-block;
    background: #666;
    color: white;
    z-index: 1;
    padding: 1em;
    border-radius: 5em;
}


@media screen and (max-width: 54em) {
    body > main{
        display: block;
    }
    body > header{
        display: block;
    }
}