/* Quick browsing, cover scale and document pagination. */
.library-quickbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: -4px 0 22px;
}
.library-group-switch {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px;
  flex-shrink: 0;
  background: var(--white);
}
.library-group-switch button {
  padding: 6px 10px;
  min-height: 32px;
  border-radius: 2px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.library-group-switch [aria-pressed='true'] {
  background: var(--green);
  color: var(--paper);
}
.library-region-switch {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1;
  overflow-x: auto;
  min-width: 240px;
  scrollbar-width: thin;
}
.library-region-switch #regions {
  display: contents;
}
.compact .library-region-switch .side {
  width: auto;
  min-height: 36px;
  padding: 7px 10px;
  font-size: 11px;
  white-space: nowrap;
  margin: 0;
}
.library-region-switch .side span {
  display: none;
}
.library-size-control,
.library-page-size-control {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.library-quickbar select,
.shelf-pagination-top select,
.shelf-pager select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  font: 11px var(--font);
  padding: 6px;
}
.shelf-pagination-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.shelf-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11px;
  flex: 1;
}
#shelf-pager-bottom {
  margin-top: 30px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.shelf-page-controls {
  display: flex;
  gap: 5px;
  align-items: center;
}
.shelf-page-controls label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}
.shelf-page-controls button {
  min-height: 36px;
  min-width: 32px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink);
  background: var(--white);
  font-size: 11px;
}
.shelf-page-controls button:disabled {
  opacity: 0.35;
}
.compact #shelf:not(.list) {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 185px), 1fr));
}
.compact #shelf[data-cover-size='small']:not(.list) {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
}
.compact #shelf[data-cover-size='large']:not(.list) {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
}
.compact #shelf:not(.list) .cover {
  max-height: none;
}
.compact #shelf[data-cover-size='large']:not(.list) .cover {
  aspect-ratio: 0.95;
  padding: 18px;
}
@media screen and (max-width: 1050px) and (min-width: 901px) {
  .library-workspace.has-tools {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px;
  }
}
@media screen and (max-width: 900px) {
  .library-workspace.has-tools {
    grid-template-columns: minmax(0, 1fr);
  }
  .library-tools-panel:not([hidden]) {
    order: -1;
    position: static;
    height: min(460px, 52dvh);
    max-height: 52dvh;
  }
  .library-workspace {
    scroll-margin-top: 12px;
  }
}
@media screen and (max-width: 700px) {
  .library-quickbar {
    gap: 8px;
    margin-bottom: 16px;
  }
  .library-region-switch {
    order: 3;
    flex-basis: 100%;
    min-width: 0;
    scrollbar-width: none;
  }
  .library-region-switch::-webkit-scrollbar {
    display: none;
  }
  .library-size-control {
    margin-left: auto;
  }
  .library-group-switch button {
    padding-inline: 9px;
    min-height: 38px;
  }
  .library-quickbar select,
  .shelf-pagination-top select,
  .shelf-pager select {
    font-size: 16px;
    min-height: 40px;
  }
  .library-size-control select {
    width: 87px;
  }
  .shelf-pager {
    gap: 8px;
  }
  .shelf-page-controls {
    width: 100%;
    justify-content: space-between;
  }
  .shelf-page-controls button {
    min-height: 44px;
    padding-inline: 8px;
  }
  .shelf-page-controls label {
    font-size: 0;
    gap: 0;
  }
  .shelf-pagination-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .shelf-pagination-top .shelf-pager {
    display: contents;
  }
  .shelf-pagination-top .library-page-size-control {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    font-size: 0;
  }
  .shelf-pagination-top .shelf-page-range {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
  }
  .shelf-pagination-top .shelf-page-controls {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .compact #shelf:not(.list) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .compact #shelf[data-cover-size='small']:not(.list) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px 10px;
  }
  .compact #shelf[data-cover-size='small']:not(.list) .cover {
    padding: 7px;
  }
  .compact #shelf[data-cover-size='small']:not(.list) .card-title {
    font-size: 19px;
  }
  .compact #shelf[data-cover-size='small']:not(.list) .card-bottom {
    flex-wrap: wrap;
    gap: 7px;
  }
  .compact #shelf[data-cover-size='large']:not(.list) {
    grid-template-columns: minmax(0, 1fr);
  }
  .library-tools-header {
    padding: 10px 14px;
  }
  .library-tools-tabs {
    padding-inline: 14px;
  }
  .library-tools-body {
    padding: 16px 14px;
  }
  .compact .library-tools-panel .library-tools-footer {
    padding: 10px 14px;
  }
}
