* {
  -moz-box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font: normal 16px sans-serif;
}

body {
  display: grid;
  grid: "head  head" auto
        "input output" 1fr
      /  1fr   1fr;
  grid-gap: 0;
  padding: 0;
  overflow: hidden;
}

header {
  grid-area: head;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  grid-gap: 1em;
  padding: 2px 1em;
  background: #eef;
  border-bottom: 1px solid #444;
}
h1 {
  margin: 0;
  font-size: 1.5rem;
}

.download {
  float: right;
  margin: 0;
  border: 2px solid currentColor;
  padding: 0 1rem;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  border-radius: 2em;
  text-decoration: none;
  line-height: 2em;
  font-size: .8em;
}

.download:hover {
  background: #eef;
  text-decoration: underline;
}

.editor {
  overflow: hidden;  
  position: relative;
}

.error.widget {
  color: red;
}

.input {
  grid-area: input;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
  overflow: hidden;
  border-right: 1px solid #444;
}

.input > * + * {
  border-top: 1px solid #444;
}

.error {
  background: #fff8f8;
}
pre.error {
  margin: 0;
}

.menu {
  display: grid;
  grid-template-columns: 1fr auto;
  padding: .5em 1em;
  background: #f0f0f0;
}

.output {
  grid-area: output;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1rem;
}

h2 {
  margin: 0;
}

#preview {
  position: relative;
}

#preview svg {
  border: 1px solid black;
  display: block;
  max-width: 100%;
  margin-bottom: 1em;
  width: 100%;
  height: auto;
  max-height: 90vh;
}

pre {
  overflow: auto;
  font-size: .8em;
  padding: 1em;
  background: #f8f8f8;
}

.CodeMirror {
  height: 100%;
  font-size: .8rem;
}
.CodeMirror-linenumber {
  font-size: .8em;
  line-height: 1rem;
}

.glitchButton {
  z-index: 1;
}

.glitchButtonElement img {
  height: 2rem;
}

