html,
body {
  padding: 0;
  margin: 0;
  height: 100vh;
  background: white;
}

.container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  grid-column-gap: 1px;
  grid-row-gap: 1px;
}

#preview,
.editor {
  position: relative;
  border: 1px solid #ccc;
  border-radius: 2px;
  box-sizing: border-box;
}

#preview:after,
.editor:after {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  display: inline;
  content: attr(aria-label);
  position: absolute;
  bottom: 4px;
  right: 4px;
  color: #979797;
  font-size: 12px;
}

#preview,
.editor {
  padding: 2px;
  display: flex;
}

textarea {
  padding: 4px;
}

textarea,
iframe {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  width: 100%;
  border: none;
  resize: none;
  font-size: 14px;
  color: black;
}

@media (prefers-color-scheme: dark) {
  html,
  body,
  .editor,
  textarea,
  #preview {
    background: black;
  }

  .editor,
  #preview {
    color: white;
    border: 1px solid #312c2c;
  }

  textarea,
  iframe {
    color: #979797;
  }
}

@media (max-width: 640px) {
  .container {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr);
  }
}
