body {
    margin: 0;
    background: #fafafa;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: #333;
    position: absolute;
    height: 100%;
    width: 100%;
}

.box {
    display: flex;
    margin: 10px;
    align-items: center;
}

#page {
    width: 800px;
    height: auto;
    padding: 0;
    position: relative;
    margin: 40px auto;
    box-shadow: 0 0 4px #ccc;
    border-radius: 5px;
    background: white;
}

#page a, p, ul, li::marker {
    font-size: 0.9em;
}

#page code {
    font-size: 1.25em;
}

#page .box {
    display: block;
    margin: 21px;
}

#toolbar {
    top: 0;
    width: 100%;
    display: flex;
    position: relative;
    height: 40px;
    align-items: center;
    z-index: 10;
    justify-content: center;
}

#toolbar label {
    font-size: small;
    margin-right: 4px;
}

#content {
    top: 0;
    position: absolute;
    display: flex;
    width: 100%;
    height: 100vh;
    align-items: center;
    overflow: hidden;
}

#content.doc {
    height: auto;
    min-height: 100vh;
    overflow: auto;
}

#viewport {
    display: flex;
    align-items: center;
    justify-content: center;
}

#viewport.ltr #prev,
#content.ltr #prev {
    left: 0;
}

#viewport.rtl #prev,
#content.rtl #prev {
    right: 0;
}

#viewport.ltr #next,
#content.ltr #next {
    right: 0;
}

#viewport.rtl #next,
#content.rtl #next {
    left: 0;
}

#prev, #next {
    top: calc(50vh - 37px);
}

#prev::before {
    content: '<';
}

#next::before {
    content: '>';
}

#title {
    width: 900px;
    min-height: 18px;
    margin: 10px auto;
    text-align: center;
    font-size: 16px;
    color: #E2E2E2;
    font-weight: 400;
}

#title:hover {
    color: #777;
}

#viewport.scrolled,
#viewport.paginated {
    background: white;
}

#viewer.scrolled-doc .views-container,
#viewport.scrolled-doc .views-container {
    row-gap: 40px;
    justify-content: center;
}

#viewer.scrolled-doc .view-container,
#viewport.scrolled-doc .view-container {
    background: white;
    box-shadow: 0 0 4px #ccc;
    border-radius: 5px;
}

#viewer.scrolled-doc .view-container:first-of-type,
#viewport.scrolled-doc .view-container:first-of-type {
    margin-top: 40px;
}

#viewer.scrolled-doc .view-container:last-of-type,
#viewport.scrolled-doc .view-container:last-of-type {
    margin-bottom: 40px;
}

#viewer {
    width: 100%;
    height: 100vh;
    display: flex;
    padding: 0;
    overflow: hidden;
    justify-content: center;
}

#viewer .view-container {
    background: white;
}

#viewer.scrolled .viewport-container,
#viewer.paginated .viewport-container {
    margin: 40px 0;
    background: white;
    box-shadow: 0 0 4px #ccc;
    border-radius: 5px;
}

#viewer.paginated {
    align-items: center;
}

#viewer.scrolled {
    align-items: start;
}

#viewer.scrolled-doc {
    width: 100%;
    height: 100vh;
}

#divider {
    display: none;
    position: absolute;
    width: 1px;
    border-right: 1px #000 dashed;
    height: 560px;
    z-index: 1;
    left: 50%;
    opacity: .15;
}

.arrow {
    position: fixed;
    margin: 0 20px;
    font-size: 64px;
    color: #E2E2E2;
    font-family: arial, sans-serif;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    text-decoration: none;
    z-index: 10;
}

.navlink {
    margin: 14px;
    display: block;
    text-align: center;
    text-decoration: none;
    color: #ccc;
}

.arrow:hover,
.navlink:hover {
    color: #777;
}

.arrow:active,
.navlink:hover {
    color: #000;
}

#book-wrapper {
    width: 480px;
    height: 640px;
    overflow: hidden;
    border: 1px solid #ccc;
    margin: 28px auto;
    background: #fff;
    border-radius: 0 5px 5px 0;
    position: absolute;
}

#book-viewer {
    width: 480px;
    height: 660px;
    margin: -30px auto;
    -moz-box-shadow: inset 10px 0 20px rgba(0, 0, 0, .1);
    -webkit-box-shadow: inset 10px 0 20px rgba(0, 0, 0, .1);
    box-shadow: inset 10px 0 20px rgba(0, 0, 0, .1);
}

#book-viewer iframe {
    padding: 40px 40px;
}

#controls {
    width: 100%;
    bottom: calc(50vh - 340px);
    display: flex;
    position: absolute;
    align-items: center;
    justify-content: center;
}

#controls label {
    width: 40px;
    font-size: small;
    text-align: end;
}

