/* Shelf · Prototypes-v2_DONE 2178:13904; shared dock 2195:17254.
   Shared Figma typography uses whole-pixel sizes; EPUB reading styles are isolated. */
#library-screen.shelf-clean {
  --shelf-bg: #0b0c0a;
  --shelf-text: #f1e2c9;
  --shelf-accent: #ff6c4b;
  --shelf-gutter: 21px;
  background: var(--shelf-bg) !important;
  color: var(--shelf-text);
  font-family: "Geologica Pilcrow", system-ui, sans-serif;
}
#library-screen.shelf-clean::after { content: none; }
.shelf-clean *, .shelf-popup *, .shelf-dialog * { box-sizing: border-box; }
.shelf-clean button, .shelf-popup button, .shelf-dialog button { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.shelf-clean button:disabled, .shelf-popup button:disabled { cursor: default; }
.shelf-clean button:focus-visible, .shelf-popup button:focus-visible, .shelf-dialog button:focus-visible { outline: 2px solid #ff6c4b; outline-offset: 2px; }
.shelf-clean [hidden], .shelf-popup[hidden] { display: none !important; }
.shelf-library { height: 100%; display: flex; flex-direction: column; }
.shelf-header { position: relative; z-index: 6; flex: none; padding: max(54px, calc(env(safe-area-inset-top) + 11px)) 18px 11px; background: var(--shelf-bg); }
.shelf-sr-only, #shelf-search-results { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip-path: inset(50%); white-space: nowrap; border: 0; }
.shelf-top-row { display: flex; align-items: center; justify-content: space-between; height: 36px; }
.shelf-world-switch { display: flex; align-items: center; width: 160px; height: 36px; padding: 2px; border: 1px solid #2b2b2a; border-radius: 999px; background: #111210; }
.shelf-world-switch button { flex: 1; height: 31px; padding: 0; border: 0; border-radius: 999px; background: transparent; color: #969794; font: 300 12px/16px "Geologica Pilcrow", sans-serif; }
.shelf-world-switch button.is-active { flex: 0 0 74px; background: #ff6c4b; color: #f1e2c9; }
.shelf-search-row { position: relative; height: 33px; margin: 23px 4px 0 -10px; }
.shelf-search-field { position: absolute; inset: 0; border: 1px solid #353637; border-radius: 999px; background: #202121; opacity: 0; transform: scaleX(.1); transform-origin: 23px center; pointer-events: none; transition: transform 320ms cubic-bezier(.22,1,.36,1), opacity 160ms ease; }
.shelf-search-field input { appearance: none; width: 100%; height: 100%; min-width: 0; padding: 0 34px 0 48px; border: 0; outline: none; border-radius: inherit; background: transparent; color: #f1e2c9; font: 300 11px/14px "Geologica Pilcrow", sans-serif; opacity: 0; transition: opacity 130ms ease; }
.shelf-search-field:focus-within { border-color: #797c79; }
.shelf-search-field input::placeholder { color: #505050; opacity: 1; }
.shelf-search-field input::-webkit-search-cancel-button { display: none; }
#shelf-search-clear { position: absolute; right: 7px; top: 0; display: grid; place-items: center; width: 30px; height: 31px; padding: 0; background: none; border: 0; opacity: 0; transition: opacity 130ms ease; }
.shelf-search-toggle { position: absolute; left: 0; top: -5px; z-index: 2; width: 48px; height: 43px; padding: 0; border: 0; background: none; border-radius: 24px; }
.shelf-search-toggle img { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); max-width: none; transition: opacity 180ms ease; }
.shelf-search-icon-open { opacity: 0; }
.shelf-clean[data-searching="true"][data-search-open="false"] .shelf-search-toggle::after { content: ''; position: absolute; left: 29px; top: 9px; width: 5px; height: 5px; border-radius: 50%; background: var(--shelf-accent); }
.shelf-add { display: flex; align-items: center; justify-content: center; gap: 6px; width: 92px; height: 36px; border: 1px solid #2b2b2a; border-radius: 999px; background: #111210; color: #f1e2c9; font: 600 12px/16px "Geologica Pilcrow", sans-serif; padding: 0 12px; }
.shelf-add img { flex: none; max-width: none; }
.shelf-status-viewport { position: absolute; top: -5px; left: 48px; right: -22px; height: 43px; overflow: hidden; pointer-events: none; }
.shelf-filters { display: flex; align-items: center; gap: 15px; position: absolute; top: 0; left: 10px; right: 0; height: 43px; margin: 0; padding: 0 12px 0 0; overflow: auto hidden; scrollbar-width: none; pointer-events: auto; transition: opacity 180ms ease, transform 280ms cubic-bezier(.22,1,.36,1); }
.shelf-filters::-webkit-scrollbar { display: none; }
.shelf-filters button { flex: none; white-space: nowrap; border: 0; border-radius: 0; padding: 0; height: 43px; background: none; color: #505050; font: 400 14px/18px "Geologica Pilcrow", sans-serif; }
.shelf-filters button.is-active { background: none; color: #f1e2c9; }
.shelf-clean[data-search-open="true"] .shelf-filters { opacity: 0; transform: translateX(14px); pointer-events: none; }
.shelf-clean[data-search-open="true"] .shelf-search-field { opacity: 1; transform: scaleX(1); pointer-events: auto; }
.shelf-clean[data-search-open="true"] .shelf-search-field input,
.shelf-clean[data-search-open="true"] #shelf-search-clear { opacity: 1; transition-delay: 80ms; }
.shelf-clean[data-search-open="true"] .shelf-search-icon-open { opacity: 1; }
.shelf-clean[data-search-open="true"] .shelf-search-icon-closed { opacity: 0; }
.shelf-toolbar { display: flex; align-items: center; justify-content: space-between; position: relative; height: 24px; margin: 11px 4px 0; }
.shelf-sort-control { position: relative; }
.shelf-sort-button { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0; border: 0; background: none; color: #505050; font: 300 12px/16px "Geologica Pilcrow", sans-serif; }
.shelf-line-icon { position: relative; width: 16px; height: 16px; flex: none; }
.shelf-line-icon i { position: absolute; left: 0; top: 2px; height: 2px; width: 16px; border-radius: 1px; background: currentColor; }
.shelf-line-icon i:nth-child(2) { top: 7px; }
.shelf-line-icon i:nth-child(3) { top: 13px; }
.shelf-grid-icon { display: grid; grid-template-columns: repeat(2, 7px); grid-template-rows: repeat(2, 7px); gap: 2px; width: 16px; height: 16px; }
.shelf-grid-icon i { background: currentColor; border-radius: 2px; }
.shelf-view-switcher { display: flex; gap: 3px; margin-right: -5px; }
.shelf-view-switcher button { display: grid; place-items: center; padding: 0; width: 25px; height: 32px; border: 0; background: none; color: #505050; }
.shelf-view-switcher button.is-active { color: #ff6c4b; }
#shelf-search-results { margin: 0 4px; color: #fafaf7; font-size: 11px; font-weight: 300; }
.shelf-scroll { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; touch-action: pan-y; overscroll-behavior-y: contain; padding: 12px var(--shelf-gutter) max(120px, calc(env(safe-area-inset-bottom) + 100px)); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.shelf-scroll::-webkit-scrollbar { display: none; }
#library-screen.shelf-clean #current-book { display: block; width: 100% !important; padding: 0; margin: 0 0 12px !important; }
.shelf-books { display: grid; gap: 12px; }
.shelf-clean[data-library-view="grid"] .shelf-books { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 9px; }
.shelf-clean-card { position: relative; min-width: 0; height: 109px; border: 0 solid #2b2b2a; border-top-width: 1px; border-radius: 14px; background: #171919; overflow: hidden; }
.shelf-card-open { position: absolute; inset: 0; z-index: 1; background: none; border: 0; border-radius: inherit; }
.shelf-cover { position: absolute; left: 9px; top: 8px; width: 65px; height: 87px; border-radius: 5px; overflow: hidden; background: #383a38; }
.shelf-cover-content { display: block; width: 100%; height: 100%; object-fit: cover; }
div.shelf-cover-content { display: grid; place-items: center; padding: 8px; color: #bccbd9; font-size: 10px; overflow: hidden; background: linear-gradient(135deg, #414441, #242824); }
.shelf-card-copy { position: absolute; top: 9px; left: 92px; right: 39px; pointer-events: none; }
.shelf-card-copy h2 { margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #fafaf7; font: 600 13px/18px "Geologica Pilcrow", sans-serif; }
.shelf-card-copy p { margin: 0; color: #bccbd9; font: 300 10px/17px "Geologica Pilcrow", sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shelf-card-progress { position: absolute; left: 92px; bottom: 14px; height: 15px; width: calc(100% - 225px); max-width: 124px; display: flex; gap: 8px; align-items: center; color: #fafaf7; font: 300 11px/14px "Geologica Pilcrow", sans-serif; pointer-events: none; }
.shelf-progress-track { flex: 1; height: 2px; border-radius: 2px; overflow: hidden; background: #2b2b2a; }
.shelf-progress-track i { display: block; height: 100%; background: #fafaf7; }
.shelf-card-more { position: absolute; z-index: 2; top: 1px; right: 1px; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: none; }
.shelf-card-status { position: absolute; z-index: 2; right: 10px; bottom: 12px; display: flex; align-items: center; justify-content: center; width: 114px; height: 27px; padding: 0 8px; border: 1px solid #2b2b2a; border-radius: 999px; background: #111210; color: rgb(250 250 247 / .9); font: 300 10px/16px "Geologica Pilcrow", sans-serif; white-space: nowrap; }
.shelf-card-status { -webkit-appearance: none; appearance: none; }
.shelf-card-status::before, .shelf-card-status::after { content: none; display: none; }
.shelf-clean-card[data-pinned="true"] { border-color: #6b4934; box-shadow: inset 0 0 0 1px #6b4934; }
.shelf-clean-card.is-featured { height: 146px; border: 1px solid rgb(255 108 75 / .19); border-radius: 9px; background: linear-gradient(90deg, #322016, #2c1d14 23%, #1a130f); }
.is-featured .shelf-cover { top: 8px; left: 10px; width: 92px; height: 127px; border-radius: 7px; }
.is-featured .shelf-card-copy { top: 30px; left: 115px; right: 16px; }
.is-featured .shelf-card-copy h2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; font-size: 19px; line-height: 26px; }
.is-featured .shelf-card-copy p { margin-top: -2px; }
.shelf-last-opened { position: absolute; top: 4px; left: 115px; font: 300 10px/17px "Geologica Pilcrow", sans-serif; color: #ff6c4b; }
.is-featured .shelf-card-more { right: 8px; top: -3px; }
.is-featured .shelf-card-progress { left: 115px; bottom: 10px; max-width: 85px; width: calc(100% - 260px); gap: 4px; }
.is-featured .shelf-progress-track { height: 5px; border-radius: 3px; }
.is-featured .shelf-progress-track i { background: #ff6c4b; }
.shelf-continue { position: absolute; z-index: 2; right: 13px; bottom: 14px; display: flex; align-items: center; justify-content: center; gap: 5px; width: 116px; height: 29px; padding: 0; border: 1px solid #522b1c; border-radius: 999px; background: #ff6c4b; color: #fafaf7; font: 300 10px/14px "Geologica Pilcrow", sans-serif; }
.shelf-clean-card.is-grid { height: 254px; border: 1px solid rgb(43 43 42 / .1); border-radius: 9px; }
.shelf-clean-card.is-grid[data-pinned="true"] { border-color: #6b4934; }
.is-grid .shelf-cover { left: 50%; transform: translateX(-50%); top: 11px; width: 86px; height: 120px; }
.is-grid .shelf-card-copy { top: 136px; left: 11px; right: 11px; }
.is-grid .shelf-card-copy h2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; }
.is-grid .shelf-card-copy p { margin-top: 2px; }
.is-grid .shelf-card-progress { left: 11px; right: 11px; top: 191px; bottom: auto; height: 16px; width: auto; max-width: none; }
.is-grid .shelf-card-status { left: 11px; right: 11px; bottom: 12px; width: auto; }
.shelf-empty { text-align: center; padding-top: 88px; }
.shelf-empty-art { position: relative; width: 167px; height: 145px; overflow: hidden; margin: 0 auto 16px; }
.shelf-empty-book { position: absolute; width: 390px; height: 833px; max-width: none; left: -112px; top: -239px; object-fit: cover; }
.shelf-empty h2 { margin: 0; font-size: 24px; font-weight: 700; line-height: 32px; color: #fafaf7; }
.shelf-empty p { margin: 3px auto 0; max-width: 260px; color: #bccbd9; white-space: pre-line; font-size: 12px; font-weight: 300; line-height: 16px; }
.shelf-clean[data-searching="true"] .shelf-empty { padding-top: 98px; }
.shelf-clean[data-searching="true"] .shelf-empty-art { margin-bottom: 6px; }
.shelf-clean-fade { pointer-events: none; position: absolute; z-index: 4; bottom: 0; left: 0; width: 100%; height: 129px; background: linear-gradient(transparent 33%, #0b0c0a 62%); filter: blur(24px); }
#reader-shelf-nav.shelf-clean-nav { position: fixed; z-index: 999; left: 50%; bottom: max(30px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: center; box-sizing: border-box; width: min(320px, calc(100vw - 42px)); height: 60px; padding: 3px; border: 1px solid #2b2b2a; border-radius: 30px; background: linear-gradient(90deg, #171919, #111312); }
#reader-shelf-nav.shelf-clean-nav[hidden] { display: none !important; }
.shelf-clean-nav > button { position: relative; display: grid; place-items: center; isolation: isolate; height: 52px; width: 100%; min-width: 0; padding: 0; border: 0; border-radius: 26px; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.shelf-clean-nav > button.is-active::before { content: ''; position: absolute; z-index: -1; inset: 0 3px; border-radius: 26px; background: #2b2b2a; }
.shelf-clean-nav > button:disabled { cursor: default; }
.shelf-clean-nav > button:focus-visible { outline: 2px solid #ff6c4b; outline-offset: -2px; }
.shelf-clean-nav img { display: block; max-width: none; }
.shelf-clean-nav > button > img, .shelf-clean-nav > button > .shelf-nav-avatar { transform: scale(.85); transform-origin: center; }
.shelf-nav-avatar { position: relative; display: grid; place-items: center; width: 26px; height: 26px; }
#shelf-profile-initial { position: absolute; inset: 5px 0; display: grid; place-items: center; color: #f1e2c9; font: 600 12px/16px "Geologica Pilcrow", sans-serif; }
.shelf-popup { position: fixed; z-index: 20000; width: 162px; padding: 0 9px; border: 1px solid #444545; border-radius: 15px; background: #202121; color: #f1e2c9; box-shadow: 0 8px 24px #0003; font-family: "Geologica Pilcrow", sans-serif; }
.shelf-popup button { display: flex; align-items: center; gap: 13px; width: 100%; min-height: 39px; padding: 5px; border: 0; background: none; color: inherit; text-align: left; font: 300 11px/18px "Geologica Pilcrow", sans-serif; }
.shelf-popup-icon { position: relative; display: grid; place-items: center; flex: 0 0 17px; width: 17px; height: 17px; overflow: hidden; }
.shelf-space-lens { position: absolute; left: 10px; top: 10px; }
.shelf-popup .is-danger { color: #ff6c4b; border-top: 1px solid #444545; }
.shelf-popup button:disabled { opacity: .5; gap: 6px; }
.shelf-popup small { font: 300 8px/1.2 "Geologica Pilcrow", sans-serif; margin-left: auto; }
.shelf-popup button:active:not(:disabled), .shelf-popup button:focus-visible { background: #ffffff0a; border-radius: 5px; }
.shelf-popup--status { width: 136px; padding-block: 1px; }
.shelf-popup--status button { min-height: 33px; gap: 3px; padding-inline: 3px; }
.shelf-popup--status button + button { border-top: 1px solid #444545; }
.shelf-popup--status button > img { margin-left: auto; }
.shelf-sort-menu { position: absolute; top: 31px; left: -2px; width: 188px; padding-block: 1px; }
.shelf-sort-menu button { min-height: 34px; padding: 6px 8px; }
.shelf-sort-menu button + button { border-top: 1px solid #444545; }
.shelf-sort-menu button[aria-checked="true"]::after { content: ''; margin-left: auto; flex: 0 0 11px; width: 11px; height: 11px; background: url('/assets/shelf-clean/check.svg') center no-repeat; }
.shelf-dialog { position: fixed; inset: 0; width: min(283px, calc(100vw - 40px)); max-height: calc(100dvh - 48px); overflow: auto; margin: auto; padding: 18px; border: 1px solid #353637; border-radius: 15px; background: linear-gradient(90deg, #171919, #111312); color: #f1e2c9; font-family: "Geologica Pilcrow", sans-serif; }
.shelf-dialog::backdrop { background: #000d; }
.shelf-dialog h2 { max-width: 208px; margin: 0 12px 6px 0; font: 700 24px/32px "Geologica Pilcrow", sans-serif; }
.shelf-dialog > p { white-space: pre-line; margin: 0; color: #cbc0ad; font: 300 12px/16px "Geologica Pilcrow", sans-serif; }
.shelf-dialog-close { position: absolute; top: 14px; right: 10px; width: 32px; height: 32px; display: grid; place-items: center; background: none; border: 0; padding: 0; }
.shelf-dialog-action { width: 100%; min-height: 36px; margin-top: 20px; padding: 6px; border: 0; border-radius: 999px; background: #ff6c4b; color: #0b0c0a; font: 400 15px/20px "Geologica Pilcrow", sans-serif; }
.shelf-error-details { margin: 12px 0 0; color: #bccbd9; font: 300 10px/1.4 "Geologica Pilcrow", sans-serif; overflow-wrap: anywhere; }
.shelf-error-details p { margin-bottom: 0; }
@media (hover: hover) { .shelf-card-more:hover, .shelf-view-switcher button:hover { background: #ffffff08; } }
@media (max-width: 359px) { #library-screen.shelf-clean { --shelf-gutter: 14px; } .shelf-card-progress { max-width: 88px; } .is-featured .shelf-card-copy h2 { font-size: 17px; } }
@media (min-width: 600px) {
  #library-screen.shelf-clean { --shelf-gutter: max(32px, calc((100% - 1000px) / 2)); }
  .shelf-clean[data-library-view="grid"] .shelf-books { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
  .shelf-clean-card.is-featured { max-width: 550px; }
  .shelf-clean-card:not(.is-grid) .shelf-card-copy { right: 40px; }
  .shelf-clean-card:not(.is-grid):not(.is-featured) .shelf-card-progress { max-width: 240px; }
}
@media (prefers-reduced-motion: no-preference) { .shelf-add, .shelf-continue, .shelf-card-status, .shelf-dialog-action { transition: transform .12s ease; } .shelf-add:active, .shelf-continue:active, .shelf-card-status:active, .shelf-dialog-action:active { transform: scale(.96); } }
@media (prefers-reduced-motion: reduce) { .shelf-search-field, .shelf-search-field input, #shelf-search-clear, .shelf-search-toggle img, .shelf-filters { transition: none !important; } }
