/* --- OHPS Cropper Modal --- */
.ohps-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(17,24,39,.72);
  -webkit-font-smoothing: antialiased;
}
.ohps-modal__panel { 
  width: min(95vw, 1000px); 
  height: 90vh;
  max-height: 800px; /* Constrain height on large screens */
  background: #fff; 
  border-radius: 1rem; 
  box-shadow: 0 20px 60px rgba(0,0,0,.35); 
  display: flex; 
  flex-direction: column;
}
.ohps-modal__head { 
  padding: 1rem 1.25rem; 
  border-bottom: 1px solid #e5e7eb; 
  font-weight: 600; 
  font-size: 1.125rem;
  flex-shrink: 0;
}
.ohps-modal__body { 
  flex: 1; /* Allow growing/shrinking */
  min-height: 0; /* Important for nested flex scroll */
  background: #1a202c; 
  padding: 0; 
  position: relative;
  overflow: hidden;
}
.ohps-modal__foot { 
  display: flex; gap: 0.75rem; justify-content: flex-end; 
  padding: 0.75rem 1rem; 
  border-top: 1px solid #e5e7eb; 
  background: #f7fafc;
  border-bottom-left-radius: 1rem;
  border-bottom-right-radius: 1rem;
  flex-shrink: 0;
}
.ohps-crop-stage { 
  position: absolute;
  /* Balanced padding so image doesn't touch edges but handles fit */
  top: 2rem; left: 2rem; right: 2rem; bottom: 2rem;
  display: flex; 
  align-items: center; 
  justify-content: center; 
  user-select: none;
  -webkit-user-select: none;
}
.ohps-crop-img { 
  max-width: 100%; 
  max-height: 100%;
  object-fit: contain; /* Ensures image never spills out */
  pointer-events: none;
}
.ohps-crop-box { 
  position: absolute; 
  box-sizing: border-box; 
  border: 2px solid #fff; 
  cursor: move;
  box-shadow: 0 0 0 4000px rgba(0,0,0,0.5);
  touch-action: none;
}
.ohps-crop-handle { 
  position: absolute; 
  width: 32px; height: 32px; 
  background: rgba(255,255,255,0.5); 
  border-radius: 50%; 
  transform: translate(-50%, -50%); 
  border: 2px solid #fff;
  z-index: 10;
}
.ohps-crop-handle.nw { top: 0; left: 0; cursor: nwse-resize; }
.ohps-crop-handle.ne { top: 0; left: 100%; cursor: nesw-resize; }
.ohps-crop-handle.sw { top: 100%; left: 0; cursor: nesw-resize; }
.ohps-crop-handle.se { top: 100%; left: 100%; cursor: nwse-resize; }

.ohps-crop-tip { 
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: #a0aec0; 
  font-size: 0.8rem; 
  text-align: center; 
  background: rgba(0,0,0,0.4);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  pointer-events: none;
}