/* Andy Stories fullscreen patch v13. Does not change normal reading layout. */
#reader:fullscreen,
#reader:-webkit-full-screen,
#reader.andy-fullscreen-fallback {
  box-sizing:border-box;
  width:100%;height:100dvh;max-width:none;max-height:none;
  margin:0;padding:12px clamp(10px,2vw,28px);
  display:flex!important;flex-direction:column;
  overflow:hidden;isolation:isolate;
  background:#faf8f3;color:#292638;
}
#reader.andy-fullscreen-fallback{
  position:fixed;inset:0;z-index:99999;
  height:100dvh;
}
html.andy-fullscreen-locked,body.andy-fullscreen-locked{overflow:hidden!important}
#reader:fullscreen .readerTop,
#reader:-webkit-full-screen .readerTop,
#reader.andy-fullscreen-fallback .readerTop{
  flex:0 0 auto;margin:0 0 7px!important;
}
#reader:fullscreen .readingStage,
#reader:-webkit-full-screen .readingStage,
#reader.andy-fullscreen-fallback .readingStage{
  width:100%;max-width:none;
  flex:1 1 auto;min-height:0!important;
  height:auto!important;
  margin:0 auto 6px!important;
  padding:5px!important;
  display:grid;place-items:center;
  overflow:hidden!important;
}
#reader:fullscreen .flipFrame,
#reader:-webkit-full-screen .flipFrame,
#reader.andy-fullscreen-fallback .flipFrame{
  width:100%;height:100%;max-height:100%;min-height:0;
}
#reader:fullscreen .controls,
#reader:-webkit-full-screen .controls,
#reader.andy-fullscreen-fallback .controls{
  flex:0 0 auto;margin:0 auto!important;
  max-width:100%;
}
#reader:fullscreen #voiceNote,
#reader:-webkit-full-screen #voiceNote,
#reader.andy-fullscreen-fallback #voiceNote{
  flex:0 0 auto;min-height:0;margin:2px 0 0!important;
}
/* Use the dedicated mobile page without letting the desktop flipFrame occupy space. */
@media(max-width:700px){
 #reader.andy-mobile-reading:fullscreen,
 #reader.andy-mobile-reading:-webkit-full-screen,
 #reader.andy-mobile-reading.andy-fullscreen-fallback{
   padding:max(6px,env(safe-area-inset-top)) 8px max(7px,env(safe-area-inset-bottom));
 }
 #reader.andy-mobile-reading:fullscreen .readingStage,
 #reader.andy-mobile-reading:-webkit-full-screen .readingStage,
 #reader.andy-mobile-reading.andy-fullscreen-fallback .readingStage{
   flex:1 1 auto;display:block!important;min-height:0!important;
   height:auto!important;margin:0!important;padding:0!important;
   overflow:hidden!important;
 }
 #reader.andy-mobile-reading:fullscreen .andy-mobile-page,
 #reader.andy-mobile-reading:-webkit-full-screen .andy-mobile-page,
 #reader.andy-mobile-reading.andy-fullscreen-fallback .andy-mobile-page{
   width:100%;height:100%!important;max-height:100%!important;
   min-height:0!important;box-shadow:none;
 }
 #reader.andy-mobile-reading:fullscreen .controls,
 #reader.andy-mobile-reading:-webkit-full-screen .controls,
 #reader.andy-mobile-reading.andy-fullscreen-fallback .controls{
   flex:0 0 auto;width:100%;margin:5px 0 0!important;
   padding:4px 5px!important;
   position:relative!important;
 }
 #reader.andy-mobile-reading:fullscreen .readerTop,
 #reader.andy-mobile-reading:-webkit-full-screen .readerTop,
 #reader.andy-mobile-reading.andy-fullscreen-fallback .readerTop{
   margin:0 0 5px!important;
 }
 #reader.andy-mobile-reading:fullscreen #voiceNote,
 #reader.andy-mobile-reading:-webkit-full-screen #voiceNote,
 #reader.andy-mobile-reading.andy-fullscreen-fallback #voiceNote{
   min-height:0!important;line-height:1.2;
 }
}
