@font-face {
  font-family: 'Elice Digital Baeum';
  src: url('/snack-assets/fonts/EliceDigitalBaeum-Bold.otf') format('opentype');
  font-weight: 700;
  font-display: swap;
}

body.library-discovery-page { min-height: 100vh; min-height: 100dvh; color: #20332b; background: #fff; }
body.library-discovery-page > .site-header.unified-shell {
  position: sticky !important;
  top: 0 !important;
  z-index: 122;
  background: #fffffa;
}
body.library-discovery-page > .shared-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: sticky;
  top: 88px;
  z-index: 120;
  height: 70px;
  background: #faf9f4;
  font-family: 'Iropke Batang', serif;
}
.shared-brand-row strong { font: 700 1em 'Elice Digital Baeum', sans-serif; letter-spacing: .04em; }
.shared-feed-link { flex: none; display: block; width: 50px; height: 50px; border-radius: 50%; }
.shared-feed-link img { display: block; width: 100%; height: 100%; object-fit: contain; }
.library-discovery-page #series { max-width: 1472px; padding: 24px 36px 64px; }
.shelf-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.shelf-page-heading h1 { font-size: clamp(23px, 2vw, 30px); letter-spacing: -.04em; }
.shelf-primary, .shelf-read {
  background: #244636; color: #fff; border: 0; border-radius: 6px;
  padding: 7px 13px; font-weight: 700; font-size: 14px;
}
@layer snack-buttons {
  #series #library-content .shelf-page-heading > button.shelf-primary {
    --sb-face: #e8d6b9;
    --sb-ink: #584126;
    --sb-edge: #c9b18d;
    --sb-border: #d8c2a0;
  }

  #series #library-content .discovery-author > button.author-open {
    appearance: none;
    border: 0 !important;
    background: transparent !important;
    color: inherit !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
}
.discovery-author > .author-open::after {
  content: "";
  position: absolute;
  inset: 0;
}
.discovery-author:has(> .author-open:hover) { border-color: #708b76; }
.shelf-feature { margin-bottom: 18px; }
.shelf-feature-cards { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 16px; touch-action: pan-y; }
.shelf-feature-controls { display: flex; align-items: center; justify-content: end; gap: 10px; margin-top: 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.shelf-feature-controls button, .rail-arrow { border: 1px solid #dce1da; border-radius: 5px; background: white; color: #244636; width: 34px; height: 34px; padding: 0; }
.shelf-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px;
  height: clamp(132px, 11vw, 163px); min-width: 0; padding: 12px;
  border: 1px solid #dfe5db; border-radius: 9px; background: #fcfcf9;
  container-type: inline-size;
}
.shelf-card.featured {
  height: clamp(225px, 19vw, 340px); gap: 20px; padding: 20px;
  border: 0; background: #e7ede3; border-radius: 12px;
}
.shelf-card.featured:nth-child(even) { background: #eee9e0; }
.shelf-card:hover { border-color: #9cae9e; }
.shelf-card .discovery-cover { width: auto; height: 100%; padding: 10px; }
.shelf-card .discovery-cover strong { font-size: clamp(10px,5cqi,16px); }
.shelf-card.featured .discovery-cover { padding: 16px; }
.shelf-card.featured .discovery-cover strong { font-size: clamp(15px,4.1cqi,25px); }
.shelf-card-copy { display: flex; flex-direction: column; align-items: start; min-width: 0; }
.shelf-card h3 { width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: clamp(13px, 5.3cqi, 17px); }
.shelf-card.featured h3 { font: 700 clamp(19px, 6cqi, 38px)/1.35 'Iropke Batang',serif; }
.shelf-byline,.shelf-excerpt { font-size: clamp(12px, 4.2cqi, 15px); }
.shelf-byline { color: #52675a; }
.shelf-excerpt {
  width: 100%; margin-top: 5px; display: -webkit-box; -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; overflow: hidden; text-align: justify; text-align-last: start; line-height: 1.5;
}
.shelf-card.featured .shelf-excerpt { margin-top: 12px; }
.shelf-read {
  margin-top: auto;
  font-size: 12px;
  border: 1px solid #2a4b39;
  border-radius: 8px;
  background: linear-gradient(155deg, #476657, #244636 80%);
  box-shadow: inset 0 1px 1px #ffffff45, 0 2px 0 #173426, 0 3px 6px #17342624;
}
.shelf-card:is(:hover, :focus-visible) .shelf-read {
  background: linear-gradient(155deg, #52735f, #2c523e 80%);
}
.shelf-story-rail { gap: 14px; padding: 0 0 4px; scrollbar-width: none; }
.shelf-story-rail > * { width: calc((100% - 42px)/4); }
.library-discovery-page .discovery-section { margin-bottom: 24px; }
.library-discovery-page .section-heading { margin-bottom: 9px; }
.shelf-layout { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr); gap: clamp(24px, 5vw, 74px); }
.shelf-profile { border-right: 1px solid #e2e8df; padding: 22px 24px 22px 0; min-width: 0; }
.shelf-profile-top { display: grid; grid-template-columns: clamp(68px, 7vw, 102px) minmax(0,1fr); gap: 16px; align-items: center; }
.shelf-profile .author-symbol { width: 100%; height: auto; aspect-ratio: 1; margin: 0; }
.shelf-profile h1 { font-size: clamp(20px, 2vw, 30px); line-height: 1.3; }
.shelf-profile h1 small { display: block; font-size: 14px; font-weight: 400; margin-top: 6px; }
.shelf-profile h2 { margin-top: 18px; font-size: 18px; }
.shelf-profile p { margin-top: 5px; color: #52675a; overflow-wrap: anywhere; }
.shelf-profile button { margin-top: 12px; }
.shelf-body { padding-top: 16px; }
.shelf-body h2 { font-size: 20px; margin-bottom: 14px; }
.shelf-books { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin-bottom: 30px; }
.shelf-book { min-width: 0; }
.shelf-book strong { display: block; margin-top: 5px; }
.shelf-book .discovery-cover strong { margin: 0; }
.shelf-empty-book { aspect-ratio: 2 / 2.8; border: 1px dashed #9ba99f; background: #f3f6f0; color: #244636; border-radius: 6px; }
.shelf-latest { list-style: none; margin: 0; padding: 0; border-top: 1px solid #dfe5db; }
.shelf-latest a { display: grid; grid-template-columns: minmax(0,1fr) minmax(0, .6fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid #dfe5db; }
.shelf-latest :is(strong,span) { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.shelf-latest :is(span,time) { color: #52675a; font-size: 13px; }
.shelf-reader { padding-top: 0; }
.shelf-reader-head { display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 12px; align-items: center; }
.shelf-reader-head .discovery-cover { padding: 7px; }
.shelf-reader-head .discovery-cover strong { font-size: 7px; }
.shelf-reader-head h1 { font: 700 clamp(19px, 1.45vw, 27px)/1.25 'Iropke Batang',serif; }
.shelf-contents summary { cursor: pointer; color: #244636; font-weight: 700; }
.shelf-contents ol { padding-left: 22px; margin-bottom: 0; font-size: 13px; }
.shelf-contents [aria-current] { font-weight: 700; text-decoration: underline; }
.shelf-reader-prose { padding: 24px 0; color: #262b27; font: 16px/1.95 'Iropke Batang',serif; text-align: justify; text-align-last: start; overflow-wrap: anywhere; }
.shelf-reader-prose p { white-space: pre-wrap; }
.shelf-reader-prose p + p { margin-top: 1em; }
.shelf-page-nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-block: 20px; border-top: 1px solid #dfe5db; padding-top: 14px; }
.shelf-page-nav a { display: flex; flex-direction: column; }
.shelf-page-nav .next { grid-column: 2; text-align: right; }
@media (min-width: 761px) and (max-width: 1279px) {
  .shelf-story-rail > .shelf-card {
    --rail-cover-width: 82px;
    grid-template-columns: var(--rail-cover-width) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    height: 158px;
    gap: 12px;
    padding: 12px;
  }

  .shelf-story-rail > .shelf-card .discovery-cover {
    width: 100%;
    height: auto;
    aspect-ratio: 5 / 7;
    align-self: center;
  }

  .shelf-story-rail .shelf-card-copy { min-height: 0; }
  .shelf-story-rail .shelf-card-copy > :is(h3, .shelf-byline, .shelf-read) { flex: none; }

  .shelf-story-rail .shelf-byline {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .shelf-story-rail .shelf-excerpt {
    flex: 0 1 auto;
    min-height: 0;
    margin-block: 5px 8px;
  }

  .shelf-story-rail .shelf-read { padding: 6px 10px; }
}

@media(max-width:1100px) { .shelf-story-rail > * { width: calc((100% - 28px)/3); } }
@media(max-width:760px) {
 body.library-discovery-page > .shared-brand-row { top: 108px; height: 54px; padding-inline: 14px; font-size: 15px; }
 .shared-feed-link { width: 44px; height: 44px; }
 .library-discovery-page #series { padding: 16px 14px 40px; }
 .shelf-feature-cards { display: block; }
 .shelf-feature-cards > :nth-child(2) { display: none; }
 .shelf-card.featured { height: 184px; padding: 13px; gap: 12px; }
 .shelf-story-rail > * { width: 67%; }
 .shelf-card { gap: 9px; padding: 9px; height: 132px; }
 .shelf-card h3 { font-size: 13px; }
 .shelf-read { padding: 4px 7px; }
 .shelf-layout { display: block; }
 .shelf-profile { border-right: 0; border-bottom: 1px solid #e2e8df; padding: 4px 0 14px; }
 .shelf-profile-top { grid-template-columns: 66px minmax(0,1fr); }
 .shelf-books { gap: 9px; }
 .shelf-book .discovery-cover { padding: 7px; }
 .shelf-book .discovery-cover strong { font-size: 11px; }
 .shelf-reader-head { gap: 10px; }
 .shelf-reader-prose { font-size: 16px; }
}
body.library-discovery-page > .site-header.unified-shell > .shell-nav {
 grid-template-columns: repeat(4,minmax(0,1fr)) !important; flex-basis: 510px !important;
}
html body.library-discovery-page > .site-header.unified-shell > .shell-nav > :is(a,button) {
 background: #f7faf5 !important; border: 1px solid #d1dccf !important;
 border-radius: 8px !important; color: #244636 !important;
 box-shadow: inset 0 -2px #c5d0c2 !important;
}
html body.library-discovery-page > .site-header.unified-shell > .shell-nav > a[aria-current] {
 background: #dce8d9 !important; font-weight: 700 !important;
}
.library-discovery-page .discovery-cover {
 justify-content: start; text-align: center; padding-top: 1em !important;
 background-image: linear-gradient(var(--cover-tint, transparent), var(--cover-tint, transparent)), var(--cover-art);
 background-size: 100% 100%, 500% 100%;
 background-position: center, var(--cover-position) center;
}
.library-discovery-page .discovery-cover strong {
 color: #25342a; text-shadow: 0 0 5px #fff, 0 0 9px #fff; overflow: hidden;
 display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
@media(max-width:760px) {
 html body.library-discovery-page > .site-header.unified-shell > .shell-nav > :is(a,button) {
  font-size: clamp(9px, 2.85vw, 12px) !important; letter-spacing: 0 !important;
 }
}

.shelf-reader-back {
 display: flex;
 flex-wrap: wrap;
 gap: 8px;
 margin-block: 16px;
}
.shelf-profile .discovery-actions { flex-wrap: wrap; }
.shelf-reader-back a {
 display: inline-flex;
 align-items: center;
 min-height: 36px;
 padding: 5px 10px;
 border: 1px solid #bacbbf;
 border-radius: 7px;
 background: linear-gradient(155deg, #fafcf9, #e5eee6 80%);
 box-shadow: inset 0 1px 1px #fff, 0 2px 0 #c0d0c4, 0 3px 6px #17342614;
 color: #244636;
 font-size: 13px;
 font-weight: 700;
}
.shelf-reader-back a:hover { background: linear-gradient(155deg, #f4f8f3, #dce9df 80%); }

@media (min-width: 1280px) {
  body.library-discovery-page {
    --desktop-library-menu-width: clamp(408px, calc(63.75vw - 408px), 510px);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  html body.library-discovery-page > .site-header.unified-shell {
    background: linear-gradient(90deg, #f6f8f2 0% 23%, #e8eee1 28% 60%, #f6f8f2 65% 100%);
  }

  body.library-discovery-page > .site-header.unified-shell > .shell-nav {
    flex-basis: var(--desktop-library-menu-width) !important;
  }

  body.library-discovery-page > :is(.site-header, .shared-brand-row) {
    grid-area: 1 / 1;
  }

  html body.library-discovery-page > .shared-brand-row {
    align-self: start;
    justify-self: stretch;
    align-items: center;
    justify-content: center;
    top: 0;
    z-index: 123;
    width: auto;
    height: 88px;
    gap: clamp(16px, 2vw, 36px);
    margin-inline: max(23.25vw, calc(3% + 300px)) max(34.7vw, calc(3% + var(--desktop-library-menu-width) + 18px));
    padding-inline: clamp(12px, 1.6vw, 30px);
    background: transparent;
  }

  html body.library-discovery-page > .shared-brand-row > span {
    font-size: clamp(16px, 1.32vw, 20px);
  }

  html body.library-discovery-page > .shared-brand-row .shared-feed-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: auto;
    height: 40px;
    border-radius: 6px;
  }

  .shared-brand-row .shared-feed-link img {
    width: 40px;
    height: 40px;
  }

  .shared-brand-row .shared-feed-link::before {
    content: attr(aria-label);
    padding: 4px 7px;
    border: 1px solid #e4dccd;
    border-radius: 6px;
    background: #fffdf7;
    color: #574a36;
    font: 600 11px/1.35 system-ui, sans-serif;
    white-space: nowrap;
  }

  body.library-discovery-page > #series { width: 100%; }
}

/* The editor and reader use the same measure at each viewport width. */
body.library-discovery-page {
 container-type: inline-size;
 --library-page-inner: calc(min(100cqw, 1472px) - 72px - clamp(24px, 5vw, 74px));
 --library-prose-width: min(810px, var(--library-page-inner) * 2 / 3, var(--library-page-inner) - 220px);
}
.shelf-reader { width: var(--library-prose-width); min-width: 0; }
.shelf-write-bar {
 position: sticky;
 top: 158px;
 z-index: 118;
 min-height: 48px;
 background: #fff;
}
#series { --shelf-top-action-height: 44px; }
#library-write {
 margin-inline-start: auto;
 flex: none;
 min-height: var(--shelf-top-action-height);
 white-space: nowrap;
}
@media (min-width: 1280px) {
 .shelf-write-bar { top: 88px; }
}
@media (max-width: 760px) {
 .shelf-write-bar { top: 162px; }
}
.library-editor.library-prose-editor {
 box-sizing: content-box;
 width: var(--library-prose-width);
 max-width: none;
 max-height: calc(100dvh - 80px);
 padding: 16px 12px;
 border: 0;
 outline: 1px solid #dae0d5;
}
.library-type-controls { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.library-type-controls label { display: grid; gap: 3px; }
#library-fields select { max-width: 100%; padding: 5px; }
.library-prose-help, .library-prose-count { color: #52675a; font-size: 13px; }
.library-prose-count { text-align: end; }
.library-prose-input {
 min-height: 11em;
 padding: 0;
 outline: 1px solid #afbbad;
 outline-offset: 3px;
 white-space: pre-wrap;
}
.library-prose-input:focus { outline: 2px solid #345a45; }
.shelf-book-paragraphs {
 color: #262b27;
 font: var(--library-type-size, 16px)/var(--library-type-leading, 1.95) 'Iropke Batang',serif;
 text-align: var(--library-type-align, justify);
 text-align-last: auto;
 text-indent: 1em;
 overflow-wrap: anywhere;
 word-break: normal;
}
.shelf-book-copy.shelf-book-paragraphs { text-indent: 0; }
.shelf-reader-prose.shelf-book-paragraphs p + p { margin-top: 0; }

@media (max-width: 760px) {
 body.library-discovery-page { --library-prose-width: calc(100cqw - 28px); }
}
.library-prose-editor { scrollbar-width: none; }
.library-prose-editor #library-fields { grid-template-columns: minmax(0, 1fr); }

body.library-discovery-page {
 --library-leaf-width: calc((var(--library-prose-width) - 2px) * .72);
 --library-leaf-height: calc(var(--library-leaf-width) * 205 / 145);
 --library-leaf-unit: calc(var(--library-leaf-width) / 145);
}
.shelf-book-spread {
 display: grid;
 grid-template-columns: minmax(0, 28fr) minmax(0, 72fr);
 gap: 2px;
 margin-block: 10px;
 border-radius: 8px;
 background: #b6aa94;
 box-shadow: 0 12px 22px #34281925;
}
.shelf-book-paper {
 display: grid;
 position: relative;
 grid-template-rows: minmax(0, 1fr);
 height: var(--library-leaf-height);
 --paper-start: calc(20 * var(--library-leaf-unit));
 --paper-end: calc(15 * var(--library-leaf-unit));
 padding: calc(15 * var(--library-leaf-unit)) var(--paper-end) calc(22.5 * var(--library-leaf-unit)) var(--paper-start);
 border-radius: 2px 8px 8px 2px;
 background: linear-gradient(90deg,#e9e1d0,#fffdf7 5.5%,#fffdf8 96%,#f8f4e9);
 color: #29271f;
}
.shelf-previous-paper {
 display: flex;
 justify-content: flex-end;
 min-width: 0;
 overflow: hidden;
 border-radius: 8px 0 0 8px;
}
.shelf-previous-paper .shelf-book-paper {
 --paper-start: calc(15 * var(--library-leaf-unit));
 --paper-end: calc(20 * var(--library-leaf-unit));
 flex: 0 0 var(--library-leaf-width);
 width: var(--library-leaf-width);
 border-radius: 8px 2px 2px 8px;
 background: linear-gradient(270deg,#d9d0bc,#f4efe2 7%,#f7f3e9);
}
.shelf-previous-paper :is(.shelf-book-copy,.shelf-book-footer) { filter: blur(1.3px); opacity: .58; }
.shelf-previous-paper .shelf-book-footer { flex-direction: row-reverse; }
.shelf-book-copy, .library-writing-paper .library-prose-input {
 overflow: hidden;
 min-height: 0;
 white-space: pre-wrap;
}
.shelf-book-copy.shelf-existing-overflow { overflow: auto; }
.shelf-previous-paper .shelf-book-copy { overflow: hidden; }
.shelf-book-footer {
 position: absolute;
 inset-inline: var(--paper-start) var(--paper-end);
 bottom: calc(8 * var(--library-leaf-unit));
 display: flex;
 justify-content: space-between;
 gap: 12px;
 border-top: 1px dotted #a69c88;
 padding-top: 7px;
 font: 12px/1.5 'Iropke Batang',serif;
}
.shelf-book-title { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.shelf-book-number { font-variant-numeric: tabular-nums; }
body.library-discovery-page #library-editor.library-prose-editor {
 box-sizing: content-box;
 width: var(--library-leaf-width);
 max-width: none;
 max-height: calc(100dvh - 64px);
 border: 0;
 padding: 14px;
}
.library-writing-paper { outline: 1px solid #e1d8c5; }
.library-writing-paper .library-prose-input { outline-offset: 3px; }
.library-writing-paper .library-prose-input[contenteditable]:focus { overflow: clip; }
.library-count-warning { color: #a12222; font-weight: 700; }
@media (max-width: 900px) {
 body.library-discovery-page { --library-leaf-width: var(--library-prose-width); }
 .shelf-book-spread { grid-template-columns: minmax(0, 1fr); }
 .shelf-previous-paper { display: none; }
}

.shelf-intro { min-height: 1.6em; }
.shelf-author-details { margin-top: 18px; }
.shelf-author-details h3 { font-size: 14px; }
.shelf-author-details p { white-space: pre-wrap; }
.shelf-author-details ul { margin: 8px 0; padding-inline-start: 20px; overflow-wrap: anywhere; }

@media (min-width: 761px) {
 .shared-brand-row #library-write {
  position: static;
  flex: 0 0 auto;
  white-space: nowrap;
  font-family: system-ui, sans-serif;
 }
}
@media (min-width: 1280px) {
 html body.library-discovery-page > .shared-brand-row { gap: clamp(8px, 1vw, 18px); padding-inline: 8px; }
}

.shelf-book-spread { position: relative; }
.shelf-book-spread > .shelf-book-paper {
 height: auto;
 min-height: calc(var(--library-leaf-height) * .67);
 grid-template-rows: 1fr auto;
 padding-bottom: calc(4 * var(--library-leaf-unit));
}
.shelf-book-spread > .shelf-book-paper .shelf-book-copy {
 max-height: calc(167.5 * var(--library-leaf-unit));
 margin-bottom: 1lh;
}
.shelf-book-spread > .shelf-book-paper .shelf-book-footer { position: static; }
.shelf-previous-paper .shelf-book-paper { height: 100%; }
.shelf-book-spread .shelf-page-nav {
 position: absolute;
 inset: calc(50% - 18px) -18px auto;
 display: flex;
 justify-content: space-between;
 margin: 0;
 padding: 0;
 border: 0;
 pointer-events: none;
}
.shelf-book-spread .shelf-page-nav > :is(a,button) {
 display: grid;
 place-items: center;
 width: 36px;
 height: 36px;
 padding: 0;
 border: 1px solid #c9bb9e;
 border-radius: 50%;
 background: #fffdf6;
 color: #3f392a;
 font-size: 19px;
 line-height: 1;
 pointer-events: auto;
}
.shelf-book-spread .shelf-page-nav > :disabled { opacity: .48; }
@media (max-width: 760px) {
 .shelf-book-spread .shelf-page-nav { inset-inline: 2px; }
}

@media (min-width: 901px) {
 .shelf-reader-head { grid-template-columns: 32px minmax(0, 1fr); gap: 9px; }
 .shelf-reader-head h1 { font-size: clamp(19px, 1.25vw, 24px); }
 .shelf-reader-head .entry-meta { line-height: 1.2; }
 .shelf-book-spread { margin-top: 5px; }
}

.shelf-profile .shelf-profile-identity h2 { margin: 5px 0 0; font-size: 16px; }
.shelf-profile .shelf-profile-description { margin-top: 16px; }
.shelf-author-details { margin-top: 20px; }
.shelf-author-details h3 { margin: 0 0 7px; font-size: 15px; }
.shelf-author-bio { white-space: pre-wrap; }
.shelf-author-details ul { margin: 8px 0 0; padding-left: 20px; overflow-wrap: anywhere; }
.shelf-book-slot { min-width: 0; }
.shelf-book-slot .shelf-book { width: 100%; }
.shelf-book-edit { margin-top: 7px; padding: 4px 8px; font-size: 12px; }
.shelf-reader-head.shelf-standalone-head { grid-template-columns: minmax(0, 1fr); }
#library-editor .library-cover-preview { width: 90px; }
#library-editor .library-cover-preview .discovery-cover { width: 100%; }

/* On narrower screens, long entries flow with the page and keep one scroll container. */
@media (max-width: 1360px) {
 .shelf-book-spread > .shelf-book-paper .shelf-book-copy { max-height: none; overflow: visible; }
 .library-writing-paper { height: auto; min-height: 350px; }
 .library-writing-paper .library-prose-input { min-height: 260px; }
}
.library-prose-standalone .library-writing-paper {
 height: auto;
 min-height: 350px;
}
.library-prose-standalone .library-prose-input { min-height: 260px; }
.library-prose-standalone :is(.shelf-book-footer,.library-prose-count) { display: none; }

/* The same profile card anchors the left side of a writer's shelf. */
.shelf-profile:has(.shelf-about) { padding-block-start: 0; }
.shelf-profile-top {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  column-gap: 12px;
  align-items: center;
  min-height: 86px;
  padding: 14px clamp(14px, 1.9vw, 36px);
  border: 1px solid #dedbd0;
  border-radius: 13px;
  background: linear-gradient(155deg, #f8f6ef, #ebe6db);
  box-shadow: inset 0 1px #fff, 0 2px 0 #dcd7cb;
}
.shelf-profile-top .author-symbol { border-radius: 10px; }
.shelf-profile-identity { border-inline-start: 1px solid #cfc9bb; padding-inline-start: clamp(10px, 1.1vw, 18px); }
.shelf-profile-identity .shelf-profile-name { margin: 0; font-size: 15px; font-weight: 700; color: #20332b; }
.shelf-profile-identity .shelf-profile-slogan { margin: 5px 0 0; font-size: 12px; }
.shelf-about { margin-top: 14px; padding-top: 18px; border-top: 1px solid #d9d5cb; }
.shelf-about h1 { margin: 0; font-size: clamp(18px, 1.35vw, 24px); }
.shelf-profile .shelf-author-details { margin-block-start: 24px; }
.shelf-profile:has(.shelf-about) .shelf-reader-back { margin-block-start: 20px; }
/* The library landing page and each shelf share the #series content width. */
.shelf-library-view .shelf-body { min-width: 0; padding-top: 0; }
.shelf-library-view .shelf-books {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}
.shelf-library-view .shelf-vacant-book {
  background: #f8f9f6;
  border-color: #dfe5db;
}
@media (min-width: 761px) {
  .shelf-library-view:has(.shelf-about) {
    grid-template-columns: minmax(235px, 26%) minmax(0, 1fr);
    gap: 36px;
  }
  .shelf-library-view .shelf-profile { border-inline-end-color: #d9d5cb; }
}
@media (max-width: 480px) {
  .shelf-library-view .shelf-body { padding-top: 18px; }
  .shelf-library-view .shelf-empty-book { font-size: 12px; }
  .shelf-library-view .shelf-latest a {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 12px;
  }
  .shelf-library-view .shelf-latest time { grid-column: 2; grid-row: 1 / span 2; }
}

.shelf-library-view .shelf-profile-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  width: min(100%, 224px);
  padding: 20px;
  background: #f5f7ef;
  border-color: #dfe5d8;
  box-shadow: none;
}
.shelf-library-view .shelf-profile-top .author-symbol { width: 72px; }
.shelf-library-view .shelf-profile-identity {
  border: 0;
  padding: 0;
}
.shelf-library-view .shelf-books {
  --shelf-cover-width: clamp(100px, 9vw, 132px);
  position: relative;
  isolation: isolate;
  grid-template-columns: repeat(3, var(--shelf-cover-width));
  justify-content: space-around;
  gap: 14px;
  padding: 20px 12px 0;
  border-radius: 12px;
  background: linear-gradient(#f7f4ed, #f7f4ed) 0 0 / 100% calc(25px + var(--shelf-cover-width) * 1.4) no-repeat;
}
.shelf-library-view .shelf-books::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset-inline: 0;
  top: calc(20px + var(--shelf-cover-width) * 1.4);
  height: 7px;
  border-radius: 0 0 5px 5px;
  background: #d9cebb;
}
.shelf-library-view .shelf-books :is(.discovery-cover, .shelf-empty-book) {
  box-sizing: border-box;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 7;
}
.shelf-library-view .shelf-book > strong { margin-top: 13px; }
@media (min-width: 761px) {
  #series:has(.shelf-library-view) { position: relative; }
  #series:has(.shelf-library-view) > .shelf-write-bar {
    position: absolute;
    inset: 24px 36px auto auto;
    min-height: 0;
    margin: 0;
    background: transparent;
  }
  .shelf-library-view .shelf-body > .shelf-page-heading {
    min-height: 44px;
    padding-inline-end: 120px;
  }
  .shelf-library-view .shelf-body > .shelf-page-heading h2 { margin: 0; }
}
@media (max-width: 760px) {
  .shelf-library-view .shelf-books { --shelf-cover-width: clamp(58px, 22vw, 115px); gap: 6px; }
}
@media (max-width: 760px) {
  #series:has(.shelf-library-view) { position: relative; }
  #series:has(.shelf-library-view) > .shelf-write-bar {
    position: absolute;
    inset: 16px 14px auto auto;
    min-height: 0;
    margin: 0;
    background: transparent;
  }
  .shelf-library-view .shelf-profile-top { max-width: calc(100% - 104px); }
}

.shelf-library-view .shelf-profile-top {
  width: 100%;
  flex-direction: row;
  align-items: center;
  padding: clamp(12px, 1.2vw, 20px);
}
.shelf-library-view .shelf-profile-top .author-symbol { flex: 0 0 auto; width: clamp(54px, 4.6vw, 74px); }
.shelf-library-view .shelf-profile-identity { border-inline-start: 1px solid #dedbd1; padding-inline-start: 12px; }
.shelf-library-view .shelf-author-details {
  margin-block-start: 18px;
  padding: 14px 16px;
  border: 1px solid #e4e7df;
  border-radius: 9px;
  background: #f8f9f5;
}
.shelf-library-view .shelf-author-details h3 { margin-top: 0; }
.shelf-library-view .shelf-books {
  --shelf-cover-width: clamp(68px, 5.8vw, 106px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 32px);
  padding: 16px 20px 0;
  --shelf-floor: calc(16px + var(--shelf-cover-width) * 1.4);
  --shelf-lip: 12px;
  background:
    radial-gradient(ellipse at 50% 24%, #f5f1e8 10%, transparent 75%) 0 0 / 100% var(--shelf-floor) no-repeat,
    linear-gradient(#eeeadf 0%, #e4dac9 86%, #d5c5ad 100%) 0 0 / 100% var(--shelf-floor) no-repeat;
  border-radius: 8px;
  margin-bottom: 26px;
}
/* The cover feet sit inside the top plane, above the shelf's front edge. */
.shelf-library-view .shelf-books::before {
  top: calc(var(--shelf-floor) - 9px);
  height: calc(9px + var(--shelf-lip));
  border-radius: 2px 2px 5px 5px;
  background:
    repeating-linear-gradient(1deg, #795f4310 0 1px, transparent 1px 4px),
    linear-gradient(to bottom, #c7ae8e, #e6d3b6 56%, #c5ab8a 57%, #a68b6b 100%);
  box-shadow: 0 4px 7px #5f493328, inset 0 -1px #705a4255;
}
.shelf-library-view .shelf-book-cover {
  position: relative;
  align-self: start;
  isolation: isolate;
}
.shelf-library-view .shelf-book-cover::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: auto -9px -3px 3px;
  height: 9px;
  border-radius: 50%;
  background: #49351f85;
  filter: blur(4px);
  pointer-events: none;
}
.shelf-library-view .shelf-book { display: grid; grid-template-columns: var(--shelf-cover-width) minmax(0,1fr); gap: 12px; text-align: start; align-items: center; }
.shelf-library-view .shelf-book-info { display: grid; gap: 5px; overflow-wrap: anywhere; }
.shelf-library-view .shelf-book-info span { font-size: 12px; color: #53645a; }
.shelf-library-view .shelf-books .shelf-empty-book { width: var(--shelf-cover-width); }
.shelf-library-view .shelf-vacant-book { visibility: hidden; }
#series { container-type: inline-size; }
@media (min-width: 1101px) {
  .shelf-inline-rail .shelf-story-rail > * { width: calc((100% - 28px) / 3); }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .shelf-inline-rail .shelf-story-rail > * { width: calc((100% - 14px) / 2); }
  .shelf-library-view .shelf-book { gap: 7px; }
}
@media (max-width: 760px) {
  .shelf-library-view .shelf-books { --shelf-cover-width: clamp(54px, 19vw, 90px); gap: 8px; padding-inline: 10px; }
  .shelf-library-view .shelf-book { display: block; }
  .shelf-library-view .shelf-book .discovery-cover { width: var(--shelf-cover-width); }
  .shelf-library-view .shelf-book-info { margin-top: 9px; }
}
.shelf-library-view .shelf-profile-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e4e7df;
}
.shelf-library-view .shelf-profile-menu > * { margin: 0; }
.shelf-library-view .shelf-profile-menu .shelf-reader-back { margin: 0; }

.shelf-library-view .shelf-profile-identity { min-width: 0; }
.shelf-library-view :is(.shelf-profile-name, .shelf-profile-slogan, .shelf-about h1, .shelf-intro) {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
#library-fields :is(#library-name-input, #library-description-input) {
  width: min(100%, 26rem);
}
.shelf-library-view .shelf-body > .shelf-page-heading {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px 12px;
}
.shelf-lobby-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid #dce1da;
  border-radius: 5px;
  color: #244636;
  font-size: 12px;
  white-space: nowrap;
}
.shelf-lobby-link:hover { background: #f4f7f1; }

.shelf-library-view .discovery-cover { filter: saturate(.82); }
.shelf-library-view .shelf-book-slot {
  display: grid;
  grid-template-columns: var(--shelf-cover-width) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.shelf-book-cover { display: block; }
.shelf-book-name {
  display: block;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
}
.shelf-book-name:hover { text-decoration: underline; }
#series .shelf-library-view .shelf-book-edit {
  width: fit-content;
  margin: 0;
  min-height: 32px;
  padding: 4px 9px;
  border: 1px solid #ccd8cd;
  border-radius: 6px;
  background: #f7faf6;
  color: #244636;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: none;
}
#series .shelf-library-view .shelf-book-edit:hover {
  background: #e6efe5;
}
.shelf-library-view .shelf-books-empty {
  grid-column: 1 / -1;
  min-height: calc(var(--shelf-cover-width) * 1.4);
  display: grid;
  align-items: center;
  margin: 0;
}
@media (max-width: 1100px) {
  .shelf-library-view .shelf-book-slot { grid-template-columns: minmax(0, 1fr); }
  .shelf-library-view .shelf-book-cover { width: var(--shelf-cover-width); }
}

@media (min-width: 1101px) {
  .shelf-library-view .shelf-book-slot { row-gap: 20px; }
}
@media (max-width: 1100px) {
  .shelf-library-view .shelf-book-slot > .shelf-book-info { margin-block-start: 8px; }
}
.shelf-library-view .shelf-books:not(:has(.shelf-book-edit)) { padding-block-end: var(--shelf-lip); }

.shelf-cover-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  grid-column: 1 / -1;
}
#library-editor .shelf-cover-refresh {
  padding: 8px 12px;
  border: 1px solid #ccd8cd;
  border-radius: 6px;
  background: #f7faf6;
  color: #244636;
  font-size: 13px;
}
#library-editor .shelf-cover-refresh:hover { background: #e6efe5; }

#series .shelf-library-view .shelf-book-create {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  width: var(--shelf-cover-width);
  aspect-ratio: 5 / 7;
  padding: 4px;
  border: 1px dashed #849789;
  border-radius: 6px;
  background: transparent;
  color: #244636;
  box-shadow: none;
  font-size: clamp(11px, 1vw, 14px);
  white-space: nowrap;
}
#series .shelf-library-view .shelf-book-create:hover { background: #ffffff58; }
.shelf-book-create-plus { font-size: 24px; line-height: 1; }

.shelf-library-view .shelf-book-cover { display: grid; }
#series .shelf-library-view .shelf-books :is(.shelf-book-cover .discovery-cover, .shelf-book-create) {
  box-sizing: border-box;
  height: calc(var(--shelf-cover-width) * 1.4);
  min-height: 0;
  border-radius: 5px;
}
#series .shelf-library-view .shelf-book-create {
  appearance: none;
  align-self: start;
  border: 1px solid #87988d80;
  background: linear-gradient(155deg, #ffffff60, #ffffff12);
  box-shadow: inset 4px 0 #73877930, inset 0 1px #ffffff90, 0 2px 4px #263f331a;
}
.library-discovery-page #series :is(.shelf-lobby-link, .shelf-reader-back a, .shelf-profile-edit, .shelf-book-edit) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-height: 36px;
  padding: 5px 10px;
  border: 1px solid #2a4b39;
  border-radius: 8px;
  background: linear-gradient(155deg, #476657, #244636 80%);
  box-shadow: inset 0 1px 1px #ffffff45, 0 2px 0 #173426, 0 3px 6px #17342624;
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  box-sizing: border-box;
}
.library-discovery-page #series a.shelf-lobby-link { min-height: var(--shelf-top-action-height); }
.library-discovery-page #series :is(.shelf-lobby-link, .shelf-reader-back a, .shelf-profile-edit, .shelf-book-edit):hover {
  background: linear-gradient(155deg, #52735f, #2c523e 80%);
}
/* Match both editing actions to the original profile button. */
html body.library-discovery-page #series .shelf-library-view :is(.shelf-profile-edit, .shelf-book-edit) {
  border-color: #bacbbf !important;
  border-radius: 7px !important;
  background: linear-gradient(155deg, #fafcf9, #e5eee6 80%) !important;
  box-shadow: inset 0 1px 1px #fff, 0 2px 0 #c0d0c4, 0 3px 6px #17342614 !important;
  color: #244636 !important;
  font-size: 13px !important;
}
html body.library-discovery-page #series .shelf-library-view :is(.shelf-profile-edit, .shelf-book-edit):hover {
  background: linear-gradient(155deg, #f4f8f3, #dce9df 80%) !important;
}
.shelf-reader-back { gap: 6px; }
.shelf-library-view .shelf-author-details {
  padding: 13px 0 0;
  border: 0;
  border-top: 1px solid #e4e7df;
  border-radius: 0;
  background: transparent;
  color: #41554a;
  font-size: 13px;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.shelf-library-view .shelf-author-details ul {
  padding-inline-start: 15px;
}

#series .shelf-library-view .shelf-book-slot > .shelf-book-edit {
  grid-column: 1;
  justify-self: center;
}
.shelf-library-view .shelf-book-info > .shelf-book-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
@media (max-width: 1100px) {
  .shelf-library-view .shelf-book-slot > .shelf-book-edit {
    grid-row: 2;
    justify-self: start;
  }
}

.library-discovery-page #series .shelf-profile-edit { margin: 0; }
.shelf-library-view .shelf-book-description {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0;
  color: #41554a;
  font-size: 12px;
  line-height: 1.4;
  word-break: keep-all;
}
body.library-discovery-page #library-editor.library-compact-editor {
  width: min(calc(100% - 28px), 480px);
  max-width: 480px;
}

.shelf-author-section + .shelf-author-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e4e7df;
}

.shelf-library-view .shelf-profile-top {
  gap: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.shelf-library-view .shelf-profile-identity {
  padding-inline-start: 0;
  border: 0;
}
.shelf-library-view .shelf-profile-name {
  color: #20332b;
  font-size: 18px;
  line-height: 1.3;
}
.shelf-library-view .shelf-profile-slogan {
  margin-top: 3px;
  color: #596b60;
  line-height: 1.4;
}
.shelf-library-view .shelf-about {
  margin-top: 16px;
  padding-top: 14px;
  border-top-color: #e4e7df;
}
.shelf-library-view .shelf-about h1 {
  font-size: 20px;
  line-height: 1.35;
}
.shelf-library-view .shelf-intro { margin: 4px 0 0; }
.shelf-library-view .shelf-author-section h3 {
  margin: 0 0 5px;
  color: #263f33;
  font-size: 13px;
}
.shelf-library-view .shelf-author-bio { margin: 0; }
.shelf-library-view .shelf-author-section ul { margin: 0; }


.shelf-library-view .shelf-book-info .shelf-book-count {
  color: #244636;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.shelf-library-view .shelf-book-info {
  grid-template-rows: 18px 34px 18px;
  row-gap: 3px;
}
.shelf-library-view .shelf-book-info > * { min-height: 0; }

.shelf-library-view .shelf-author-section :is(.shelf-author-bio, li) {
  line-height: 1.65;
}

@media (min-width: 1600px) {
  .shelf-inline-rail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 0;
  }
  .shelf-inline-rail .section-heading { display: contents; }
  .shelf-inline-rail .section-heading h2 { grid-area: 1 / 1; margin-bottom: 18px; }
  .shelf-inline-rail .shelf-story-rail { grid-area: 2 / 1; }
  .shelf-inline-rail .rail-controls {
    grid-area: 2 / 2;
    align-self: center;
    justify-self: start;
    margin: 0 0 4px 14px;
  }
}
.shelf-inline-rail .rail-controls:not([hidden]) { display: flex; gap: 7px; }
.shelf-inline-rail .rail-arrow { position: relative; }
.shelf-inline-rail .rail-arrow:disabled { visibility: hidden; }

#series.shelf-lobby-view {
  --shelf-lobby-toolbar-height: 48px;
  --shelf-lobby-toolbar-gap: 14px;
}
#series.shelf-lobby-view > .shelf-write-bar {
  position: relative;
  inset: auto;
  min-height: var(--shelf-lobby-toolbar-height);
  margin-bottom: var(--shelf-lobby-toolbar-gap);
  background: transparent;
  pointer-events: none;
}
.shelf-lobby-view #library-write {
  align-self: flex-start;
  position: relative;
  pointer-events: auto;
}
.shelf-lobby-view #library-content { position: relative; }
.shelf-lobby-heading {
  position: absolute;
  inset: calc(-1 * (var(--shelf-lobby-toolbar-height) + var(--shelf-lobby-toolbar-gap))) auto auto 0;
  display: flex;
  align-items: center;
  height: var(--shelf-lobby-toolbar-height);
  font-size: clamp(23px, 2vw, 30px);
  letter-spacing: -.04em;
}

@media (min-width: 1280px) {
  #series:has(.shelf-library-view) { padding-top: 24px; }
  #series:has(.shelf-library-view) > .shelf-write-bar {
    position: fixed;
    inset: 112px max(36px, calc((100% - 1472px) / 2 + 36px)) auto auto;
  }
  .shelf-library-view.shelf-reading-view {
    column-gap: 10px;
  }
  .shelf-reading-view .shelf-reader {
    width: min(100%, 1026px);
    justify-self: end;
    container-type: inline-size;
  }
  .shelf-reading-view .shelf-reader-head { min-height: 47px; padding-inline-end: 96px; }
  .shelf-reading-view .shelf-book-spread {
    --library-leaf-width: 50cqw;
    --library-leaf-height: calc(var(--library-leaf-width) * 205 / 142);
    --library-leaf-unit: calc(var(--library-leaf-width) / 142);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
  }
  .shelf-reading-view .shelf-book-spread > :is(.shelf-previous-paper, .shelf-book-paper) {
    height: var(--library-leaf-height);
  }
  .shelf-reading-view .shelf-book-spread > .shelf-book-paper { grid-template-rows: minmax(0, 1fr) auto; }
  .shelf-reading-view .shelf-book-spread > .shelf-book-paper .shelf-book-copy { max-height: none; }
}

.shelf-reading-view .shelf-reading-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  padding-inline-end: 96px;
  gap: 8px 12px;
  margin-block-end: 12px;
}
.shelf-reading-heading h1 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shelf-reading-heading .shelf-reader-back { margin: 0; flex-wrap: nowrap; }
.shelf-book-copy .shelf-book-entry-title { margin: 0 0 .65em; font: inherit; font-weight: 700; }
@media (max-width: 760px) {
  .shelf-reading-view .shelf-reading-heading { grid-template-columns: minmax(0, 1fr); padding-inline-end: 0; }
  .shelf-reading-heading h1 { margin-inline-end: 100px; }
  .shelf-reading-heading .shelf-reader-back { justify-self: end; }
}

.shelf-book-spread .shelf-page-nav {
  inset-block-start: 50%;
  height: 0;
  z-index: 2;
}
:is(.shelf-book-spread,.library-print-book) .shelf-page-nav > :is(a,button) {
  position: absolute;
  transform: translateY(-50%);
  text-decoration: none;
}
:is(.shelf-book-spread,.library-print-book) .shelf-page-nav > .prev { inset-inline-start: 0; }
:is(.shelf-book-spread,.library-print-book) .shelf-page-nav > .next { inset-inline-end: 0; }
.shelf-book-spread .shelf-page-nav > button:disabled { display: none; }
@media (min-width: 1280px) {
  .shelf-reading-view .shelf-reader-book { width: min(100%, 1000px); }
  .shelf-book-spread .shelf-page-nav { inset-inline: -44px; }
}

:is(.shelf-book-spread,.library-print-book) .shelf-page-nav > :is(a,button),
.shelf-inline-rail .rail-controls .rail-arrow {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 1px solid #2a4b39;
  border-radius: 50%;
  background: linear-gradient(#456454, #244636);
  box-shadow: inset 0 1px #ffffff45, 0 2px 4px #17342630;
  color: #fff;
  font-size: 0;
  line-height: 1;
}
:is(.shelf-book-spread,.library-print-book) .shelf-page-nav > :is(a,button):hover,
.shelf-inline-rail .rail-controls .rail-arrow:hover:not(:disabled) { background: #345d49; }
:is(.shelf-book-spread,.library-print-book) .shelf-page-nav > :is(a,button)::after,
.shelf-inline-rail .rail-arrow::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 9px;
  height: 14px;
  background: currentColor;
  clip-path: polygon(0 14%, 24% 0, 100% 50%, 24% 100%, 0 86%, 56% 50%);
}
:is(.shelf-book-spread,.library-print-book) .shelf-page-nav > .prev::after,
.shelf-inline-rail .rail-arrow:first-child::after { transform: scaleX(-1); }

.shelf-book-spread {
  border: 0;
  outline: 0;
  background: #fffdf7;
  box-shadow: -3px 0 #e8e1d4, 3px 0 #e8e1d4, 0 10px 24px #34281920;
}
.shelf-book-spread .shelf-book-footer {
  border-top: 1px solid #cec5b4;
}

.shelf-reading-view .shelf-typeset-book {
  --book-line: calc(var(--library-leaf-height) * 150 / 205 / 21);
  container-type: inline-size;
}
.shelf-reading-view .shelf-typeset-book > .shelf-typeset-page {
  --paper-start: calc(var(--library-leaf-unit) * 20);
  --paper-end: calc(var(--library-leaf-unit) * 30);
  padding: 0;
  border: 0;
  border-radius: 7px 0 0 7px;
  background: linear-gradient(90deg,#fffdf8 94%,#f5efe1 98%,#e6dcc6);
}
.shelf-reading-view .shelf-typeset-book > .shelf-typeset-page + .shelf-typeset-page {
  --paper-start: calc(var(--library-leaf-unit) * 30);
  --paper-end: calc(var(--library-leaf-unit) * 20);
  background: linear-gradient(90deg,#ebe2cf,#fffdf8 6%);
  border-radius: 0 7px 7px 0;
}
.shelf-typeset-book .shelf-typeset-copy {
  position: absolute;
  inset: calc(20 * var(--library-leaf-unit)) var(--paper-end) calc(35 * var(--library-leaf-unit)) var(--paper-start);
  font: 13px/var(--book-line) 'Apple SD Gothic Neo',sans-serif;
  text-align: justify;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.shelf-typeset-book .shelf-typeset-copy h2 {
  font: inherit; font-weight: 700; text-align: left;
  margin: 0 0 var(--book-line);
}
.shelf-typeset-book .shelf-typeset-paragraphs p { margin: 0; text-indent: 0; text-align-last: left; }
.shelf-typeset-book .shelf-typeset-paragraphs .continued { text-indent: 0; }
.shelf-typeset-book .shelf-typeset-paragraphs .continues { text-align-last: justify; }
.shelf-reading-view .shelf-typeset-book > .shelf-typeset-page .shelf-book-footer {
  position: absolute;
  bottom: calc(12 * var(--library-leaf-unit));
}
.shelf-typeset-book > .shelf-typeset-page:first-child .shelf-book-footer { flex-direction: row-reverse; }

@media (min-width: 761px) {
  .shelf-reading-view .shelf-reading-heading {
    display: flex;
    justify-content: flex-start;
  }
  .shelf-reading-heading .shelf-reader-back { flex-shrink: 0; }
}

.shelf-reading-heading .shelf-reader-back { column-gap: 12px; }
@media (min-width: 761px) {
  .shelf-reading-view .shelf-reading-heading { column-gap: 26px; }
}

.shelf-profile .shelf-reader-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
  margin-block: var(--reader-action-spacing, 16px) 0;
}

.shelf-reading-view .shelf-book-spread {
  outline: 1px solid #d9d1c3;
  box-shadow: -2px 1px #eee8dc, 2px 1px #eee8dc, 0 7px 20px #34281916;
}

.shelf-repost-control { display: inline-grid; }
.shelf-repost-status { font-size: 12px; }
.shelf-write-bar .shelf-reader-edit {
  flex: none;
  min-height: var(--shelf-top-action-height);
  margin-inline-end: 8px;
  white-space: nowrap;
}
.shelf-write-bar .shelf-reader-edit + #library-write { margin-inline-start: 0; }

.shelf-reading-heading .shelf-reader-back {
  display: grid;
  grid-template-columns: repeat(2, 7.25rem);
}
.shelf-reading-heading .shelf-reader-back > a {
  box-sizing: border-box;
  width: 100% !important;
  margin: 0 !important;
  min-height: 44px;
  justify-content: center;
  white-space: nowrap;
}

#series .shelf-write-bar:has(.shelf-reader-edit) > :is(.shelf-reader-edit, #library-write) {
  box-sizing: border-box;
  width: 84px;
  height: var(--shelf-top-action-height);
  padding-inline: 8px;
}

#series .shelf-write-bar:has(.shelf-reader-edit) > :is(.shelf-reader-edit, #library-write) {
  font: 700 14px/1.2 system-ui, sans-serif;
  letter-spacing: normal;
}
#series .shelf-reader-actions .library-comment-button {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 96px;
  height: 44px;
  padding: 0 5px;
  white-space: nowrap;
}
.shelf-reaction-icon {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.library-entry-like[aria-pressed="true"] .shelf-reaction-icon { fill: currentColor; }

.shelf-reading-heading .shelf-reader-back > a { column-gap: 10px; }
.shelf-reader-back-arrow { flex: none; }

.shelf-typeset-paragraphs .continued { text-indent: 0 !important; }

@media (max-width: 760px) {
  .shelf-card {
    grid-template-columns: 76px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
  .shelf-card.featured { grid-template-columns: 104px minmax(0, 1fr); }
  .shelf-card .discovery-cover {
    width: 100%;
    min-width: 0;
    min-height: 0;
  }
  .shelf-cover-art-pending .discovery-cover { background-image: none; }
}
.shelf-legacy-copy,
.shelf-legacy-copy p {
  text-align: left;
  text-align-last: left;
  text-indent: 0;
}
.shelf-typeset-paragraphs .shelf-legacy-copy,
.shelf-legacy-copy .shelf-typeset-paragraphs p { text-indent: 0; text-align-last: left; }
.shelf-legacy-copy p:empty { min-height: 1lh; }

body.library-discovery-page #library-editor.library-prose-editor {
  box-sizing: border-box;
  width: min(1260px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  padding: 18px;
}
.library-print-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1000px) minmax(160px, 1fr);
  gap: 24px;
  align-items: start;
}
.library-print-tools {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #ded8cb;
  border-radius: 8px;
  background: #f7f5ee;
}
.library-print-tools p { margin: 0; }
.library-print-tools .library-print-indent-control {
  display: flex;
  align-items: center;
  gap: 6px;
}
.library-print-tools button { padding: 8px 10px; }
.library-print-tools .library-print-preview {
  background: #244636;
  color: white;
}

.library-print-book {
  position: relative;
  width: min(100%, 1000px);
  margin: 10px 0;
  container-type: inline-size;
}
.library-print-viewport {
  border: 1px solid #ded5c5;
  border-radius: 7px;
  box-shadow: 0 7px 20px #34281916;
  overflow: clip;
}
.library-print-paper {
  --page: 50cqw;
  --unit: calc(var(--page) / 142);
  --inside: calc(var(--unit) * 30);
  --outside: calc(var(--unit) * 20);
  --text-height: calc(var(--unit) * 150);
  --leading: calc(var(--text-height) / 21);
  position: relative;
  width: calc(2 * var(--page));
  height: calc(var(--unit) * 205);
  background: linear-gradient(90deg, #fffdf8 46%, #eee7d6 50%, #fffdf8 54%);
}
.library-print-flow {
  position: absolute;
  top: var(--outside);
  left: var(--outside);
  width: calc(var(--page) - var(--inside) - var(--outside));
  height: calc(var(--text-height) + .5px);
  column-count: 1;
  column-gap: calc(2 * var(--inside));
  column-fill: auto;
  font: 13px/var(--leading) 'Apple SD Gothic Neo', sans-serif;
  text-align: justify;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  widows: 1;
  orphans: 1;
  color: #29271f;
}
.library-print-title { font: inherit; font-weight: 700; margin: 0 0 var(--leading); text-align: left; }
.library-print-body { min-height: var(--leading); outline: none; }
.library-print-body > :is(div,p) { margin: 0; min-height: var(--leading); }
.library-print-indent .library-print-body { text-indent: 1.5em; }
.library-print-center .library-print-body { text-align: center; text-indent: 0; }
.library-print-paper > .shelf-book-footer {
  bottom: calc(var(--unit) * 12);
  left: var(--outside);
  right: calc(var(--page) + var(--inside));
}
.library-print-paper > .shelf-book-footer:nth-last-child(2) { flex-direction: row-reverse; }
.library-print-paper > .shelf-book-footer:last-child {
  left: calc(var(--page) + var(--inside));
  right: var(--outside);
}
.library-print-editing:not(.library-print-previewing) .library-print-paper::before,
.library-print-editing:not(.library-print-previewing) .library-print-paper::after {
  content: '';
  pointer-events: none;
  position: absolute;
  top: var(--outside);
  height: var(--text-height);
  box-sizing: border-box;
  width: calc(var(--page) - var(--inside) - var(--outside));
  border: 1px dashed #a9aa98;
  background: repeating-linear-gradient(transparent 0 calc(var(--leading) - 1px), #d2cebc44 calc(var(--leading) - 1px) var(--leading));
}
.library-print-editing:not(.library-print-previewing) .library-print-paper::before { left: var(--outside); }
.library-print-editing:not(.library-print-previewing) .library-print-paper::after { left: calc(var(--page) + var(--inside)); }
.library-print-single.library-print-editing .library-print-paper::after { opacity: .35; }
.library-print-single.library-print-editing .shelf-book-footer:last-child { opacity: .35; }

@media (min-width: 761px) {
  .library-print-single:is(.library-print-reading,.library-print-previewing) .library-print-flow { left: calc(var(--page) + var(--inside)); }
  .library-print-single:is(.library-print-reading,.library-print-previewing) .shelf-book-footer:nth-last-child(2) { display: none; }
  .library-print-single:is(.library-print-reading,.library-print-previewing) .shelf-book-footer:last-child { opacity: 1; }
  .library-print-single:is(.library-print-reading,.library-print-previewing) .shelf-book-number { font-size: 0; }
  .library-print-single:is(.library-print-reading,.library-print-previewing) .shelf-book-number::before { content: var(--print-start-page, '1'); font-size: 12px; }
}
@media (max-width: 760px) {
  .library-print-workspace { grid-template-columns: minmax(0, 1fr); }
  .library-print-tools { order: -1; }
  .library-print-viewport { overflow-x: auto; }
  .library-print-paper { --page: calc(100cqw - 2px); }
  .library-print-flow { font-size: clamp(11px, 3.3cqw, 13px); }
  .library-print-single .library-print-paper { width: var(--page); }
  .library-print-single .library-print-paper > .shelf-book-footer:last-child { display: none; }
}

.library-print-book .shelf-page-nav {
  position: absolute;
  display: flex;
  justify-content: space-between;
  inset: 50% -44px auto;
  z-index: 2;
  pointer-events: none;
}
.library-print-book .shelf-page-nav > :is(a,button) { position: absolute; pointer-events: auto; }
@media (max-width: 1279px) {
  .library-print-book .shelf-page-nav { inset-inline: 2px; }
}

@media (max-width: 760px) {
  .library-print-book { width: min(100%, calc(100vw - 64px)); }
  .library-print-single .library-print-paper {
    background: #fffdf8;
  }
}

#library-editor.library-prose-editor > form > .relay-demo-note { display: none; }
#library-editor.library-prose-editor > form { position: relative; }
#library-editor.library-prose-editor .paper-dialog-head {
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 0;
  margin: 0;
}
#library-editor.library-prose-editor #library-editor-kind { display: none; }
#library-editor.library-prose-editor #library-editor-title {
  display: flex;
  align-items: center;
  min-height: 36px;
  margin: 0 44px 8px 0;
}
#library-editor .library-print-tools .library-print-status {
  block-size: 3.9em;
  line-height: 1.3;
  overflow: auto;
  overflow-wrap: anywhere;
}
.library-print-tools input:not([type=checkbox]) { min-width: 0; width: 100%; box-sizing: border-box; }
.library-print-flow h2.library-print-title,
#library-editor .library-print-flow h2.library-print-title {
  font: inherit;
  font-weight: 700;
  margin: 0 0 var(--leading);
  color: inherit;
}
#library-editor .library-print-tools .library-print-preview {
  white-space: nowrap;
  background: #244636 !important;
  color: #fff !important;
}

.library-print-extra-pages .library-print-viewport { overflow-x: auto; }
.library-print-extra-pages .library-print-paper {
  width: calc(var(--print-pages) * var(--page));
  background: #fffdf8;
}
.library-print-extra-pages .library-print-paper > .shelf-book-footer {
  right: auto;
  width: calc(var(--page) - var(--inside) - var(--outside));
}
.library-print-extra-pages .library-print-paper > .library-print-extra-footer {
  left: calc(var(--print-extra-index) * (var(--page) + var(--inside) - var(--outside)) + var(--outside));
}

@font-face {
  font-family: 'Paperlogy';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-4Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Library Iropke Batang';
  src: url('/main-site/assets/iropke-batang-medium.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}
.library-print-body { font-family: var(--library-book-body-font, 'Noto Sans KR', sans-serif); }
.library-print-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.library-print-actions button { min-width: 0; padding-inline: 4px; }
.library-print-actions #library-editor-submit {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
}
.library-print-bold[aria-pressed="true"] { outline: 2px solid #345845; }
.shelf-entry-links,

.shelf-reading-view :is(.shelf-book-spread,.library-print-book) > .shelf-page-nav {
  inset: 50% 0 auto;
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.shelf-reading-view :is(.shelf-book-spread,.library-print-book) .shelf-page-nav > .prev {
  inset-inline-start: 3.52%;
  transform: translate(-50%, -50%);
}
.shelf-reading-view :is(.shelf-book-spread,.library-print-book) .shelf-page-nav > .next {
  inset-inline-end: 3.52%;
  transform: translate(50%, -50%);
}
@media (max-width: 1279px) {
  .shelf-reading-view .shelf-book-spread .shelf-page-nav > .next { inset-inline-end: 5.17%; }
  .shelf-reading-view .shelf-page-nav > :is(a,button) { width: 28px; height: 28px; }
}
@media (max-width: 760px) {
  .shelf-reading-view .shelf-book-spread .shelf-page-nav > .prev { inset-inline-start: 6.9%; }
  .shelf-reading-view .library-print-book .shelf-page-nav > .prev { inset-inline-start: 7.04%; }
  .shelf-reading-view .library-print-book .shelf-page-nav > .next { inset-inline-end: 7.04%; }
}

.library-print-workspace > .library-print-book {
  margin-block: 0;
}

#library-editor #library-editor-close.paper-close {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #395146;
  font: 400 22px/1 system-ui, sans-serif;
  cursor: pointer;
}
#library-editor #library-editor-close.paper-close:hover {
  color: #142f23;
}
#library-editor #library-editor-close.paper-close:focus-visible {
  outline: 2px solid #547162;
  outline-offset: 2px;
}

.library-print-book .shelf-page-nav > button[hidden],
.library-print-book .shelf-page-nav:has(> button.prev:not([hidden])) > a.prev,
.library-print-book .shelf-page-nav:has(> button.next:not([hidden])) > a.next { display: none; }

@media (max-width: 760px) {
  #series > .shelf-write-bar,
  #series.shelf-lobby-view > .shelf-write-bar {
    position: relative;
    inset: auto;
  }
    .shelf-layout > .shelf-profile { padding-top: 4px; }

  .shelf-card-copy { min-height: 0; }
  .shelf-card :is(h3, .shelf-byline, .shelf-read) { flex: none; }
  .shelf-card .shelf-byline {
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .shelf-card .shelf-excerpt {
    flex: none;
    font-size: 12px;
    line-height: 1.45;
    max-block-size: 2lh;
    margin-block: 4px 3px;
  }
  .shelf-card:not(.featured) { height: 144px; }
  .shelf-card:not(.featured) .shelf-read { padding: 4px 7px; }
  .shelf-card .discovery-cover { aspect-ratio: auto; }

  .shelf-library-view .shelf-books {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(81%, 290px);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 10px;
    overscroll-behavior-x: contain;
    --shelf-floor: calc(16px + var(--shelf-cover-width) * 1.4);
    padding-bottom: 12px;
  }
  .shelf-library-view .shelf-books > * { scroll-snap-align: start; }
  .shelf-library-view .shelf-books > .shelf-vacant-book { display: none; }
  .shelf-library-view .shelf-book-slot {
    grid-template-columns: var(--shelf-cover-width) minmax(0, 1fr);
    grid-template-rows: calc(var(--shelf-cover-width) * 1.4) auto;
    align-items: center;
    align-self: start;
    column-gap: 12px;
    row-gap: 15px;
  }
  .shelf-library-view .shelf-book-slot > .shelf-book-info {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
  }
  #series .shelf-library-view .shelf-book-slot > .shelf-book-edit {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
  }

  #series:has(.shelf-reading-view) {
    display: flex;
    flex-direction: column;
  }
  #series:has(.shelf-reading-view) > .shelf-write-bar {
    position: static;
    order: 1;
    margin: 12px 0 0;
  }
  .shelf-library-view.shelf-reading-view {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .shelf-reading-view > .shelf-profile {
    order: 1;
    padding: 0;
    border: 0;
  }
  .shelf-reading-view > .shelf-profile > :not(.shelf-reader-actions) { display: none; }
  .shelf-reading-view .shelf-reader { width: 100%; }
  .shelf-reading-view .shelf-reading-heading {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-block-end: 8px;
  }
  .shelf-reading-heading h1 {
    margin-inline-end: 0;
    font-size: clamp(14px, 4vw, 19px);
  }
  .shelf-reading-view .shelf-reading-heading .shelf-reader-back { gap: 6px; }
  #series .shelf-reading-view .shelf-reader-back > a {
    min-height: 34px;
    padding-inline: 8px;
    column-gap: 5px;
    font-size: 11px;
  }
  .shelf-reading-view .library-print-book { margin-inline: auto; }
  .shelf-reading-view .library-print-book > .shelf-page-nav > :is(a,button) {
    width: 32px;
    height: 32px;
  }
  .shelf-reading-view .library-print-book > .shelf-page-nav > :is(a,button)::before {
    content: '';
    position: absolute;
    inset: -6px;
  }
}

@media (max-width: 760px) {
  .shelf-library-view .shelf-books {
    position: relative;
    justify-content: start;
    grid-auto-columns: min(69%, 252px);
    column-gap: 12px;
    scrollbar-width: none;
    background:
      repeating-linear-gradient(1deg, #795f4310 0 1px, transparent 1px 4px) 0 var(--shelf-ledge) / 100% var(--shelf-ledge-height) no-repeat,
      linear-gradient(to bottom, #c7ae8e, #e6d3b6 56%, #c5ab8a 57%, #a68b6b 100%) 0 var(--shelf-ledge) / 100% var(--shelf-ledge-height) no-repeat,
      radial-gradient(ellipse at 50% 24%, #f5f1e8 10%, transparent 75%) 0 0 / 100% var(--shelf-floor) no-repeat,
      linear-gradient(#eeeadf 0%, #e4dac9 86%, #d5c5ad 100%) 0 0 / 100% var(--shelf-floor) no-repeat;
    --shelf-ledge: calc(var(--shelf-floor) - 8px);
    --shelf-ledge-height: calc(8px + var(--shelf-lip));
  }
  .shelf-library-view .shelf-books::-webkit-scrollbar { display: none; }
  .shelf-library-view .shelf-books::before { content: none; }
  .shelf-library-view .shelf-book-slot { column-gap: 10px; row-gap: 16px; }

}

#series > .shelf-write-bar[hidden] { display: none; }

.shelf-library-view .shelf-profile-top:has(> #library-write) {
  max-width: none;
  align-items: center;
  gap: clamp(6px, 1vw, 12px);
}
.shelf-profile-top > .shelf-profile-identity { min-width: 0; }
#series .shelf-profile-top > #library-write { margin-block: 0; }

.shelf-library-view .shelf-body > .shelf-page-heading {
  align-items: center;
  padding-inline-end: 0;
}
.shelf-library-view .shelf-body > .shelf-page-heading h2 { margin: 0; }

.library-discovery-page .discovery-cover:has(> .shelf-cover-title) { container-type: inline-size; }
.library-discovery-page .discovery-cover > .shelf-cover-title {
  display: block;
  font-size: min(25px, var(--shelf-cover-title-fit));
  line-height: 1.2;
  max-height: none;
  letter-spacing: normal;
}
.shelf-cover-title > span { display: block; white-space: nowrap; }

/* The turning leaf can extend past the book, but the reader has no horizontal pan. */
.library-reading-spread > .library-print-viewport {
 overflow: hidden;
 overflow: clip;
}

.library-reading-spread .library-spread-measurement {
 position: absolute;
 inset: 0;
 overflow: hidden;
 visibility: hidden;
 pointer-events: none;
}
.library-reading-spread :is(.library-spread-leaf,.library-turn-sheet) {
 position: absolute;
 inset-block: 0;
 width: var(--page);
}
.library-reading-spread :is(.library-spread-left,.library-turn-left) { left: 0; }
.library-reading-spread :is(.library-spread-right,.library-turn-right) { right: 0; }
.library-reading-spread .library-spread-window {
 position: absolute;
 top: var(--reading-top, var(--outside));
 left: var(--outside);
 right: var(--inside);
 height: calc(var(--text-height) + .5px);
 overflow: hidden;
}
.library-reading-spread :is(.library-spread-right,.library-turn-right) .library-spread-window {
 left: var(--inside);
 right: var(--outside);
}
.library-reading-spread .library-spread-window .library-print-flow {
 top: 0;
 left: calc(-1 * var(--leaf-column) * (var(--page) + var(--inside) - var(--outside)));
}
.library-reading-spread :is(.library-spread-leaf,.library-turn-sheet) .shelf-book-footer {
 position: absolute;
 bottom: calc(var(--unit) * 12);
 left: var(--outside);
 right: var(--inside);
 flex-direction: row-reverse;
}
.library-reading-spread :is(.library-spread-right,.library-turn-right) .shelf-book-footer {
 left: var(--inside);
 right: var(--outside);
 flex-direction: row;
}
@media (min-width: 1101px) and (max-width: 1279px) {
 .library-reading-spread .library-print-paper {
  --inside: calc(var(--unit) * 26);
  --reading-lift: 1pt;
  /* Reserve one line from the previous 20-line layout above the footer. */
  --text-height: calc(var(--unit) * 158 * 19 / 20);
  --leading: calc(var(--text-height) / 17);
  --reading-top: calc(var(--outside) - 3px - var(--reading-lift));
 }
 .library-reading-spread .library-print-flow { font-size: 12px; }
 .library-reading-spread :is(.library-spread-leaf,.library-turn-sheet) .shelf-book-footer {
  bottom: calc(var(--unit) * 12 + var(--reading-lift));
 }
}
@media (max-width: 760px) {
 .shelf-reading-view .library-reading-spread {
  width: calc(100% + 20px);
  margin-inline: -10px;
 }
 .library-reading-spread .library-print-paper {
  --spread-width: calc(100cqw - 2px);
  --spread-ratio: 1.12;
  --original-page: calc(var(--spread-width) / 1.08);
  --page: calc(var(--spread-width) / var(--spread-ratio));
  --unit: calc(var(--original-page) / 142);
  --inside: calc(var(--unit) * 21);
  --reading-lines: 19;
  --reading-margins: calc(var(--unit) * 55);
  --original-leading: min(clamp(22px, calc(2.8dvh + 3px), 26px), calc((var(--original-page) * 1.8 - var(--reading-margins)) / 19));
  --reading-height: calc((var(--original-leading) * 19 + var(--reading-margins)) * 1.08 / var(--spread-ratio));
  --text-height: calc(var(--reading-height) - var(--reading-margins) + clamp(16px, 5.75cqw, 22px));
  --leading: calc(var(--text-height) / var(--reading-lines));
  --reading-lift: 1pt;
  --reading-top: calc(var(--outside) - var(--reading-lift));
  height: var(--reading-height);
  margin-inline-start: calc(var(--spread-width) - 2 * var(--page));
  background: linear-gradient(90deg, #fcf9f0 calc(50% - 12px), #e4dac7 calc(50% - 1px), #dcd0ba 50%, #eee6d7 calc(50% + 2px), #fffdf8 calc(50% + 12px));
 }
 .library-reading-spread .library-print-flow {
  font-size: clamp(13px, calc(3.3cqw + 2px), 15px);
 }
 .library-reading-spread :is(.library-spread-leaf,.library-turn-sheet) .shelf-book-footer {
  bottom: calc(max(12px, calc(var(--unit) * 12 - 7px)) + var(--reading-lift));
 }
 .shelf-reading-view .library-reading-spread > .shelf-page-nav > .prev { inset-inline-start: 9%; }
 .shelf-reading-view .library-reading-spread > .shelf-page-nav > .next { inset-inline-end: 6.52%; }
}


@media (max-width: 360px) {
 .shelf-reading-view .library-reading-spread {
  width: calc(100% + 4px);
  margin-inline: -2px;
 }
 .library-reading-spread .library-print-paper {
  --reading-height: calc(var(--page) * 1.78);
  --reading-lines: 17;
  --reading-body-lift: 2pt;
  --reading-top: calc(var(--outside) - var(--reading-lift) - var(--reading-body-lift));
 }
 .library-reading-spread .library-spread-window .library-print-title {
  position: relative;
  inset-block-start: var(--reading-body-lift);
 }
}

.library-reading-spread .library-spread-left > :is(.library-spread-window,.shelf-book-footer),
.library-reading-spread .library-turn-left > :is(.library-spread-window,.shelf-book-footer) {
 opacity: .69;
}


.library-reading-spread .library-turn-sheet {
 z-index: 1;
 pointer-events: none;
 perspective: 1150px;
}
.library-turn-right { --curl-origin: left; }
.library-turn-left { --curl-origin: right; }
.library-curl-strip {
 position: absolute;
 inset-block: 0;
 width: calc(100% / var(--curl-slices) + .65px);
 overflow: hidden;
 background: #fffdf8;
 transform-origin: var(--curl-origin) center;
}
.library-turn-right .library-curl-strip { left: 0; }
.library-turn-left .library-curl-strip { right: 0; }
.library-curl-strip::after {
 content: '';
 position: absolute;
 inset: 0;
 background: linear-gradient(rgb(255 254 245 / var(--slice-highlight, 0)), transparent 25%),
             rgb(93 70 33 / var(--slice-shadow, 0));
}
.library-curl-content {
 position: absolute;
 inset-block: 0;
 width: var(--page);
}
.library-turn-right .library-curl-content { left: var(--slice-offset); }
.library-turn-left .library-curl-content { right: var(--slice-offset); }
.library-curl-back {
 background: #f5eddd;
}
.library-curl-back .library-curl-content { visibility: hidden; }

.library-reading-spread .is-turn-reversing > .library-spread-right:not(.library-turn-underlay) { visibility: hidden; }

@media (max-width: 760px) {
  #series .shelf-reader-actions-compact {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) 5px repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  #series .shelf-reader-actions-compact :is(.library-comment-button, .shelf-reader-edit, #library-write) {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding-inline: 2px;
    gap: 2px;
    --sb-button-radius: 10px;
    font: 700 clamp(11px, 3vw, 13px)/1 system-ui, sans-serif;
    letter-spacing: normal;
    white-space: nowrap;
  }

  #series .shelf-reader-actions-compact .shelf-reaction-icon {
    width: clamp(10px, 3vw, 14px);
    height: clamp(10px, 3vw, 14px);
  }

  #series .shelf-reader-actions-compact .shelf-reader-edit { grid-column: 4; }
  #series .shelf-reader-actions-compact #library-write { grid-column: 5; }

  #series .shelf-reader-actions-compact :is(.shelf-reader-edit, #library-write) {
    --sb-face: #dcebdd;
    --sb-border: #bfd2bf;
    --sb-ink: #234c38;
    --sb-edge: #b2c8b5;
  }
}
