body {
  font-family: 'JetBrains Mono', monospace;
  background: #f5f5f5;
  color: #1a1a1a;
  text-align: center;
  margin: 0;
  padding: 20px;
}

h2 {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 20px;
}

/*
  Main container: single row (nowrap),
  responsive horizontal gap, plus L/R padding to avoid clipping.
*/
.container {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start;

  /* The horizontal gap between columns scales between 10px and 40px */
  gap: clamp(10px, 3vw, 40px);

  /* A taller min-height so the center box can be vertically centered initially */
  min-height: 500px;

  /* Auto horizontal margin centers container on the page. */
  margin: 20px auto;

  /* Restrict max container width to ~95% of the viewport */
  max-width: 95vw;

  /* Extra left/right padding to reduce clipping at edges */
  padding: 0 40px;
}

/* Each column is a vertical flex box, centered horizontally. */
.image-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* .center-box => middle column is vertically centered until images load */
.center-box {
  justify-content: center;
}

/* 
  .bone-image => shared by left, patient, and right images:
    - Height from ~225px up to 525px (or 45% vw in between)
    - 2px border if there's an actual src
*/
.bone-image {
  border: 2px solid black;
  height: clamp(225px, 45vw, 525px);
  width: auto;
  object-fit: contain;
  cursor: pointer;
  display: block;
  margin-bottom: 5px;
}

/* Hide any <img> that has no valid src => no thin line */
.bone-image:not([src]),
.bone-image[src=""] {
  border: none;
  display: none;
}

/* The narrower age input (60px wide) */
.age-input {
  width: 80px;
  text-align: center;
  padding: 8px 12px;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #1a1a1a;
  background: #ffffff;
  transition: all 0.2s;
}

.age-input:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Reference age text below images */
.ref-age {
  margin-top: 8px;
  margin-bottom: 4px;
  font-style: italic;
  font-size: 13px;
  color: #666666;
}

/* Controls bar at top */
.controls {
  margin: 20px;
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
}

.controls select {
  padding: 8px 12px;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #1a1a1a;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s;
}

.controls select:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.controls select:hover {
  border-color: #999999;
}

/* Toggle row styling */
.toggle-row {
  display: flex; /* will be "none" by default in HTML inline, then set to "flex" in JS */
  flex-direction: row;
  align-items: center;
  margin-top: 10px;
  gap: 8px;
  font-size: 13px;
  color: #666666;
}

/* The switch used for blank/annotated toggling */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

/* Hide default checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* Slider background */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; 
  left: 0; 
  right: 0; 
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

/* The sliding circle */
.slider:before {
  position: absolute;
  content: "";
  height: 18px; 
  width: 18px;
  left: 3px; 
  top: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

/* When checked, move slider circle to the right */
.switch input:checked + .slider {
  background-color: #2196F3;
}
.switch input:checked + .slider:before {
  transform: translateX(22px);
}

/* Dashed "paste or click" box for uploading in the middle column */
.upload-box {
  border: 2px dashed #d0d0d0;
  background: #ffffff;
  border-radius: 4px;
  width: 200px;
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
  transition: all 0.2s;
}

.upload-box:hover {
  border-color: #10b981;
  background: #f9f9f9;
}

.upload-box p {
  margin: 0;
  line-height: 1.5;
  font-size: 13px;
  color: #666666;
}

.upload-box strong {
  color: #1a1a1a;
  font-weight: 600;
}

.upload-box a {
  text-decoration: underline;
  color: #10b981;
  cursor: pointer;
  transition: color 0.2s;
}

.upload-box a:hover {
  color: #059669;
}

/* Source box */
.source-box {
  border: 2px dotted #d0d0d0;
  background: #ffffff;
  border-radius: 4px;
  padding: 8px 16px;
  max-width: 120px;
  margin: 24px auto 0;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.source-box:hover {
  border-color: #10b981;
  background: #f9f9f9;
}

.source-box a {
  font-size: 13px;
  color: #666666;
  text-decoration: none;
  transition: color 0.2s;
}

.source-box a:hover {
  color: #10b981;
}
