:root {
  --header-height: 40px;
  --mobile-nav-height: 45px;
  --main-body-start: 50px;
  --mobile-chapter-select-height: 250px;
  --footer-height: 65px;
  --nav-search-height: 80px;
  --color-tertiary: #dbbbd7;
  --color-secondary: #f7e1d8;
  --color-main: #ba7b87;
  --grey: #c1bfd2;
  --violet: #b57aa2;
  --off-white: #f8f9fa;
  --mobile-breakpoint: 900px;
  --wordcloud-height:500px;
}
.nav-arrows {
    position: absolute;
    text-align: center;
    width: 50%;
    left: 25%;
    z-index: 1;
    font-size: 20px;
    cursor:pointer;
    /* background: rgba(128, 128, 128, 0.255); */
    border-radius: 10px;
}
#nav-prev-page {
background: linear-gradient(to bottom, rgba(0,0,0,0.15), transparent);
}
#nav-prev-page:hover {
    background: rgba(128, 128, 128, 0.608);
}
#nav-next-page {
  background: linear-gradient(to top, rgba(0,0,0,0.15), transparent);
bottom: 10px;
}
#nav-next-page:hover {
    background: rgba(128, 128, 128, 0.608);
}
.navbar-openscript {
    background-color: var(--color-main);
}

.hidden {
  display:none;
}

.nav-buttons {
  display: flex;
  gap: 5px;
  justify-content: space-between;
}

.nav-btn {
  padding: 0;
  padding:4px;
  border: none;
  background: var(--off-white);
  border-radius: 8px;
  display: flex;
  color: var(--violet);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.nav-btn i {
  font-size: 14px;
}

.navbar-openscript-title {
    color: var(--off-white);
}

.navbar-brand {
    display:flex;
}

.logo {
    width: 100%;
    max-width: 25px;
    padding: 5px;
    border-radius: 15px;
}
.verse-group {
    background-color: var(--off-white);
     transition: background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
    position: relative;
  }

.verse-group:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}
.spacing {
  height:100px;
}

  .copy-icon:hover {
    color: var(--color-main);
  }

  body {
  margin: 0;
  font-family: sans-serif;
  background: #f5f5f5;
}

/* Container */
.layout {
  display: grid;
  gap: 20px;
  padding: 20px;
  height: calc(100vh - var(--header-height));

  /* Desktop layout */
  grid-template-columns: 250px 1fr 0fr 250px;
  grid-template-areas: 
    "nav main secondary search";
    max-width: 2200px;
    margin: 0 auto;
    transition: grid-template-columns .5s;
}


.layout.expanded {
  grid-template-columns: 200px .5fr .5fr 250px;
}


.notouchy {
  touch-action: none;
}

/* Sections */
.book-nav {
  grid-area: nav;
  background: #999;
  border-radius: 12px;
  padding: 20px;
}

.main {
  grid-area: main;
  border-radius: 12px;
  padding: 20px;
overflow-y:scroll;
position:relative;
}

.secondary {
  grid-area: secondary;
  border-radius: 12px;
  padding: 20px;
position:relative;
display:none;
}
.secondary.show {
  display:block;
}

.scrollable {
overflow-y:scroll;
}

.search {
  grid-area: search;
  border-radius: 12px;
  padding: 0px;
}

.book-wrapper {
    position: fixed;
    top: var(--main-body-start);
    left: 0px;
    right: 0px;
    /* bottom: var(--footer-height); */
}

.footer-wrapper {
    position: fixed;
    bottom: 0px;
    left: 0px;
    right: 0px;
    height: var(--footer-height);

}

.chapter {
    padding: 10px;
    border-radius: 15px;
    cursor: pointer;
    background-color: var(--color-main);
    display: flex;
    color: var(--off-white);
    justify-content: space-between;
    margin-top: 40px;
}

.transition-active {
  transition: 
    background-color .5s ease,
    border-color .5s ease,
    transform .5s ease,
    box-shadow .5s ease;
}

