.editor-layout {
  height: 100%;
  display: flex;
  flex: 1;
}
aside {
  padding: 1rem;
  max-height: calc(100vh - 56px - 56px);
  overflow-y: auto;
}
aside ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
aside ul + h3 {
  margin: 2em 0 1em;
}
aside li {
  margin-bottom: 0.5rem;
}
aside a.active {
  font-weight: bold;
  text-decoration: none;
}
section {
  flex: 1;
  display: flex;
  gap: 1rem;
  padding: 1rem;
}
#preview {
  flex: 1;
  display: flex;
  flex-direction: column;
}
iframe {
  flex: 1;
  width: 100%;
  display: block;
  border: 1px solid #ccc;
  border-radius: 4px;
}
#editor {
  display: block;
  width: 50%;
  overflow: hidden;
  border: 1px solid #ccc;
  border-radius: 4px;
}
footer {
  text-align: center;
  margin-top: 0;
}

@media (max-width: 768px) {
  .editor-layout {
    flex-direction: column;
  }
  aside {
    padding-bottom: 1rem;
    display: flex;
    gap: 1rem;
    overflow-x: auto;
  }
  aside h3 {
    display: none;
  }
  aside ul {
    display: flex;
    flex-wrap: nowrap;
    gap: 1rem;
  }
  aside li {
    white-space: nowrap;
  }
  section {
    flex-direction: column;
  }
  iframe {
    width: 100%;
    flex: 1;
  }
  #editor {
    height: 40vh;
    width: 100%;
    order: 2;
  }
}

@media (prefers-color-scheme: dark) {
  body {
    background: #222;
    color: #eee;
  }
  body a {
    color: #fafafa;
  }
  iframe {
    border-color: #444;
    background: #333;
  }
  #editor {
    background: #1E1E1E;
    border-color: #444;
  }
}
