body {
  font-family: sans-serif;
  margin: 0;
  padding: 2rem;
  background: #f9f9f9;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 800px;
}

h2 {
  text-align: center;
  margin-bottom: 1rem;
}

form {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

label {
  font-weight: 600;
}

input[type="file"],
select,
button {
  font-size: 1rem;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 100%;
  box-sizing: border-box;
}

button {
  background-color: #4CAF50;
  color: white;
  border: none;
  font-weight: bold;
  cursor: pointer;
}

button:hover {
  background-color: #45a049;
}

.notice {
  color: red;
  font-size: 0.95rem;
  margin: 0.5rem 0;
}

.cross-preview {
  display: grid;
  grid-template-areas:
    "tl c tr"
    "bl c br";
  grid-template-columns: 1.5fr 3fr 1.5fr;
  /* Let the content determine row height */
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.cross-preview .tl { grid-area: tl; }
.cross-preview .tr { grid-area: tr; }
.cross-preview .bl { grid-area: bl; }
.cross-preview .br { grid-area: br; }
.cross-preview .c  { grid-area: c; }

/*
  The definitive container fix. We create a stable aspect-ratio box
  using the padding-bottom trick, which is more reliable than the
  `aspect-ratio` property in this specific library conflict.
*/
.cross-preview > div {
  position: relative;
  height: 0;
  /* 4:3 aspect ratio -> (4/3)*100 = 133.33% */
  /* For a 3:4 aspect ratio, it's (4/3)*100 = 133.33% */
  padding-bottom: 133.33%;
  overflow: hidden;
  border-radius: 6px;
  background: #e0e0e0;
}

/* Let Cropper.js have full control over the image styling */
.cross-preview img {
  display: block;
  max-width: 100%;
  position: absolute; /* Position the image within the padding-box */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}


.image-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.image-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: flex-start;
}
.image-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
}
.position-label {
  font-size: 0.75rem;
  color: #555;
  margin-bottom: 4px;
}