/* Catalogue shelves retain the Reading Room typography and original cover ratios. */
body[data-theme=library] #collection{padding-top:30px;scroll-margin-top:24px}
body[data-theme=library] #collection .section-head{margin-bottom:20px}
body[data-theme=library] #collection .section-head h2{margin-top:6px}
body[data-theme=library] #collection .filterbar{margin:20px 0 16px}
body[data-theme=library] #collection .results{margin-bottom:20px}
body[data-theme=library] #collection .grid.category-shelves{
 display:block;width:100%;max-width:none;margin:0;min-width:0;
}
body[data-theme=library] #collection .category-shelf{
 padding:0;margin:0 0 30px;min-width:0;max-width:100%;
}
.shelf-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;border-top:1px solid var(--line);padding-top:18px}
.shelf-heading>div:first-child{min-width:0;display:flex;align-items:baseline;gap:14px;flex-wrap:wrap}
.shelf-heading h2{font-size:34px;line-height:1.15;letter-spacing:-.025em}
.shelf-count{font-size:13px;color:var(--muted);white-space:nowrap}
.shelf-controls{display:flex;gap:8px;flex-shrink:0}
.shelf-arrow{display:grid;place-items:center;width:44px;height:44px;border-radius:50%;border:1px solid var(--line);background:transparent;color:var(--ink)}
.shelf-arrow:hover:not(:disabled){background:var(--panel);border-color:var(--muted)}
.shelf-arrow:disabled{opacity:.32;cursor:default}
.shelf-arrow svg{pointer-events:none}
.shelf-arrow[data-shelf-scroll="1"]:not(:disabled){background:var(--ink);border-color:var(--ink);color:var(--paper);box-shadow:0 3px 10px #26382d24}
.shelf-arrow[data-shelf-scroll="1"]:hover:not(:disabled){background:var(--accent);border-color:var(--accent)}
.shelf-track{
 display:grid;grid-auto-flow:column;grid-auto-columns:clamp(185px,18.5vw,240px);align-items:stretch;
 gap:26px;overflow-x:auto;overflow-y:hidden;width:100%;max-width:100%;min-width:0;
 padding:16px 6px 20px;scroll-snap-type:x proximity;scroll-padding-inline:6px;
 overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:#8a806f #e3ddd1;
}
.shelf-track::-webkit-scrollbar{height:8px}
.shelf-track::-webkit-scrollbar-track{background:#e3ddd1;border-radius:8px}
.shelf-track::-webkit-scrollbar-thumb{background:#8a806f;border-radius:8px}
.shelf-track:focus-visible{outline:2px solid var(--accent);outline-offset:4px}
body[data-theme=library] #collection .shelf-track .book-card{scroll-snap-align:start;min-width:0;height:100%;padding-bottom:4px}
body[data-theme=library] #collection .shelf-track .book-image{width:100%;height:auto;aspect-ratio:5/8;padding:0;background:transparent;margin-bottom:14px}
body[data-theme=library] #collection .shelf-track .book-image img{width:100%;height:100%;object-fit:contain}
body[data-theme=library] #collection .shelf-track .book-card h3{font-size:14px;line-height:1.45;margin:8px 0 10px}
body[data-theme=library] #collection .shelf-track .book-card .price{font-size:14px;white-space:nowrap}
@media(max-width:600px){
 body[data-theme=library] #collection{padding-top:20px}
 body[data-theme=library] #collection .category-shelf{margin-bottom:22px}
 .shelf-heading{padding-top:14px;gap:10px}
 .shelf-heading>div:first-child{gap:5px 10px;align-items:center}
 .shelf-heading h2{font-size:28px}
 .shelf-controls{gap:5px}
 .shelf-track{grid-auto-columns:calc((100% - 16px)/2);gap:16px;padding-top:13px;padding-bottom:17px}
 body[data-theme=library] #collection .shelf-track .book-card h3{font-size:13px}
 body[data-theme=library] #collection .shelf-track .book-card .price{font-size:13px;white-space:normal}
 body[data-theme=library] #collection .shelf-track .book-card .niche{font-size:9px}
}
@media(max-width:360px){.shelf-heading h2{font-size:25px}.shelf-heading>div:first-child{display:block}.shelf-count{display:block;margin-top:4px}}
@media(prefers-reduced-motion:reduce){.shelf-track{scroll-behavior:auto!important}}
