.turnip-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 4px;
  overflow: hidden;
  background-color: #f1f1f1;
  /* margin: 15px 0; */
  margin: 1.5em 0;
}

.turnip {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 5px;
  padding: 8px;
  box-sizing: border-box;
  flex-wrap: wrap;
}

.turnip-container .turnip {
  border-bottom: 1px dashed #ccc;
}

.turnip-container .turnip:last-child {
  border-bottom: none;
}

.turnip-label {
  padding-right: 10px;
  white-space: normal;
  flex-shrink: 0;
  max-width: 200px;
}

/* fixed width for labels inside a turnip-container with multiple turnips */
.turnip-container .turnip:not(:only-child) .turnip-label {
  width: 150px;
}

/* allow label to take necessary space when its the only turnip in the container */
.turnip-container .turnip:only-child .turnip-label {
  width: auto;
  max-width: 200px;
}

.turnip-spinbox {
  flex: 1;
  max-width: 150px;
}

.turnip-value,
.turnip-spinbox,
.turnip-label {
  font-family: monospace;
}

.turnip-slider {
  flex-grow: 1;
  min-width: 100px;
}

.turnip-value {
  flex: 0 0 80px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.turnip-unit {
  min-width: fit-content;
  flex-shrink: 1;
  padding-left: 5px;
}

.turnip:has(.turnip-slider) .turnip-spinbox {
  flex: none;
}

.turnip:not(.turnip-container .turnip) {
  margin: 1.5em 0;
}