.transition-active {
  border-color: var(--violet);
  transform: translateX(-10px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}
.icon-wrapper {
    position:relative;
    min-width:25px;
    height:25px;
}
span.icon-copied {
    font-size: 12px;
    position: absolute;
    left:-10px;
}

/* Layout container */
.page-layout {
  display: flex;
  height: 100%;
}

/* Sidebar (desktop) */
.sidebar {
  width: 220px;
  overflow-y: auto;
  border-right: 1px solid #ddd;
}

/* Content */
.content {
  flex: 1;
  overflow-y: auto;
}

/* NAV styles */
.nav-container {
  padding-right: 5px;
    overflow-y: scroll;
    position:relative;
  height: calc(98vh - var(--header-height) - var(--footer-height) - var(--nav-search-height));
}

  .search-nav-wrapper {
    height: var(--nav-search-height);
  }

  .search-icon {
    display:none;
  }

  .search-nav {
  width: 100%;
  max-width: 300px;
    padding: 8px 14px;
    font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-nav:focus {
  border-color: #4a90e2;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

/* Book */
.book-title {
  padding: 8px;
  cursor: pointer;
  user-select: none;
}

.book-title:hover {
  background: var(--color-secondary);
  color: var(--color-main);
}

.active-book {
  font-weight: bold;
  background: var(--color-main);
  color: var(--off-white);
}

/* Chapters */
.chapter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-left: 8px;
  max-height: 1500px;
  overflow:hidden;
  transition: max-height 1s;
}

.chapter-list-hidden {
  max-height:0px;
  transition: max-height .5s;
}

.chapter-nav {
  padding: 2px 4px;
  margin: 2px;
  text-decoration: none;
  color: #444;
  cursor: pointer;
}
.chapter-nav:hover {
  color: var(--grey);
}

.active-chapter {
  background: var(--color-main);
  color: #fff;
  border-radius: 4px;
}

.mobile-chapter-select {
  display:none;
}

nav {
  position:relative;
}

.mobile-clickable-area {
  display:none;
}



.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.05); /* semi-transparent dark */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;

  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-content {
  /* optional: add a slight blur/glass effect */
  backdrop-filter: blur(2px);
}

.text-primary {
  color: var(--color-main) !important
}

.loading-overlay .spinner-border {
    width: 4rem;
    height: 4rem;
}
.dropdown-menu {
  display: none;
  border: 1px solid #ccc;
  padding: 10px;
  background: white;
  position: absolute;
}

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

.open-btn {
      display: inline-block;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: .375rem .75rem;
    font-size: 1rem;
    border-radius: .25rem;
    transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.primary-button {
    color: white;
    background-color: var(--color-main);
    text-overflow: clip;
    text-wrap: nowrap;
}
.primary-button:hover {
    background-color: var(--color-secondary);
    color: black;
}
.primary-button.active {
    box-shadow: 4px 4px 8px black inset;
}

.versions-box {
  overflow:hidden;
  max-height:0px;
  transition: max-height .5s;
    background: white;

        position: fixed;
        z-index:10;
}

.versions-box.show {
  max-height: 75%;
  overflow-y:scroll;
}


  .new-books {
    color: var(--violet);
  }

  .book-group {
    position: relative;
  }
  .new-label {
    position: absolute;
    top: 0px;
    font-size: 9px;
    right: 0px;
    color: var(--color-tertiary);
    display:none;
  }
  .new-label.show {
    display:block;
  }

  .language-group {
    padding: 15px;
  }

  .language-title {
    font-weight: bold;
  }

  .version-list-container {
    list-style: none;
    padding-left: 0px;
  }

  .version-list-item {
        padding-left: 5px;
  }

  .version-title {

  }

  .version-subtitle {

  }

  .version-wrapper {
    padding-bottom: 5px;
    font-size: 14px;
    cursor:pointer;
    width: 100%;
  }

  .version-wrapper:hover {
    opacity:.7;
  }
  .version-dropdown {
    position:relative;
  }

  .current-versions-list {
    padding: 10px 0px;
  }
  .current-commentaries-list {
    padding: 10px 0px;
  }

  .version-label {
    padding: 5px;
    font-size:14px;
    display: flex;
    gap: 10px;
  }
  .remove-version {
    font-size: 16px;
    color: var(--violet);
    cursor: pointer;
  }
  .remove-version:hover {
    color:var(--color-secondary);
  }

.cursor-hover {
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -120%);
  pointer-events: none; /* lets clicks pass through */
  
  opacity: 0;
  transition: opacity 0.15s ease;

  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 14px;
  white-space: nowrap;
  z-index: 9999;
}

.cursor-hover.show {
  opacity: 1;
}

.book-header {
  display:flex;
  gap: 20px;
}

.bookExport {
    font-size: 20px;
    cursor:pointer;
}

.bookExport:hover {
  color: var(--color-tertiary);
}

.verse-card {
    border: 1px solid #ccc;
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 8px;
}

.search-item-header {
    font-size: 18px;
    text-align: center;
    border-bottom: solid var(--violet) 1px;
    cursor:pointer;
}
.search-item-header:hover {
  opacity: .8;
}

.version-block p {
    overflow: hidden;
}
.version-block p:hover {
}

.version-block {
    margin-top: 8px;
}

.main-modal {
  position: fixed;
  z-index: 100;
  width: 95%;
  max-width: 900px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  background: white;
  border-radius: 10px;
  box-shadow: 10px 5px 5px grey;
  max-height: 90%;
  min-height: 85%;
}
.main-modal.show {
  display:block;
}

.exit-main-modal-wrapper {
    position: absolute;
    right: 0px;
    padding: 15px;
    font-size: 24px;
    cursor: pointer;
    color: var(--violet);
}

.exit-main-modal-wrapper:hover {
    color: var(--color-secondary);
}

.exit-button {
    position: absolute;
    right: 0px;
    top: 0px;
    padding: 15px;
    font-size: 24px;
    cursor: pointer;
    color: var(--violet);
}
.exit-button:hover {
    color: var(--color-secondary);
}

.center {
    justify-content: center;
    display: flex;
    align-items: center;
    height: 100%;
    text-align: center;
}

.main-modal-background {
  position:fixed;
  z-index: 99;
    background-color: rgba(128, 128, 128, 0.283);
    top: 0px;
    left: 0px;
    right: 0px;
    bottom: 0px;
    display:none;
}
.main-modal-background.show {
  display:block;
}


.mobile-slider {
  position: fixed;
  z-index: 100;
  background-color:white;
  border-radius: 5px;
  left: 0px;
  right: 0px;
  box-shadow: 10px 5px 5px grey;
  overflow:hidden;
  max-height:0%;
  transition: max-height .5s;
}
.mobile-slider.show {
  max-height:50%;
  overflow-y:scroll;
}
.mobile-slider .content {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 5px;
  flex-direction: column;
}
.mobile-bottom-slider {
  bottom: 0px;
}

.main-modal-content {
  margin-top: 55px;
  padding:25px;
}


.secondary-modal {
  position: fixed;
  z-index: 102;
  width: 80%;
  max-width: 400px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  background: white;
  border-radius: 10px;
  box-shadow: 10px 5px 5px grey;
  min-height: 50%;
}
.secondary-modal.show {
  display:block;
}

.exit-secondary-modal-wrapper {
    float: right;
    padding: 15px;
    font-size: 24px;
    cursor: pointer;
    color: var(--violet);
}

.bible-settings-wrapper {
    display: flex;
    gap: 10px;
}

.exit-secondary-modal-wrapper:hover {
    color: var(--color-secondary);
}

.secondary-modal-background {
  position:fixed;
  z-index: 101;
    background-color: rgba(128, 128, 128, 0.283);
    top: 0px;
    left: 0px;
    right: 0px;
    bottom: 0px;
    display:none;
}
.secondary-modal-background.show {
  display:block;
}

.secondary-modal-content {
  margin-top: 55px;
  padding:25px;
}


.export-wrapper {
  display: flex;
  flex-direction: column;
  gap: 15px;
  position: relative;
}

.choose-control-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.choose-wrapper {
    display: flex;
    flex-direction: column;
    overflow-y: scroll;
    height: 300px;
}


/* --- Horizontal scroll books --- */
.book-scroller {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding: 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.checkbox-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto; /* prevents shrinking */
}

/* --- Center panel --- */
.center-panel {
  display: flex;
  flex-direction: column;
  border: 2px solid #000;
  border-radius: 20px;
  padding: 15px;
  min-height: 300px;
  flex-grow: 1;
}

.format-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.preview {
  flex: 1;
  border: 1px dashed #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-wrapper {
  overflow-y:scroll;
  padding: 10px;
  position:relative;
}

.download-preview {
    position: fixed;
    right: 60px;
    z-index: 11;
}

.export-success-screen {
    position: absolute;
    top: 0px;
    bottom: 0px;
    left: 0px;
    right: 0px;
    background-color: white;
    z-index: 12;
    flex-direction: column;
    gap: 15px;
}

.loading-icon-explanation {
    padding: 15px;
}

.export-success-message {
    text-align: center;
    font-size: 24px;
    margin-bottom: 25px;
}

.export-success-message-secondary {
    text-align: center;
}

.preview-text {
      user-select: none;
    font-size: 30px;
    text-align: center;
    position: fixed;
    left: 60px;
    right: 60px;
    color: rgba(0, 0, 0, 0.301);
}

.loading-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.loading-circle.small {
  width: 40px;
  height:40px;
}

.loading-circle::before {
  content: '';
  position: absolute;
  width: 65px;
  height: 65px;
  background: white;
  border-radius: 50%;
}
.loading-circle.small::before {
  width:30px;
  height:30px;
}
.export-button-wrapper {
    display: flex;
    gap: 15px;
}

.loading-text {
  position: relative;
  font-size: 16px;
  font-weight: bold;
}
.loading-text.small {
  font-size: 10px;
}
.onlymobile {
  display:none;
}

.search-anything-wrapper {
  display:flex;
  gap:5px;
}
.search-anything-box {

}
.search-anything-books {
    padding: 7px;
    border-radius: 5px;
    align-items: center;
    display: flex;
    cursor: pointer;
    position:relative;
}

#num-chosen-books {
    user-select: none;
    background-color: var(--off-white);
    color: var(--color-main);
    padding: 2px 5px;
    position: absolute;
    font-size: 11px;
    height: 20px;
    border-radius: 28px;
    top: -10px;
    right: -10px;
    z-index:15;
    box-shadow: 0 4px 4px rgba(0, 0, 0, 0.18);
}

