/* Center all elements on the page */
body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  margin: 8px 0 0 0; /* Only 8px top margin */
  font-family: Arial, sans-serif;
}

/* Add top margin to h2 */
h2 {
  margin-top: 4px; /* 8px above top of chart */
  margin-bottom: 0; /* Remove default bottom margin */
  padding: 0;
}

/* Center direct children of body */
body > * {
  margin: 0.5em 0;
}

/* Set width for range controls */
input[type="range"] {
  width: 80vw;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Row spacing */
.row {
  margin-bottom: 0; /* Remove default row spacing */
}

/* Controls horizontal layout, left-aligned with chart */
.controls {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 90vw;
}

.control-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.control-group label,
.control-group select {
  white-space: nowrap;
}

/* Center and space weight value row */
#weight-value-row {
  width: 100%;
  text-align: center;
  margin-bottom: 8px;
}

#chart-row {
  width: 88vw;
  height: calc(100vh - 180px); /* Adjust 180px as needed for controls/buttons */
  display: flex;
  justify-content: center;
  align-items: center;
}

#myChart {
  width: 100% !important;
  height: 100% !important;
  display: block;
  pointer-events: auto;
  z-index: 10;
}

#save-btn {
  height: 24px;
}
