.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 */
}

/* ---- Playground layout ----
   Three panels of the same height: code | output on the top row, waveform
   below (or one per row when stacked). Any panel can be maximized to the
   whole viewport; Esc or the Restore button brings it back. */
#monaco-wrapper { padding: 0 8px; margin-bottom: 2rem; width: 95%; }   /* gutter on the right for comfortable scrolling */
.pg-panel {
  --pg-h: 42vh;
  height: var(--pg-h); min-height: 260px;
  display: flex; flex-direction: column;
  border: 1px solid #ccc; border-radius: .4rem; overflow: hidden; background: #fff;
}
.pg-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .25rem .6rem; font-size: .9rem; font-weight: 600;
  background: #f1f3f5; border-bottom: 1px solid #dee2e6; flex: none;
}
.pg-tabs { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; min-width: 0; }
.pg-tab { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .5rem; border: 1px solid #d0d5db; border-radius: .3rem;
          background: #fff; font-weight: 500; font-size: .82rem; cursor: pointer; font-family: ui-monospace, Menlo, Consolas, monospace; }
.pg-tab.active { background: #212529; color: #fff; border-color: #212529; }
.pg-tab-x { border: 0; background: none; color: inherit; opacity: .6; font-size: .9rem; line-height: 1; padding: 0; cursor: pointer; }
.pg-tab-x:hover { opacity: 1; }
.pg-tab-add { border: 1px dashed #c9ced4; border-radius: .3rem; background: #fff; font-size: .9rem; line-height: 1; padding: .1rem .45rem; cursor: pointer; }
.pg-tab-add:hover { background: #e9ecef; }
/* VS Code style explorer beside the editor */
.pg-panel-body.pg-editor-body { flex-direction: row; }
.pg-explorer { width: 190px; flex: none; display: flex; flex-direction: column; background: #252526; color: #cccccc;
               border-right: 1px solid #3c3c3c; font-size: .82rem; min-height: 0; }
.pg-explorer-head { display: flex; justify-content: space-between; align-items: center; padding: .35rem .6rem;
                    font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #bbbbbb; }
.pg-explorer-btn { border: 0; background: none; color: #cccccc; cursor: pointer; font-size: .95rem; line-height: 1; padding: 0 .2rem; }
.pg-explorer-btn:hover { color: #fff; }
.pg-explorer-list { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; }
.pg-explorer-item { display: flex; align-items: center; gap: .4rem; padding: .22rem .6rem; cursor: pointer; white-space: nowrap; }
.pg-explorer-item:hover { background: #2a2d2e; }
.pg-explorer-item.active { background: #37373d; color: #fff; }
.pg-file-icon { font-size: .6rem; font-weight: 700; padding: .05rem .25rem; border-radius: .2rem; background: #4b6ea9; color: #fff; flex: none; }
.pg-file-icon.v { background: #3b8a5a; }
.pg-file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; font-family: ui-monospace, Menlo, Consolas, monospace; }
.pg-file-actions { display: none; gap: .1rem; }
.pg-explorer-item:hover .pg-file-actions, .pg-explorer-item.active .pg-file-actions { display: inline-flex; }
.pg-file-actions button { border: 0; background: none; color: #cccccc; cursor: pointer; font-size: .8rem; padding: 0 .15rem; line-height: 1; }
.pg-file-actions button:hover { color: #fff; }
.pg-explorer-foot { padding: .3rem .6rem; font-size: .68rem; color: #8a8a8a; border-top: 1px solid #3c3c3c; }
.pg-explorer-toggle { display: none; border: 1px solid #c9ced4; border-radius: .3rem; background: #fff; font-size: .8rem; padding: .05rem .45rem; margin-right: .4rem; cursor: pointer; }
@media (max-width: 991.98px) {
  .pg-explorer-toggle { display: inline-block; }
  .pg-editor-body { position: relative; }
  .pg-explorer { display: none; position: absolute; inset: 0 auto 0 0; z-index: 5; box-shadow: 4px 0 12px rgba(0,0,0,.35); }
  .pg-explorer.open { display: flex; }
}
.pg-max { border: 1px solid #c9ced4; border-radius: .3rem; background: #fff; font-size: .8rem; padding: .05rem .45rem; cursor: pointer; }
.pg-max:hover { background: #e9ecef; }
.pg-panel-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#editor { flex: 1; min-height: 0; width: 100%; border: 0; }
#output { flex: 1; min-height: 0; width: 100%; resize: none; border: 0; border-radius: 0;
          font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
#waveform { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#waveform .iw { flex: 1; min-height: 0; border: 0; border-radius: 0; }
#waveform .iw-scroll { max-height: none; }
#waveform .iw-pane-list { max-height: none; }
#pg-layout.stacked .pg-panel { --pg-h: 48vh; }
.pg-panel.maximized {
  position: fixed; inset: 0; z-index: 1050; height: 100vh; min-height: 0;
  border: 0; border-radius: 0;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
body.pg-has-max { overflow: hidden; }
.pg-only-max { display: none; }
.pg-panel.maximized .pg-only-max { display: inline-flex; }

/* 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;
  }
}
