.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0;
    right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 22px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: #28a745;
}
input:checked + .slider:before {
    transform: translateX(18px);
}
body {
  font-size: 1rem; /* or 16px */
}

/* Make the playground take full height */
#monaco-wrapper {
  display: flex;
  flex-direction: column;
  padding: 0 8px;
  margin-bottom: 2rem;
}

/* Editor gets ~60-70% of the height */
#editor {
  max-height: 70vh;
  min-height: 50vh;
  width: 100%;
  border: 1px solid #ccc;
}

/* Output takes the remaining space and shows a preview */
#output {
  margin-top: 1rem;
  width: 100%;
  height: 20vh;
  max-height: 25vh;
  overflow-y: auto;
}

#waveform {
  margin-top: 1rem;
  width: 100%;
  min-height: 20vh;
  max-height: 25vh;
  overflow-y: auto;
}

/* Prevent overflow beyond the screen */
body, html {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Buttons and headings shouldn't break the layout */
#runButton {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

@media (max-width: 576px) {
  .monaco-editor {
    font-size: 16px !important;
  }

  #output, #waveform, textarea, pre, code {
    font-size: 16px;
  }
}

/* Portrait Mode */
@media screen and (orientation: portrait) {
    #editor {
	min-height: 70vh;
    }
    #output {
	min-height: 30vh;
    }
    #waveform {
	min-height: 40vh;
    }
}

/* Landscape Mode */
@media screen and (orientation: landscape) {
    #editor {
	min-height: 80vh;
    }
    #output {
	min-height: 30vh;
    }
    #waveform {
	min-height: 50vh;
    }
}
