/* ── Width and height: unit picker on top, then width, lock, height on one row ──
   Shared by the main resizer (_includes/size-dimensions.html, js/size.js) and the
   "resize image to X" pages (_includes/X-resizer/X-resizer.html, js/resize-to-X-dimensions.js). */
.sz-dims {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sz-units {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: #f2f2f6;
}

.sz-unit {
  flex: 1;
  min-width: 0;
  height: 32px;
  margin: 0;
  padding: 0 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #888;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.sz-unit:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.55);
  color: #555;
}

.sz-unit.is-active {
  background: #fff;
  color: #dd4db5;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}

.sz-unit:focus-visible {
  outline: 2px solid rgba(221, 77, 181, 0.5);
  outline-offset: 1px;
}

.sz-dims-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sz-field {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 7px 12px 8px;
  border: 1.5px solid #e4e4ea;
  border-radius: 10px;
  background: #fafafa;
  cursor: text;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.sz-field:focus-within {
  border-color: #dd4db5;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(221, 77, 181, 0.12);
}

.sz-field-label {
  display: block;
  margin-bottom: 2px;
  color: #8a8794;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.sz-field-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Reset the old boxed input styles: the field around it is the box now */
.sz-field #img_width,
.sz-field #img_height {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 26px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #1a1a1e;
  font-size: 17px;
  font-weight: 600;
  -moz-appearance: textfield;
}

.sz-field #img_width::-webkit-outer-spin-button,
.sz-field #img_width::-webkit-inner-spin-button,
.sz-field #img_height::-webkit-outer-spin-button,
.sz-field #img_height::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.sz-field #img_width:focus,
.sz-field #img_height:focus {
  border: 0;
  background: transparent;
  outline: none;
}

.sz-field-unit {
  flex-shrink: 0;
  color: #dd4db5;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* Lock button between the two fields: grey when unlocked, pink when locked */
.sz-dims-row .sz-lock {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 18px 0 0;
  padding: 0;
  border: 1.5px solid #e4e4ea;
  border-radius: 10px;
  background: #fff;
  color: #9a97a3;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.sz-dims-row .sz-lock.locked {
  border-color: #f6cfea;
  background: #fdf1fa;
  color: #dd4db5;
}

.sz-dims-row .sz-lock:hover {
  border-color: #dd4db5;
  color: #dd4db5;
}

.sz-dims-row .sz-lock:focus-visible {
  outline: 3px solid rgba(221, 77, 181, 0.35);
  outline-offset: 2px;
}

.sz-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