.book-all {
    font-size: 20px;
    font-weight: 900;
}
.book-section {
    font-size: 16px;
    font-weight: 900;
    padding-left: 5px;
}
.book-subsection {
    font-size: 15px;
    font-weight: 900;
    padding-left: 10px;
}
.book-item {
    font-size: 14px;
    padding-left: 15px;
}

.search-text-match {
  font-weight: 900;
}

.verse-references {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.category-tag {
    display: inline-block;
    background: #eee;
    padding: 2px 6px;
    margin-right: 6px;
    border-radius: 4px;
    font-size: 12px;
}

.category-tag:hover {
  opacity: .8;
}

.verse-reference {
    cursor: pointer;
    font-size: 12px;
    background-color: var(--color-main);
    padding: 2px 6px;
    color: var(--off-white);
}
.verse-reference-disabled {
    cursor: pointer;
    font-size: 12px;
    background-color: var(--grey);
    padding: 2px 6px;
    color: var(--off-white);
}

.verse-reference:hover {
  opacity: .8;
}
.show-additional-button {
    user-select: none;
    cursor: pointer;
}
.show-additional-button:hover {
  opacity: .8;
}

.smaller-summary {
  max-width: 0px;
  max-height:0px;
  overflow:hidden;
}
.smaller-summary.show {
  max-width: 100%;
  max-height:100%;
}

.rawText-preview {
  max-width:250px;
  text-wrap: wrap;
}

.speaker {
  font-size: 12px;
}

.highlight-verse {
      box-shadow: 10px 5px 5px grey;
    background-color: var(--off-white);
}

.images-container {
  max-height: 300px;
  display:flex;
  justify-content: center;
}
.chapter-image {
    width: 100%;
  height: 100%;
  object-fit: cover;
  cursor:pointer;
}
.chapter-image:hover {
  opacity:.8;
}

.verse-image {
    object-fit: cover;
    max-height: 600px;
    width: auto;
}
.verse-image.hoverable {
    cursor:pointer;
}
.verse-image.hoverable:hover {
  opacity:.8;
}

.hover-description {
  width: 150px;
  text-wrap:wrap;
}

.image-description-wrapper {
  max-height:0px;
  overflow-y:hidden;
  transition: max-height 1s;
}
.image-description-wrapper.show {
  max-height:800px;
}
.image-wrapper {
    display: flex;
    justify-content: center;
    padding: 15px;
}
.image-description {
    padding: 15px;
}

.show-images-wrapper-icon {
    position: absolute;
    right: 10px;
    bottom: 5px;
    font-size: 24px;
    color: var(--color-main);
    cursor:pointer;
}
.show-images-wrapper-icon:hover {
  opacity:.8;
}

.wordcloud-controls-wrapper {
  display:flex;
  flex-direction: column;
}

.wordcloud-wrapper {
  height:var(--wordcloud-height);
}
.open-select-box {
    padding: 5px;
    color: var(--color-main);
    border-color: var(--color-main);
    border-radius: 5px;
}
.word-cloud-button {
    cursor: pointer;
    font-size: 24px;
    color: var(--color-tertiary)
}
.commentary-wrapper {
    margin: 40px 0px;
}
.word-cloud-word {
  user-select: none;
  cursor:pointer;
  transition: font-size .5s, top .5s, color .5s, left .5s;
}
.word-cloud-word.selected {
    font-size: 40px !important;
    left: 0px !important;
    top: var(--wordcloud-height) !important;
    color:black !important;
    text-transform: uppercase;
    margin-top: 40px;
}

.word-cloud-search-matches {
    margin-top: 150px;
}

.exit-wordcloud-chapter-wrapper {
    padding-right: 25px;
    position: relative;
    display: inline-block;
}
.exit-wordcloud-chapter {
    position: absolute;
    top: 0px;
    right: 0px;
    border: solid 1px var(--color-main);
    border-radius: 20px;
    color: var(--color-main);
    padding: 0px 4px;
    user-select: none;
    text-align: center;
    font-size: 9px;
    cursor:pointer;
}
.exit-wordcloud-chapter:hover {
  opacity:.8;
}

.footnotes {
    display: flex;
    flex-direction: column;
}

.footnote-list {
  overflow-y:scroll;
  max-height: 0px;
  transition: max-height .5s;
}
.footnote-list.show {
  max-height:400px;
  margin: 15px;
}

.footnotes-icon {
    color: var(--color-main);
    font-size: 20px;
    padding: 5px;
    cursor: pointer;
    position: absolute;
    bottom: 2px;
    right: 35px;
}
.commentary-name {
    font-weight: bold;
    text-align: center;
    border-bottom: solid 1px var(--color-main);
}
.footnotes-icon:hover {
  opacity:.8;
}

.commentary-text {
}

.commentary-title {

}
.commentary-additional-info {
  display:flex;
  justify-content: space-around;
      font-size: 12px;
    padding: 8px;
}

.read-more {
    user-select: none;
    color: var(--color-main);
    cursor: pointer;
    text-align: right;
}

.aside-customization-options .primary-button {
      max-width: 80px;
    text-wrap: wrap;
    font-size: 14px;
}
.aside-customization-options .primary-button.change-commentaries {
    font-size: 12px;
    padding: 0.55rem 0px;
}
.theology-group {

}
.commentary-list {
  list-style: none;
  padding-left: 0px;
}
.commentary-title {

}
.commentary-list-wrapper {
 font-size: 14px;
  cursor:pointer; 
  padding-bottom: 5px;
}

.verse-content {
  display:flex;
}
.recordings-button {
  padding: 0px 10px;
}
.recordings-button i {
  color: var(--color-main);
    font-size: 18px;
    cursor: pointer;
}
.recordings-button i:hover {
  color: var(--color-secondary)
}
.reading-rawText {
  font-weight:bold;
}
/* 📱 Mobile layout */
@media (max-width: 900px) {
  .mobile-hidden {
    display:none;
  }
  .aside-customization-options .primary-button {
      max-width: max-content;
      font-size:12px;
      padding: 5px !important;
}
  .choose-wrapper {
    height:200px;
  }
  #num-chosen-books {
    display:none;
  }
  .onlymobile {
    display:flex;
  }
  .nav-arrows {
    display:none;
  }

  .navbar {
    padding-top: 0px;
    padding-bottom: 0px;
  }
     .mobile-nav-area {
        position: fixed;
        top: var(--header-height);
                background-color: white;
                z-index:10;
    }
    .search {
        position:fixed;
        bottom: 5px;
        background-color: white;
        width: 100%;
    }
  .layout {
    padding: 5px;
  }
  .primary-button {
    font-size: 12px;
  }
  .secondary-modal-content {
      margin-top: 0px;
      padding: 15px;
  }
  button#available-versions-export-button {
    max-width: 140px;
}
  .main-modal-content {
    padding: 10px;
    margin-top:25px;
  }
  .versions-box.show {
    max-height: 35%;
    top: 85px;
  }

  .current-versions-list {
    display:none;
  }
  .current-commentaries-list {
    display:none;
  }

  .chapter-nav {
    padding: 2px 8px;
    font-size: 20px;
}
  .mobile-clickable-area {
    position:fixed;
    z-index: 9;
    left:0px;
    display:block;
    right: 0px;
    bottom: 0px;
    cursor:pointer;
    background: rgba(128, 128, 128, 0.15);
  }
  .mobile-clickable-area.show {
    top: 0px;
  }
  .mobile-chapters {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    max-height:var(--mobile-chapter-select-height);
    overflow-y:scroll;
  }

