/* Copy the light bookshelf measurements into dark themes without copying paint. */
.app-shell.library-mode:is([data-theme="dark"], [data-theme="midnightLibrary"], [data-theme="warmWalnut"], [data-theme="emeraldStudy"]) .data-driven-bookshelf .wall-shelf {
  height: var(--responsive-shelf-height) !important;
  min-height: var(--responsive-shelf-height) !important;
  max-height: none !important;
  padding: calc(var(--responsive-shelf-padding) + 10px) var(--responsive-shelf-padding) 52px !important;
}

.app-shell.library-mode:is([data-theme="dark"], [data-theme="midnightLibrary"], [data-theme="warmWalnut"], [data-theme="emeraldStudy"]) .data-driven-bookshelf .wall-shelf-books {
  position: absolute !important;
  right: max(4px, calc(var(--responsive-shelf-padding) - 8px)) !important;
  bottom: 38px !important;
  left: max(4px, calc(var(--responsive-shelf-padding) - 8px)) !important;
  align-items: flex-end !important;
  gap: 0 !important;
  width: auto !important;
  height: calc(var(--responsive-shelf-height) - 66px) !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.app-shell.library-mode:is([data-theme="dark"], [data-theme="midnightLibrary"], [data-theme="warmWalnut"], [data-theme="emeraldStudy"]) .data-driven-bookshelf .wall-shelf-book-run {
  min-width: 0 !important;
  max-width: 100% !important;
  height: 100% !important;
  gap: clamp(1px, calc(var(--responsive-book-gap) * 0.55), 3px) !important;
  padding-right: 4px !important;
  padding-left: 0 !important;
  overflow: hidden !important;
}

.app-shell.library-mode:is([data-theme="dark"], [data-theme="midnightLibrary"], [data-theme="warmWalnut"], [data-theme="emeraldStudy"]) .data-driven-bookshelf .book-spine {
  flex: 0 0 var(--responsive-book-width) !important;
  flex-basis: var(--responsive-book-width) !important;
  width: var(--responsive-book-width) !important;
  min-width: var(--responsive-book-width) !important;
  max-width: var(--responsive-book-width) !important;
  height: calc(var(--responsive-shelf-height) - 68px) !important;
  padding: 18px 3px 16px !important;
}

.app-shell.library-mode:is([data-theme="dark"], [data-theme="midnightLibrary"], [data-theme="warmWalnut"], [data-theme="emeraldStudy"]) .data-driven-bookshelf .wall-shelf-books > .decor-item[class*="decor-library-"] {
  flex: 0 0 var(--responsive-decor-width) !important;
  flex-basis: var(--responsive-decor-width) !important;
  width: var(--responsive-decor-width) !important;
  min-width: var(--responsive-decor-width) !important;
  max-width: var(--responsive-decor-width) !important;
  height: min(calc(var(--responsive-shelf-height) - 48px), calc(var(--responsive-decor-width) * var(--approved-shelf-asset-ratio, 1.08))) !important;
  align-self: flex-end !important;
  margin: 0 !important;
  transform: none !important;
  transform-origin: center bottom !important;
}

@media (max-width: 719px) {
  .app-shell.library-mode:is([data-theme="dark"], [data-theme="midnightLibrary"], [data-theme="warmWalnut"], [data-theme="emeraldStudy"]) .data-driven-bookshelf .wall-shelf {
    padding-right: var(--responsive-shelf-padding) !important;
    padding-left: var(--responsive-shelf-padding) !important;
  }
}
