/* Camera chrome only. Never filter the sensor image or cover the face being measured. */
.selfie-coached .cam,.selfie-coached .camwrap{isolation:isolate}
.selfie-coached .cam::after,.selfie-coached .camwrap::after{
  content:"";position:absolute;inset:0;z-index:5;pointer-events:none;border-radius:inherit;
  background:
    linear-gradient(90deg,#7ce9d8,#7ce9d8) left 12px top 12px/28px 2px no-repeat,
    linear-gradient(#7ce9d8,#7ce9d8) left 12px top 12px/2px 28px no-repeat,
    linear-gradient(90deg,#7ce9d8,#7ce9d8) right 12px top 12px/28px 2px no-repeat,
    linear-gradient(#7ce9d8,#7ce9d8) right 12px top 12px/2px 28px no-repeat,
    linear-gradient(90deg,#7ce9d8,#7ce9d8) left 12px bottom 12px/28px 2px no-repeat,
    linear-gradient(#7ce9d8,#7ce9d8) left 12px bottom 12px/2px 28px no-repeat,
    linear-gradient(90deg,#7ce9d8,#7ce9d8) right 12px bottom 12px/28px 2px no-repeat,
    linear-gradient(#7ce9d8,#7ce9d8) right 12px bottom 12px/2px 28px no-repeat;
  opacity:.55;transition:opacity .25s ease,filter .25s ease;
}
.selfie-coached .cam[data-coach-fresh=true][data-coach-tone=positive]::after,
.selfie-coached .camwrap[data-coach-fresh=true][data-coach-tone=positive]::after{
  opacity:1;filter:drop-shadow(0 0 7px #82efde);
  animation:llcCameraCorners 2.4s ease-in-out infinite;
}
.selfie-coached .cam[data-coach-tone=attention]::after,
.selfie-coached .camwrap[data-coach-tone=attention]::after{opacity:.8;filter:hue-rotate(-80deg)}
/* A moving light stays in the margin outside the circular sensor image. It is a visual
   response to fresh measurements only; the camera frame and server decision are unchanged. */
.selfie-coached .camwrap::before{
  content:"";position:absolute;inset:4px;z-index:5;pointer-events:none;border-radius:24px;
  background:linear-gradient(90deg,transparent,#a4fff0,transparent) top left/38% 2px no-repeat,
             linear-gradient(90deg,transparent,#a4fff0,transparent) bottom right/38% 2px no-repeat;
  opacity:.32;
}
.selfie-coached .camwrap[data-coach-fresh=true]::before{
  opacity:.85;animation:llcCameraRail 3s linear infinite;
}
.selfie-coached .camwrap[data-coach-tone=attention]::before{filter:hue-rotate(-80deg)}
@keyframes llcCameraRail{
  0%{background-position:-55% top,155% bottom}
  50%{background-position:155% top,-55% bottom}
  100%{background-position:-55% top,155% bottom}
}
@keyframes llcCameraCorners{0%,100%{opacity:.7}50%{opacity:1}}
/* A measured response lights only the rim outside the face aperture. No filter,
   scan line or painted pixel crosses the evidence frame. */
.selfie-coached #cam[data-coach-fresh=true],
.selfie-coached .camwrap[data-coach-fresh=true]{outline:2px solid rgba(117,224,210,.72);outline-offset:5px}
.selfie-coached #cam[data-coach-tone=attention],
.selfie-coached .camwrap[data-coach-tone=attention]{outline-color:rgba(237,185,103,.8)}
.selfie-coached #cam[data-coach-fresh=true][data-coach-tone=positive],
.selfie-coached .camwrap[data-coach-fresh=true][data-coach-tone=positive]{animation:llcMeasuredRim 2s ease-in-out infinite}
.selfie-coached #cam[data-coach-fresh=true] + .selfie-coach::before,
.selfie-coached .camwrap[data-coach-fresh=true] + .selfie-coach::before{
  content:"";position:absolute;inset:0 12px auto;height:2px;border-radius:999px;
  background:linear-gradient(90deg,transparent,#75e0d2,transparent);
  opacity:.85;pointer-events:none;animation:llcCoachGlimmer 2.3s ease-in-out infinite;
}
#s4 .dots i.on{animation:llcMeasuredDot .34s ease-out both}
#s4 .voice-toggle[data-speaking=true] svg{animation:llcVoicePulse 1s ease-in-out infinite}
@keyframes llcMeasuredRim{0%,100%{outline-color:rgba(117,224,210,.45)}50%{outline-color:rgba(117,224,210,.95)}}
@keyframes llcCoachGlimmer{0%,100%{opacity:.38}50%{opacity:.95}}
@keyframes llcMeasuredDot{0%{transform:scale(.7)}70%{transform:scale(1.55)}100%{transform:scale(1.3)}}
@keyframes llcVoicePulse{0%,100%{opacity:.7}50%{opacity:1}}
@media(prefers-reduced-motion:reduce){
  .selfie-coached .cam::after,.selfie-coached .camwrap::after,
  .selfie-coached .camwrap::before,.selfie-coached #cam,
  .selfie-coached .camwrap,.selfie-coached .selfie-coach::before,
  #s4 .dots i.on,#s4 .voice-toggle svg{animation:none!important;transition:none!important}
}