#controls input[type=range] {
    width: 340px;
}

#navigation {
    width: 400px;
    height: 100vh;
    position: absolute;
    overflow: auto;
    top: 0;
    left: 0;
    background: #777;
    -webkit-transition: -webkit-transform .25s ease-out;
    -moz-transition: -moz-transform .25s ease-out;
    -ms-transition: -moz-transform .25s ease-out;
    transition: transform .25s ease-out;
}

#navigation.fixed {
    position: fixed;
}

#navigation h1 {
    width: 200px;
    font-size: 16px;
    font-weight: normal;
    color: #fff;
    margin-bottom: 10px;
}

#navigation h2 {
    font-size: 14px;
    font-weight: normal;
    color: #B0B0B0;
    margin-bottom: 20px;
}

#navigation ul {
    padding-left: 36px;
    margin-left: 0;
    margin-top: 12px;
    margin-bottom: 12px;
    width: 340px;
}

#navigation ul li {
    list-style: decimal;
    margin-bottom: 10px;
    color: #cccddd;
    font-size: 12px;
    padding-left: 0;
    margin-left: 0;
}

#navigation ul li a {
    color: #ccc;
    text-decoration: none;
}

#navigation ul li a:hover {
    color: #fff;
    text-decoration: underline;
}

#navigation ul li a.active {
    color: #fff;
}

#navigation #cover {
    display: block;
    margin: 24px auto;
}

#navigation #closer {
    position: absolute;
    top: 0;
    right: 0;
    padding: 12px;
    color: #cccddd;
    width: 24px;
}

#navigation.closed {
    -webkit-transform: translate(-400px, 0);
    -moz-transform: translate(-400px, 0);
    -ms-transform: translate(-400px, 0);
    transform: translate(-400px, 0);
}

svg {
    display: block;
}

.close-x {
    stroke: #cccddd;
    fill: transparent;
    stroke-linecap: round;
    stroke-width: 5;
}

.close-x:hover {
    stroke: #fff;
}

#opener {
    position: absolute;
    top: 0;
    left: 0;
    padding: 10px;
    stroke: #E2E2E2;
    fill: #E2E2E2;

}

#opener:hover {
    stroke: #777;
    fill: #777;
}

#annotations {
    width: 600px;
    height: calc((100% - 600px)/2 - 80px);
    margin: 40px auto;
    position: relative;
    z-index: 10;
}

#annotations ul {
    height: 100%;
    margin-left: 0;
    padding: 0;
    overflow: auto;
}

#annotations li {
    list-style: none;
    border-top: 1px solid #E2E2E2;
    padding: 10px;
}

#annotations a {
    display: block;
}

/**
 * iPhone 5             : 320 x 568
 * iPhone 6/7/8         : 375 x 667
 * iPhone 11 Pro        : 375 x 812
 * Pixel 7              : 412 x 915
 * iPhone 6/7/8 Plus    : 414 x 736
 * iPhone 11            : 414 x 896
 * iPhone 12/14         : 390 x 844
 * iPhone 14/15 Pro Max : 430 x 932
 */
@media
only screen and (min-width: 320px) and (max-width: 430px) and (orientation: portrait),
only screen and (min-width: 568px) and (max-width: 932px) and (orientation: landscape) {
    #content.mobile #page {
        width: 100%;
        margin: 0;
        box-shadow: none;
        border-radius: 0;
    }
    #content.mobile #viewer.paginated {
        width: 100%;
        height: 100%;
        box-shadow: none;
        border-radius: 0;
    }
    #content.mobile #viewer.scrolled {
        width: 100%;
        height: 100%;
        margin: 0;
        box-shadow: none;
        border-radius: 0;
    }
}

/**
 * iPad Mini       :  768 x 1024
 * iPad 10.2       :  810 x 1080
 * iPad Air (2020) :  820 x 1180
 * iPad Air        :  834 x 1112
 * iPad Pro 11     :  834 x 1194
 * iPad Pro 12.9   : 1024 x 1366
 */
@media
only screen and (min-width: 768px) and (max-width: 1024px) and (orientation: portrait),
only screen and (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) {
    #content.mobile #page {
        width: 100%;
        margin: 0;
        box-shadow: none;
        border-radius: 0;
    }
    #content.mobile #viewer.paginated {
        width: 100%;
        height: 100%;
        box-shadow: none;
        border-radius: 0;
    }
    #content.mobile #viewer.scrolled {
        width: 100%;
        height: 100%;
        margin: 0;
        box-shadow: none;
        border-radius: 0;
    }
}

#loader {
    align-self: center;
    animation: spin 1s linear infinite;
    border: 10px solid #E2E2E2;
    border-top: 10px solid #777;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    position: absolute;
    z-index: 10;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}