/* PV LAB Video / Extend: match the two compact reference actions used in Create.
   Presentation only. The existing upload, saved Elements, clip, History and quote
   handlers remain unchanged. These rules intentionally apply to Extend only. */
#app.video-studio-active.video-extend-active #reference-mode:not([hidden]):has(> #reference-drop){
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  column-gap:8px!important;
  row-gap:9px!important;
  align-items:stretch!important;
}
#app.video-studio-active.video-extend-active #reference-mode #extend-help:not([hidden]){
  grid-column:1/-1!important;
}
#app.video-studio-active.video-extend-active #reference-mode #reference-drop{
  display:grid!important;
  grid-column:1!important;
  width:100%!important;
  min-width:0!important;
  box-sizing:border-box!important;
}
#app.video-studio-active.video-extend-active #reference-mode:has(> #reference-drop)>.scene-video-access{
  display:flex!important;
  grid-column:2!important;
  width:100%!important;
  min-width:0!important;
  box-sizing:border-box!important;
}
#app.video-studio-active.video-extend-active #reference-mode #scene-video-open{
  min-width:0!important;
  width:100%!important;
}
#app.video-studio-active.video-extend-active #reference-mode #reference-media:not([hidden]){
  grid-column:1/-1!important;
  min-width:0!important;
  width:100%!important;
}
#app.video-studio-active.video-extend-active #reference-mode #reference-list:not(:empty){
  display:grid!important;
  grid-column:1/-1!important;
}
#app.video-studio-active.video-extend-active #reference-mode #pv-video-ref-title:not([hidden]),
#app.video-studio-active.video-extend-active #reference-mode #scene-video-selected:not([hidden]){
  display:flex!important;
  grid-column:1/-1!important;
}
#app.video-studio-active.video-extend-active #reference-mode #reference-progress:not(:empty){
  display:block!important;
  grid-column:1/-1!important;
}
@media(max-width:440px){
  #app.video-studio-active.video-extend-active #reference-mode:not([hidden]):has(> #reference-drop){
    column-gap:6px!important;
  }
  #app.video-studio-active.video-extend-active #reference-mode #reference-drop,
  #app.video-studio-active.video-extend-active #reference-mode>.scene-video-access{
    min-width:0!important;
  }
}

/* Extend-only vertical rhythm: bring the clip input directly beneath the
   two reference cards. Avoid empty lists reserving space before the prompt. */
#app.video-studio-active.video-extend-active #reference-mode:not([hidden]):has(> #reference-drop){
  row-gap:10px!important;
}
#app.video-studio-active.pv-video-approved-ready.pv-video-state-ready.video-extend-active #reference-mode #reference-media:not([hidden]){
  gap:10px!important;
}
#app.video-studio-active.video-extend-active #reference-mode #reference-media .video-media-heading{
  margin:0!important;
  padding:0 1px!important;
}
#app.video-studio-active.pv-video-approved-ready.pv-video-state-ready.video-extend-active #reference-mode #video-media-drop{
  min-height:74px!important;
  height:74px!important;
  padding:9px!important;
}
#app.video-studio-active.video-extend-active #reference-mode #reference-list:empty,
#app.video-studio-active.video-extend-active #reference-mode #video-reference-list:empty{
  display:none!important;
}
#app.video-studio-active.video-extend-active .workspace.video-layout .controls-body>#pv-video-prompt-head{
  margin-top:0!important;
}

/* Video Upscaler mounts its controls in the shared inspector. Those controls
   should never leak into Video creation, Image or another studio route.
   Keep them available exclusively to Upscaler when video mode is active. */
#app:not(.upscale-studio-active) .pv-video-upscale-inline-resolution,
#app:not(.upscale-studio-active) .pv-video-upscale-quote,
#app:not(.upscale-studio-active) .pv-video-upscale-message{
  display:none!important;
}

/* Explicit route choice when Extend also has identity photographs. */
#app.video-studio-active.video-extend-active #extend-reference-switch:not([hidden]){
 display:inline-flex!important;align-items:center;justify-content:center;
 max-width:100%;min-height:32px;margin:9px 0 0;padding:6px 11px;
 border:1px solid #69717c;border-radius:6px;background:#20242a;color:#f1f3f4;
 font:600 11px/1.3 'DM Sans',sans-serif;text-align:left;cursor:pointer;
}
#app.video-studio-active.video-extend-active #extend-reference-switch:not([hidden]):hover,
#app.video-studio-active.video-extend-active #extend-reference-switch:not([hidden]):focus-visible{background:#323941;border-color:#b3bac4;}
#app.video-studio-active.video-extend-active #extend-reference-switch:disabled{opacity:.5;cursor:not-allowed;}
