An electronic device with a display and a cover layer on the display, comprising: an ambient light sensor window filled with an ambient light sensor window material; an ambient light sensor configured to receive light through the ambient light sensor window 24); a proximity sensor window; a proximity sensor configured to receive light through the proximity sensor window, wherein: at least part of an interior surface of the cover layer is coated with an opaque masking material (57, 58) having an opening for the proximity sensor window, wherein the ambient light sensor window and the proximity sensor window are formed from different respective regions in the opaque masking layer, the electronic device characterized by: the ambient light sensor being laterally offset from the ambient light sensor window; a light guide structure that conveys light received through the ambient light sensor window to the laterally-offset ambient light sensor; and infrared-transparent ink (114, 118) in the opening for the proximity sensor window, wherein the ambient light sensor window material is different than the infrared-transparent ink and transmits more visible light relative to infrared light than the infrared-transparent ink. an ambient light sensor window filled with an ambient light sensor window material; an ambient light sensor configured to receive light through the ambient light sensor window 24); a proximity sensor window; a proximity sensor configured to receive light through the proximity sensor window, wherein: at least part of an interior surface of the cover layer is coated with an opaque masking material (57, 58) having an opening for the proximity sensor window, wherein the ambient light sensor window and the proximity sensor window are formed from different respective regions in the opaque masking layer, the electronic device characterized by: the ambient light sensor being laterally offset from the ambient light sensor window; a light guide structure that conveys light received through the ambient light sensor window to the laterally-offset ambient light sensor; and infrared-transparent ink (114, 118) in the opening for the proximity sensor window, wherein the ambient light sensor window material is different than the infrared-transparent ink and transmits more visible light relative to infrared light than the infrared-transparent ink. at least part of an interior surface of the cover layer is coated with an opaque masking material (57, 58) having an opening for the proximity sensor window, wherein the ambient light sensor window and the proximity sensor window are formed from different respective regions in the opaque masking layer, the electronic device characterized by: the ambient light sensor being laterally offset from the ambient light sensor window; a light guide structure that conveys light received through the ambient light sensor window to the laterally-offset ambient light sensor; and infrared-transparent ink (114, 118) in the opening for the proximity sensor window, wherein the ambient light sensor window material is different than the infrared-transparent ink and transmits more visible light relative to infrared light than the infrared-transparent ink.