/* Added content stays inside the original right-hand page. */
.book-post-tags,
.book-post-neighbors,
.book-comments {
  border-top: 1px solid rgba(65, 55, 44, .18);
  margin-top: 28px;
  padding-top: 18px;
  min-width: 0;
}

.book-post-tags a { margin-right: 12px; }
.book-post-neighbors a { display: block; margin-bottom: 10px; }
.book-comments { padding-bottom: 24px; overflow-wrap: anywhere; }
.book-comments h2 { font-size: 1.15rem; font-weight: 500; margin: 0 0 16px; }
.book-comment-widget iframe { max-width: 100%; }
.book-comment-error { color: #7a5245; }

#book-mobile-nav { display: none; }

@media screen and (max-width: 1200px), screen and (max-height: 900px) {
  #postbox { height: auto; min-height: 100%; padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  #book-mobile-nav { display: block; position: fixed; inset: auto 0 0; z-index: 40; color: #514334; }
  #book-mobile-nav .book-mobile-bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); height: calc(62px + env(safe-area-inset-bottom)); padding: 0 6px env(safe-area-inset-bottom); box-sizing: border-box; border-top: 1px solid rgba(130, 106, 78, .4); background: rgba(246, 237, 217, .84); box-shadow: 0 -3px 12px rgba(38, 25, 15, .1); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  #book-mobile-nav .book-mobile-bar > a,
  #book-mobile-nav .book-mobile-bar > button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; min-height: 44px; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-size: 12px; text-decoration: none; cursor: pointer; }
  #book-mobile-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  #book-mobile-nav .book-mobile-menu { position: absolute; left: 8px; right: 8px; bottom: calc(62px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: min(60vh, 420px); padding: 16px; overflow-y: auto; box-sizing: border-box; border: 1px solid rgba(130, 106, 78, .35); border-radius: 14px 14px 0 0; background: rgba(246, 237, 217, .96); box-shadow: 0 -8px 24px rgba(38, 25, 15, .16); opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(16px); transition: opacity .2s, transform .2s, visibility .2s; }
  #book-mobile-nav.is-open .book-mobile-menu { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
  #book-mobile-nav .book-mobile-menu a { display: block; padding: 12px 10px; border: 1px solid rgba(130, 106, 78, .2); border-radius: 6px; background: rgba(255, 255, 255, .32); color: #514334; text-align: center; font-size: 15px; }
  #book-mobile-nav .book-mobile-menu a span { display: none; }
  #book-mobile-nav .book-mobile-bar > :focus-visible,
  #book-mobile-nav .book-mobile-menu a:focus-visible { outline: 2px solid #087f7f; outline-offset: -3px; }
}

@media (prefers-reduced-motion: reduce) {
  #book-mobile-nav .book-mobile-menu { transition: none; }
}
