body {
  font-family: sans-serif;
  background-color: #fff;
  color: #000;
  padding: 40px;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: fit-content;
}

h1 {
  font-weight: 600;
}

.header {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
}

#chart {
  display: grid;
  gap: 0;
  padding: 5px;
  position: relative;
}

.actions-bar {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}
/* Base cell */
.cell {
  background: transparent;
  color: #000;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  font-size: 0.9rem;
  padding: 4px;
  overflow: hidden;
}

/* Interior cells */
.grid-cell {
  min-width: 200px;
  min-height: 200px;
  aspect-ratio: 1 / 1;
  border: 2px solid #000;
  box-sizing: border-box;
  background-color: #fff;
  position: relative;
  overflow: hidden;
  margin: -1px;
}

/* Labels */
.label {
  position: relative;
  font-weight: bold;
  font-size: 1rem;
  text-align: center;
  word-break: break-word;
  white-space: normal;
  overflow-wrap: break-word;
  padding: 4px;
}

/* Axis titles */
.axis-label {
  font-weight: bold;
  font-size: 1.2rem;
}

.axis-x {
  grid-row: 1;
  text-align: center;
}

.axis-y {
  transform: rotate(-90deg);
  transform-origin: center;
  white-space: nowrap;
  font-weight: bold;
  font-size: 1.2rem;
  text-align: center;
  position: absolute;
  top: 120px;
  left: -48%;
  width: 100%;
}

/* Upload button wrapper (centered, hidden by default) */
.upload-buttons {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  gap: 4px;
  flex-direction: row;
  justify-content: center;
}

.grid-cell:hover .upload-buttons {
  display: flex;
  flex-direction: column;
}

.upload-buttons button {
  border: none;
  cursor: pointer;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 20px;
  width: auto;
  height: 40px;
  align-items: center;
  background: #5b6da0;
  color: #ffffff;
  cursor: pointer;
  border-radius: 20px;
  font-weight: bold;
}

/* Label overlays */
.combo-label {
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.8);
  font-size: 0.8rem;
  font-weight: bold;
  color: #fff;
  pointer-events: none;
  text-align: center;
  padding: 2px 4px;
  border-radius: 2px;
}

/* Delete button (hidden until hover) */
.delete-btn {
  position: absolute;
  top: calc(50% - 20px);
  right: 4px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  color: red;
  font-weight: bold;
  cursor: pointer;
  display: none;
  font-size: 1rem;
  line-height: 1;
}

.label:hover .delete-btn {
  display: block;
}

#resetButton, #downloadImage {
  padding: 8px 20px;
  font-size: 0.9rem;
  border: none;
  background: #5b6da0;
  color: #ffffff;
  cursor: pointer;
  border-radius: 20px;
  font-weight: bold;
  z-index: 3;
}

.cell.add-button {
    cursor: pointer;
    border-radius: 10px;
    width: 40px;
    height: 20px;
  background: #5b6da0;
  color: #ffffff;
}

.cell.cell.add-button:hover {
  background: rgb(114, 115, 131);
}