.close-mobile-chapters {
    position: absolute;
    right: 5px;
    top: 0px;
    cursor: pointer;
}
  .mobile-chapter-select {
        position: fixed;
        display:block;
        box-shadow: 10px 5px 5px grey;
        border-radius: 10px;
        top: 85px;
        overflow: hidden;
        max-height: 0px;
        background: white;
        left: 0px;
        right: 0px;
        z-index: 10;
        transition: max-height .5s;
    }
  .mobile-chapter-select.show {
    max-height:var(--mobile-chapter-select-height);
  }
  .layout {
    grid-template-columns: 100% !important;
    grid-template-rows: 1fr auto;
    grid-template-areas: "main" "search" !important;
  }

  .page-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-top: 1px solid #ddd;
    order: 2; /* moves nav to bottom */
  }

  .content {
    order: 1;
  }

  .main {
    padding: 0px;
  }

  .nav-container {
    display: flex;
    overflow-x: scroll;
    overflow-y:hidden;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
    height: var(--mobile-nav-height);
  }

  .book-group {
    flex: 0 0 auto;
  }

  .chapter-list {
    display: none; /* optional: hide chapters on mobile */
  }
  nav {
    display:flex;
  }
  .search-nav-wrapper {
    overflow-x:hidden;
    width:0px;
    height:var(--mobile-nav-height);
    transition: width .25s;
  }
  .search-nav-wrapper.show {
        width: 100%;
        max-width:250px;
        margin-right: 15px;
  }
  .search-icon {
    display: block;
    font-size: 25px;
    padding: 3px 12px 0px 0px;
    cursor: pointer;
    overflow:hidden;
  }
  .search-icon.hide {
   display:none;
  }
  .search-icon:hover {
    opacity:.7;
  }
}