html {
  --c-input-bg: #fff;
  --c-bg: #f9f9f9;
  --c-bg-alt: #1a1a1a;
  --c-text: #212121;
  --c-cta: #1565c0;
  --c-metadata: #5f5f5f;
  --c-input-fg: #212121;
  --c-text-dark-bg: #999999;
  --c-input-border: #e0e0e0;
  --c-text-dark: #999999;
  --c-heading-article: #000;
  --c-heading-bg: #eeeeee;
  --c-code-bg: #f5f5f5;
  --c-code-fg: #000;
  --c-bg-cta: #fff;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  padding: 20px;
  margin: 0;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  /* align-items: center; */
  justify-content: space-between;
}

main > * {
  flex: 1;
}

#preview {
  display: flex;
  flex-direction: column;
}

#meta {
  border: 1px solid #ccc;
  border-radius: 2px;
  padding: 10px;
}

#meta p {
  margin: 0;
  font-size: 90%;
}

iframe {
  flex: 1;
  border: 0;
  min-width: 80ch;
}

.CodeMirror {
  flex-grow: 1;
  border: 1px solid var(--c-input-border);
  background: var(--c-input-bg);
  padding: 8px;
  font-size: 14px;
}

h1,
h2,
h3,
h4 {
  font-size: revert;
  margin: 0;
  white-space: initial;
}

input {
  font-weight: bold;
  text-align: right;
  outline: none;
  min-width: 100px;
  border: 1px solid transparent;
  width: 30vw;
}

input[readonly] {
  border-color: transparent;
}

li > * {
  padding: 3px;
}

li {
  color: var(--c-text-dark);
}

ul {
  list-style: none;
  padding: 0;
}

span.result:before {
  content: ': ';
}

span.result > .decimal {
  color: var(--c-text);
  padding-left: 10px;
}

button {
  border-radius: 5px;
  padding: 2px 10px;
  height: 28px;
  cursor: pointer;
}

html {
  background: var(--c-bg);
  color: var(--c-text);
}

input,
select,
button {
  background: var(--c-input-bg);
  color: var(--c-input-fg);
  padding: 4px;
  border-radius: 2px;
}

select,
button {
  border: 1px solid var(--c-input-border);
  background: rgba(1, 1, 1, 0.1);
}

input {
  border-radius: 0;
}

button {
  padding: 8px 16px;
  height: auto;
  /*! border: 0; */
}

.right {
  float: right;
}

.center {
  text-align: center;
}

li > * {
  color: var(--c-text-dark);
}

input:focus {
  color: var(--c-input-fg);
}

footer {
  padding: 20px;
  white-space: initial;
}

footer .info {
  display: flex;
  justify-content: space-between;
}

footer nav ul {
  display: flex;
  justify-content: space-around;
}

footer * {
  font-size: 0.8rem;
}

footer p {
  margin: 16px 0;
}

footer p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--c-cta);
}

.line-error {
  --c-error-bg: hsl(0deg 100% 92%);
  --c-error-border: red;
  background: var(--c-error-bg);
  color: red;
  font-size: 90%;
  margin: 4px 0;
  padding: 0 4px;
  border: 1px solid var(--c-error-border);
  border-left: 0;
  border-right: 0;
}

.cm-block-c {
  text-align: center;
  width: 100%;
  display: inline-block;
}

.cm-block-r {
  text-align: right;
  width: 100%;
  display: inline-block;
}

.cm-block-link {
  color: blue;
}

.cm-block-b {
  font-weight: 600;
}

.cm-block-h1,
.cm-block-h2,
.cm-block-h3,
.cm-block-h4 {
  font-weight: 700;
}
.cm-block-i {
  font-style: italic;
}

.cm-block-link-content {
  text-decoration: underline;
}

.goto .cm-block-link-content {
  cursor: pointer;
}

#meta button {
  background: none;
  padding: 0;
  margin: 0;
  text-decoration: underline;
  border: 0;
  color: var(--c-cta);
}

#load-demo {
  font-size: 90%;
  float: right;
}

#meta button:hover {
  border: 0;
  outline: 0;
  text-decoration: none;
}

.line-node-split {
  display: block;
  border-top: 2px solid #0093ff;
  font-size: 70%;
  color: #0093ff;
  border-radius: 1px;
  padding: 0 2px;
  margin: 16px 0 2px 0;
  border-left: 2px solid #0093ff;
}

#preview,
.CodeMirror {
  height: calc(calc(100vh - 128px) / 2);
  max-height: calc(calc(100vh - 128px) / 2);
}

iframe {
  min-width: 100%;
}

@media screen and (min-width: 1000px) {
  main {
    flex-direction: row;
  }

  #preview,
  .CodeMirror {
    height: calc(100vh - 117px);
    max-height: initial;
  }

  #preview {
    margin-left: 40px;
  }
}
