body {
  display: grid;
  min-height: 100vh;
  margin: 0;

  grid-template-rows: auto 1fr auto;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "editor error"
    "editor output"
    "buttons output";

  box-sizing: border-box;
  padding: 0.5em;
  grid-gap: 1em;
}

#editor {
  grid-area: editor;
}
#buttons {
  width: 100%;
  text-align: center;
  display: flex;

  grid-area: buttons;
  grid-auto-flow: dense;
}
button {
  border: 1px solid darkgray;
  padding: 0.5em;
  flex-grow: 1;
}
button:hover {
  border: 1px solid black;
  color: white;
  background-color: #333;
}
pre {
  overflow-x: scroll;
  margin: 0;
}
.autoselect {
  -webkit-user-select: all;  /* Chrome all / Safari all */
  -moz-user-select: all;     /* Firefox all */
  -ms-user-select: all;      /* IE 10+ */
  user-select: all;
}
#error {
  background-color: darkred;
  color: white;
  text-align: center;
  padding: 1em;
  display: none;

  grid-area: error;
}
#output {
  grid-area: output;
  overflow: auto;
}

@media only screen and (max-width: 1200px) {
  body {
    grid-template-rows: 50vh auto auto 1fr;
    grid-template-columns: 1fr;
    grid-template-areas:
      "editor"
      "buttons"
      "error"
      "output";
  }
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: #222;
    color: white;
    max-height: 100vh;
  }
  button {
    border: 1px solid #777;
    background-color: #333;
    color: white;
  }
  button:hover {
    background-color: lightgray;
    color: black;
  }
}
