/* --- NEW: Layout Stability --- */
#htmlBook, #canvasBook {
    width: 100%;
    /* This must be at least as tall as your book (733px) */
    /* We add a bit of padding for the shadow (total ~800px) */
    min-height: 800px; 
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: hidden; /* Prevents the scrollbar/expansion during flip */
    padding-top: 20px;
}

/* Force the library wrapper to stay centered and stable */
.stf__wrapper {
    margin: 0 auto !important;
}

/* --- Your Original Styles (Keep these) --- */
.demo-block { border-top: solid 1px #dcdcdc; border-bottom: solid 1px #dcdcdc; }
.flip-book { box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.5); margin: 0 auto; display: block; }

.page { 
    padding: 20px; 
    background-color: #fdfaf7; 
    color: #785e3a; 
    border: solid 1px #c2b5a3; 
    overflow: hidden; 
}

.page .page-content { 
    width: 100%; 
    height: 100%; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
}

.page .page-header { height: 30px; font-size: 100%; text-transform: uppercase; text-align: center; }

.page .page-image { 
    height: 100%; 
    background-size: contain; 
    background-position: center center; 
    background-repeat: no-repeat; 
}

.page .page-text { 
    height: 100%; 
    flex-grow: 1; 
    font-size: 80%; 
    text-align: justify; 
    margin-top: 10px; 
    padding-top: 10px; 
    border-top: solid 1px #f4e8d7; 
}

.page .page-footer { height: 30px; border-top: solid 1px #f4e8d7; font-size: 80%; color: #998466; }

/* Flip Classes */
.page.--left { border-right: 0; box-shadow: inset -7px 0 30px -7px rgba(0, 0, 0, 0.4); }
.page.--right { border-left: 0; box-shadow: inset 7px 0 30px -7px rgba(0, 0, 0, 0.4); }
.page.--right .page-footer { text-align: right; }