.shelf-heading-panel {
  padding: clamp(20px, 3vw, 36px) clamp(16px, 3vw, 38px);
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  background: linear-gradient(105deg, #f3eddeed, #fbf8f085), url("assets/paper.gif");
}
.shelf-heading-panel .page-lead { margin-top: 4px; }
.shelf-nav {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 20px 0 0;
  border-block: 1px solid var(--line);
  background: #f3eee3;
}
.shelf-nav a {
  display: grid;
  place-items: center;
  min-height: 43px;
  padding: 6px 8px;
  border-bottom: 2px solid transparent;
  text-align: center;
  font-size: 14px;
  line-height: 1.4;
}
.shelf-nav a:hover, .shelf-nav a[aria-current] { background: #eae0cd; color: var(--red); }
.shelf-nav a[aria-current] { border-bottom-color: var(--red); font-weight: 700; }
.shelf-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 0;
}
#shelfStatus { color: var(--muted); font: 14px/1.5 var(--sans); }
.shelf-search {
  display: flex;
  align-items: center;
  width: min(100%, 268px);
  border: 1px solid #bfb2a1;
  background: #fffcf6;
}
.shelf-search input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 7px 10px;
  border: 0;
  background: none;
  font-size: 14px;
}
.shelf-search input::placeholder { color: var(--muted); }
.shelf-search input::-webkit-search-cancel-button { display: none; }
.shelf-search button {
  flex: none;
  min-height: 38px;
  padding: 4px 10px;
  border: 0;
  border-left: 1px solid var(--line);
  background: #f3eee3;
  color: var(--red);
  font-size: 13px;
}
.shelf-list {
  padding: 0;
  margin: 0;
  list-style: none;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 22px 18px;
}
.shelf-list .book {
  height: 100%;
  border: 1px solid #e4ddcf;
  background: #fdfaf3;
}
.shelf-list .book:hover { border-color: #b79e7f; }
.shelf-list .book:hover .shelf-book-title { color: var(--red); }
.shelf-list .book .cover {
  height: clamp(168px, 17vw, 232px);
  border: 0;
  border-bottom: 1px solid #e4ddcf;
}
.shelf-list li:nth-child(4n+2) .cover { background-color: #f3e9df; }
.shelf-list li:nth-child(4n+3) .cover { background-color: #ecebe2; }
.shelf-list li:nth-child(4n+4) .cover { background-color: #eee8dd; }
.shelf-book-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  padding: 12px 11px;
  overflow-wrap: anywhere;
}
.shelf-book-title { font: 650 16px/1.48 var(--serif); color: #463021; }
.shelf-book-author { font-size: 12px; line-height: 1.45; color: var(--muted); }
.shelf-book-facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 3px 8px;
  margin-top: auto;
  padding-top: 3px;
}
.shelf-list .shelf-no-cover {
  min-height: 146px;
  background: #f5efe1;
}
.shelf-no-cover .shelf-book-copy { padding: 18px 14px; }
.shelf-no-cover .shelf-book-title {
  margin-bottom: 2px;
  padding-top: 10px;
  border-top: 2px solid #a2775a;
}
.shelf-empty {
  padding: 22px 16px;
  border: 1px solid var(--line);
  background: #fffcf6;
  color: var(--muted);
}
.shelf-note { padding-bottom: 13px; color: var(--muted); font-size: 13px; }
@media (max-width: 1023px) {
  .shelf-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .shelf-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 580px) {
  .shelf-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; }
  .shelf-nav a { min-height: 38px; padding-inline: 3px; font-size: 13px; }
  .shelf-tools { padding-block: 11px; }
  .shelf-search { width: min(65%, 250px); }
  .shelf-search input { padding-inline: 7px; font-size: 13px; }
  .shelf-search button { padding-inline: 5px; }
  .shelf-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .shelf-list .book .cover { height: clamp(142px, 44vw, 215px); }
  .shelf-book-copy { padding: 9px; }
  .shelf-list .shelf-no-cover { min-height: 135px; }
  .shelf-no-cover .shelf-book-copy { padding: 13px 10px; }
}
