/* The modal sits inside the scaled presentation on landscape devices. Constrain the grid
   track itself so a long catalogue scrolls in its pane instead of growing past the stage. */
#overlay[data-panel="contents"] {grid-template: minmax(0,1fr) / minmax(0,1fr);overflow:hidden}
#overlay[data-panel="contents"] #dialog {
  display:grid;grid-template-rows:auto minmax(0,1fr);height:100%;max-height:100%;min-height:0;
  overflow:hidden;box-sizing:border-box
}
#overlay[data-panel="contents"] #dlg-body {
  overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain;touch-action:pan-y;
  scrollbar-gutter:stable;scrollbar-color:#8c8058 #202020;padding-right:5px;padding-bottom:10px;
  -webkit-overflow-scrolling:touch
}
#overlay[data-panel="contents"] #dlg-body .item {white-space:normal;flex-shrink:0}
.illustrated-reader>.reader-figure {margin:0;min-width:0}
