html {
  height: 100%;
}

body {
  height: 100%;
  overflow: hidden;
  background: #222 !important;
}

.CodeMirror {
  height: calc(100% - 54px);
  width: calc(100% - 140px);
  font-size: 1em;
}

#navbar input[type=number],
#navbar select {
  height: 28px;
  font-size: 13px;
  padding: 0 4px;
  border: 1px solid #bbb;
  border-radius: 3px;
  background: #fff;
  box-sizing: border-box;
  vertical-align: middle;
}

#navbar input[type=number] {
  text-align: center;
  -moz-appearance: textfield;
}

#navbar input[type=number]::-webkit-outer-spin-button,
#navbar input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#navbar input[type=number]:hover::-webkit-outer-spin-button,
#navbar input[type=number]:hover::-webkit-inner-spin-button,
#navbar input[type=number]:focus::-webkit-outer-spin-button,
#navbar input[type=number]:focus::-webkit-inner-spin-button {
  -webkit-appearance: inner-spin-button;
}

.ui_label {
  font-size: 13px;
  color: #444;
  margin: 0 1px;
}

#bpm {
  width: 52px;
}
#time_signature_numerator,
#time_signature_denominator {
  width: 34px;
}
#swing {
  width: 40px;
}
#swing_division {
  width: 54px;
  height: 28px;
  font-size: 13px;
  padding: 0 2px;
  border: 1px solid #bbb;
  border-radius: 3px;
  vertical-align: middle;
}

#status {
  font-size: 18px;
  line-height: 1;
}

#cpu {
  font-size: 11px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  opacity: 0.75;
  flex-shrink: 0;
  width: 32px;
  text-align: right;
}

#cpu-value {
  color: green;
}

#bpm_control {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 1;
  flex-wrap: wrap;
}

#midi {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

#midi_label {
  font-size: 13px;
  color: #444;
  white-space: nowrap;
}

#midi_outs {
  height: 28px;
  font-size: 13px;
  border: 1px solid #bbb;
  border-radius: 3px;
  padding: 0 4px;
  vertical-align: middle;
}

#midi_refresh {
  height: 28px;
  width: 28px;
  padding: 0;
  background-color: #2d8a2d;
  color: white;
  border: none;
  border-radius: 3px;
  font-size: 15px;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#midi_refresh:hover {
  background-color: #3aad3a;
}

#transport {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

#transport span {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  line-height: 1;
  height: 28px;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#transport span:hover {
  color: #f7d952;
}

#rerun,
#stop,
#clear,
#restart {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#transport #rerun {
  color: #2d8a2d;
  font-size: 15px;
  line-height: 1;
  transform: translateY(1px);
}

#transport #rerun:hover {
  color: #3aad3a;
}

#stop {
  color: #cc0000;
  position: relative;
  top: -1px;
}

#transport #stop:hover {
  color: #ff3b3b;
}

#sound {
  width: 22px;
  height: 22px;
  display: inline-block;
  background: url('../asset/spkr.png') no-repeat;
  background-size: 100% 200%;
  cursor: pointer;
  margin-left: 2px;
  flex-shrink: 0;
}

#sound:hover {
  background-position: 0 -22px !important;
}

.error {
  background-color: rgba(204, 0, 0, 0.5);
}


#progress_bar_canvas {
  display: inline-block;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 10px;
  background-color: #afafaf;
  border-top: 1px solid #afafaf;
}

#voiceControlsCanvas {
  position: absolute;
  right: 0;
  top: 0;
  width: 140px;
  z-index: 1000;
  background: #222;
  cursor: pointer;
}

#soloControlsCanvas {
  position: absolute;
  right: 0;
  bottom: 54px;
  width: 140px;
  z-index: 1000;
  background: #222;
  border-top: 1px solid #555;
  display: block;
  cursor: pointer;
}

.voice-wrapper {
  display: flex;
  flex-direction: column;
  margin-bottom: 3px;
}

.voice-controls-row {
  display: flex;
  align-items: center;
  margin-bottom: 1px;
}

.voice-control {
  cursor: pointer;
  padding: 3px;
  margin: 3px;
  border-radius: 3px;
  text-align: center;
  color: white;
  font-weight: bold;
  user-select: none;
  width: calc(100% - 105px);
  overflow: hidden;
  font-size: 11px;
}

.voice-stop-button {
  margin: 3px;
  padding: 3px;
  border-radius: 2px;
  cursor: pointer;
  font-weight: bold;
  background-color: #aa2424;
  color: white;
  border: none;
  min-width: 25px;
  font-size: 11px;
}

.voice-solo-button {
  margin: 3px;
  padding: 3px;
  border-radius: 2px;
  cursor: pointer;
  font-weight: bold;
  background-color: #666;
  color: white;
  border: none;
  min-width: 25px;
  font-size: 11px;
}

.voice-solo-button.active {
  background-color: #ff9800;
}

.voice-lock-button {
  margin: 3px;
  padding: 3px;
  border-radius: 2px;
  cursor: pointer;
  font-weight: bold;
  background-color: #666;
  color: white;
  border: none;
  min-width: 25px;
  font-size: 10px;
}

.voice-lock-button.active {
  background-color: #f44336;
}

.voice-control.unmuted {
  background-color: #4caf50;
}

.voice-control.muted {
  background-color: #303030;
}

.voice-control.auto-muted {
  background-color: #505050;
}

.gain-slider {
  width: calc(100% - 10px) !important;
  margin: 0 5px;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  background: #555;
  outline: none;
  border-radius: 4px;
}

.gain-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  background: #4caf50;
  cursor: pointer;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.gain-slider::-moz-range-thumb {
  width: 15px;
  height: 15px;
  background: #4caf50;
  cursor: pointer;
  border-radius: 50%;
  border: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.growl {
  width: 155px !important;
}

.wave {
  display: none;
}

#navbar {
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 8px;
  box-sizing: border-box;
  border-bottom: 1px solid #ccc;
  gap: 8px;
  overflow: hidden;
  margin-bottom: 10px;
}

.left,
.right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-sep {
  width: 1px;
  height: 22px;
  background: #ccc;
  flex-shrink: 0;
}

@media only screen and (max-width: 690px) {
  .CodeMirror {
    height: calc(100% - 84px);
  }

  #soloControlsCanvas {
    bottom: 84px;
  }

  #navbar {
    min-height: 80px;
    height: auto;
    flex-wrap: wrap;
    align-content: center;
    align-items: flex-start;
    padding: 3px 6px;
    gap: 0;
    row-gap: 3px;
    margin-bottom: 10px;
  }

  .left {
    width: 100%;
    flex-shrink: 1;
    flex-wrap: wrap;
    row-gap: 3px;
  }

  .right {
    width: 100%;
    flex-shrink: 1;
  }
}

@media only screen and (max-width: 480px) {
  .CodeMirror {
    height: calc(100% - 110px);
  }

  #soloControlsCanvas {
    bottom: 110px;
  }

  #navbar {
    min-height: 110px;
  }
}

@media only screen and (max-width: 520px) {
  #midi_label {
    display: none;
  }

  #midi_outs {
    max-width: 100px;
  }
}

#facet-zoom-controls {
  display: flex;
  align-items: center;
  gap: 2px;
}

.facet-zoom-btn {
  background: transparent;
  border: 1px solid #555;
  color: #ccc;
  cursor: pointer;
  font-size: 0.75em;
  padding: 1px 6px;
  border-radius: 3px;
  line-height: 1.4;
  min-width: 28px;
}

.facet-zoom-btn:hover {
  background: #333;
  color: #fff;
  border-color: #888;
}
