body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    background-color: rgb(197,181,165);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.book-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1303 / 900;
    max-width: 1303px;
    background-image: url('../images/openBook_1303x900.png');
    background-size: cover;
    background-position: center;
    /*position: relative;*/
    /*width: min(100%, 1303px, calc((100vh - 120px) * 1303 / 900));*/
    /*margin: 0 auto;*/
}

.book-wrapper {
    position: relative;
    width: min(100%, 1303px, calc((100vh - 120px) * 1303 / 900));
    margin: 0 auto;
}

.category-tab-wrapper {
    position: absolute;
    display: flex;
    flex-direction: column;
    left: 94.96%;
    width: 30px;
    gap: 3px;
}

.category-tab {
    /*position: absolute;*/
    margin-top: auto;
    margin-left: 10px;
    /*left: 95.96%;*/
    width: 20px;
    padding: 8px 4px;
    background: #c9a876;
    border: 1px solid #3d2f1f;
    border-left: none;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-family: "Times New Roman", serif;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    color: #3d2f1f;
    text-decoration: none;
    z-index: 6;
}

.category-tab.active {
    background: #e8d4a8;
    margin-top: auto;
    margin-left: 0px;
    font-weight: bold;
    /*left: 94.26%;*/
    width: 30px;
}

#char-count.warning {
    color: #c0392b;
}

.menu-dropdown {
    position: absolute;
    top: 2%;
    left: 88%;
    background: #f4ecd8;
    border: 1px solid #3d2f1f;
    border-radius: 4px;
    padding: 8px 0;
    min-width: 160px;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.3);
    z-index: 20;
    display: none;
}

.menu-dropdown.open {
    display: block;
}

.menu-dropdown a {
    display: block;
    padding: 8px 16px;
    color: #3d2f1f;
    text-decoration: none;
    font-family: "Times New Roman", serif;
}

#logout-provider-icon {
    vertical-align: middle;
}

.menu-dropdown a:hover {
    background: rgba(0,0,0,0.08);
}

.menu-icon-tab {
    box-sizing: content-box;
    margin-top: auto;
    margin-left: 10px;
    width: 20px;
    padding: 8px 4px;
    background: #c9a876;
    border: 1px solid #3d2f1f;
    border-left: none;
    cursor: pointer;
    color: #3d2f1f;
    z-index: 6;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 0;
    font-size: 0;
}

.auth-menu-dropdown {
    position: relative;
    /*top: 0%;*/
    left: 5%;
    background: #f4ecd8;
    border: 1px solid #3d2f1f;
    border-radius: 4px;
    padding: 4px 10px;
    width: 80%;
    height: 32px;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.3);
    z-index: 20;
    display: none;
    gap: 4px;
}

.auth-menu-dropdown.open {
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-menu-icon {
    /*box-sizing: content-box;*/
    margin-top: 2%;
    margin-left: auto;
    width: 100%;
    /*padding: 8px 4px;*/
    background: #f4ecd8;
    border: none;
    /*border: 1px solid #3d2f1f;*/
    cursor: pointer;
    color: #3d2f1f;
    z-index: 6;
    /*display: flex;*/
    justify-content: center;
    align-items: center;
    height: 20px;
    /*line-height: 16;*/
    font-size: 14px;
}

.auth-menu-icon:hover {
    color: #000;
    background: #c9a876;
}


.submit-login-dropdown {
    position: absolute;
    top: 2%;
    left: 88%;
    background: #f4ecd8;
    border: 1px solid #3d2f1f;
    border-radius: 4px;
    padding: 8px 0;
    min-width: 160px;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.3);
    z-index: 20;
    display: none;
    line-height: 14;
    font-size: 12px;
}

.menu-icon-tab:hover {
    color: #000;
}



.menu-tab {
    font-family: inherit;
    font-size: 16px;
    cursor: pointer;
}

.page {
    position: absolute;
    top: 4.55%;
    height: 85%; /* 85 reduced from 91.62% to leave room below */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.page-nav {
    position: absolute;
    bottom: 3%; /* changed from 1% to get it of the bottom of the page*/
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}


.page-nav-previous {
    position: absolute;
    bottom: 3%; /* changed from 1% to get it of the bottom of the page*/
    left: 5.53%;
    width: 43.14%;
    display: flex;
    justify-content: left;
    gap: 20px;
    pointer-events: none;
}

.page-nav-next {
    position: absolute;
    bottom: 3%; /* changed from 1% to get it of the bottom of the page*/
    left: 50.94%;
    width: 43.02%;
    display: flex;
    justify-content: right;
    gap: 20px;
    pointer-events: none;
}

.page-nav-previous button,
.page-nav-next button {
    pointer-events: auto;
}


.page-left {
    left: 5.53%;
    width: 43.14%;
}

.page-right {
    left: 50.94%;
    width: 43.02%;
}

.page-title {
    text-align: center;
    font-size: 22px;
    font-family: "Times New Roman"/* your chosen font */;
}
.page-subtitle {
    text-align: center;
    font-size: 16px;
}

.page-body-italics-box {
    font-style: italic;
    font-size: 16px;
    border: 1px solid black;
    box-sizing: border-box; /* ensures border is included in width, not added on top */
}

.page-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.page-body * {
    box-sizing: border-box;
}

.page-body p {
    margin: 0 0 10px 0;
}

.p-no-break {
    display: inline;
    margin: 0;
}

.snippet {
    font-size: 14px;
    color: #555;
    margin: 4px 0 12px 0;
}

.submission-title {
    text-align: center;
    font-weight: bold;
    font-size: 16px;
}

.submit-container {
    width: 100%;
    max-width: 700px;
    margin: 40px auto;
    padding: 20px;
}

.toolbar {
    margin-bottom: 15px;
}

.submission-item.deleted {
    opacity: 0.5;
}
.deleted-badge {
    color: #a33;
    font-size: 12px;
    font-weight: bold;
}

/* ============ Mobile View (scaffold) ============ */
.mobile-view .book-wrapper {
    width: min(100%, 651px, calc((100vh - 120px) * 651 / 900));
}

.mobile-view .book-container {
    background-image: url('../images/openBook_right_651x900.png');
    aspect-ratio: 651 / 900;
    max-width: 651px;
}

.mobile-view .page-left,
.mobile-view .page-right {
    left: 1.805%;
    width: 86.106%;
}

.mobile-view .page-nav-previous,
.mobile-view .page-nav-next {
    left: 1.805%;
    width: 86.106%;
}

.mobile-view .category-tab:not(.view-toggle-tab) {
    display: none;
}