@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --paper: #f5f0e5;
  --page: #faf7eb;
  --ink: #253f34;
  --muted: #69715f;
  --green: #355a43;
  --orange: #c85b33;
  --line: #d8d9c8;
  --font-body: 'Manrope', Arial, sans-serif;
  --font-accent: Georgia, 'Times New Roman', serif;
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lead: 18px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;
  --gutter: clamp(24px, 4vw, 56px);
  --width: 1280px;
  --ease: cubic-bezier(.22,.8,.25,1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: var(--text-base); line-height: 1.7; -webkit-font-smoothing: antialiased; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23725f3b' opacity='.035' filter='url(%23n)' d='M0 0h160v160H0z'/%3E%3C/svg%3E"); }
h1,h2,h3,p { margin: 0; }
h1,h2,h3 { font-family: var(--font-body); }
h1,h2 { font-weight: 600; letter-spacing: -.055em; line-height: 1.08; }
button,a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; font: inherit; cursor: pointer; }
a { color: inherit; }
button:focus-visible,a:focus-visible,summary:focus-visible { outline: 3px solid var(--orange); outline-offset: 5px; }
[hidden] { display: none !important; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.icon { width: 20px; height: 20px; flex-shrink: 0; display: inline-block; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.handwritten { font-family: var(--font-accent); font-style: italic; font-weight: 400; color: var(--orange); letter-spacing: -.05em; }
.skip { position: fixed; top: -100px; left: var(--space-6); z-index: 99; padding: var(--space-4); background: var(--page); }
.skip:focus { top: var(--space-3); }
.header { max-width: var(--width); margin: auto; padding: var(--space-8) var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); }
.brand { display: inline-flex; align-items: center; gap: var(--space-3); font-size: 24px; font-weight: 800; line-height: 1; letter-spacing: -.06em; text-decoration: none; }
.brand-icon { width: 32px; height: 32px; color: var(--green); }
.brand-dot { color: var(--orange); }
.header-note { color: var(--muted); font-size: var(--text-sm); }
.motion-control { min-height: 44px; padding: 10px var(--space-4); background: transparent; border: 1px solid #c8cbb9; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); font-size: var(--text-xs); font-weight: 600; }
.motion-control:hover { background: #e9e8d9; }
.motion-icon { display: inline-flex; }
.motion-icon .icon { width: 16px; height: 16px; }
.motion-icon-off,.no-motion .motion-icon-on { display: none; }
.no-motion .motion-icon-off { display: inline-flex; }
.library { max-width: var(--width); padding: var(--space-12) var(--gutter) 0; margin: auto; }
.intro { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0,1fr) minmax(240px,320px); align-items: end; column-gap: var(--space-12); }
.eyebrow { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); line-height: 1.6; letter-spacing: .12em; font-weight: 700; }
.intro>.eyebrow { grid-column: 1/-1; margin-bottom: var(--space-6); }
.status-dot { width: 6px; height: 6px; display: inline-block; flex-shrink: 0; background: #7f9568; border-radius: 50%; }
h1 { position: relative; width: max-content; max-width: 100%; font-size: clamp(48px,5.6vw,80px); }
.hero-accent { position: relative; display: inline-block; }
.hero-accent>svg { position: absolute; width: 100%; height: 24px; right: 0; bottom: -18px; fill: none; stroke: var(--orange); stroke-width: 1.5; transform: rotate(-6deg); }
.intro>p { max-width: 320px; padding-bottom: var(--space-1); color: var(--muted); font-size: var(--text-base); line-height: 1.85; }
.shelf-stage { position: relative; margin-top: var(--space-16); padding: var(--space-16) var(--space-12) 0; background: radial-gradient(ellipse at 46% 68%,#ded9c776,transparent 65%); }
.wall-label { position: absolute; top: 0; left: 0; color: #787e6d; font-size: var(--text-xs); letter-spacing: .12em; }
.wall-doodle { position: absolute; width: 44px; height: 44px; right: 20%; top: 64px; color: var(--orange); stroke-width: 1.25; transform: rotate(12deg); }
.shelf-content { position: relative; height: 352px; display: flex; align-items: flex-end; gap: clamp(48px,8vw,112px); padding-left: 6%; }
.book-place { position: relative; perspective: 1000px; flex-shrink: 0; }
.book-badge { position: absolute; white-space: nowrap; top: -36px; left: 0; font-size: 10px; line-height: 1.6; letter-spacing: .1em; font-weight: 700; color: var(--muted); }
.shelf-book { position: relative; display: block; width: 232px; height: 320px; border: 0; padding: 0; background: none; transform: rotate(-6deg); transform-style: preserve-3d; transition: transform .65s var(--ease),filter .65s; filter: drop-shadow(12px 10px 6px #2d3b3030); z-index: 2; text-align: left; }
.book-cover { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 24px 20px 20px 28px; background: var(--green); border-radius: 3px 7px 7px 3px; color: #f7f1dc; box-shadow: inset 5px 0 5px #18392d70,inset 9px 0 0 #ffffff09,1px 0 1px #0c352b80; overflow: hidden; }
.book-cover:after { content: ''; position: absolute; inset: 0; opacity: .15; background: repeating-linear-gradient(0deg,transparent,transparent 2px,#071f1622 3px); pointer-events: none; }
.book-pages { position: absolute; inset: 4px -9px -2px 8px; border-radius: 4px; background: repeating-linear-gradient(0deg,#e5dfc8 0 1px,#fff7df 1px 3px); transform: translateZ(-8px); box-shadow: 2px 2px 0 #244b37; }
.cover-top,.cover-bottom { font-size: 7px; line-height: 1.7; letter-spacing: .12em; }
.cover-top { opacity: .8; }
.cover-title { font-family: var(--font-body); font-size: 24px; font-weight: 600; line-height: 1.08; letter-spacing: -.055em; margin-top: var(--space-4); flex-shrink: 0; }
.cover-period { color: #dbb678; }
.cover-art { display: block; height: 130px; margin: -4px -12px; }
.cover-art svg { width: 100%; height: 100%; }
.cover-bottom { margin-top: auto; }
.shelf-book:hover,.shelf-book:focus-visible { transform: translateY(-16px) rotate(-2deg) rotateY(-12deg); filter: drop-shadow(18px 20px 10px #2d3b3035); }
.book-caption { position: absolute; top: calc(100% + 32px); left: 0; display: flex; align-items: center; gap: var(--space-2); white-space: nowrap; font-family: var(--font-accent); font-size: 16px; font-style: italic; color: var(--muted); z-index: 3; transform: rotate(-4deg); }
.caption-arrow { width: 24px; height: 24px; }
.wood-shelf { position: relative; z-index: 1; height: 24px; background: linear-gradient(#c29c74 0 12%,#b98a5e 14% 84%,#976f47 88% 100%); border-radius: 2px; margin: 0 -48px; box-shadow: 0 6px 4px #87684922; transform: perspective(800px) rotateX(4deg); }
.wood-shelf:before { content: ''; position: absolute; top: -12px; left: 0; right: 0; height: 12px; background: linear-gradient(90deg,#c8a781,#e0c7a6 45%,#caab87); clip-path: polygon(2% 0,98% 0,100% 100%,0 100%); }
.wood-shelf div { height: 100%; opacity: .2; background: repeating-linear-gradient(1deg,transparent 0 4px,#6b472a33 5px,transparent 6px 10px); }
.shelf-shadow { height: 64px; background: linear-gradient(#625f4624,transparent 60%); filter: blur(4px); margin: 0 -40px; }
.shelf-space { align-self: center; margin-top: var(--space-8); color: var(--muted); transform: rotate(-4deg); }
.shelf-space .shelf-note-arrow { width: 40px; height: 40px; margin: 0 0 var(--space-3) var(--space-2); color: #939a82; stroke-width: 1.25; }
.shelf-space p { font-family: var(--font-accent); font-style: italic; font-size: 32px; line-height: 1.2; letter-spacing: -.025em; }
.shelf-space>span { display: block; margin-top: var(--space-4); font-size: var(--text-sm); line-height: 1.7; transform: rotate(4deg); }
.plant { width: 90px; height: 140px; position: absolute; right: 3%; bottom: 0; }
.stem { height: 104px; width: 3px; background: #638167; position: absolute; left: 44px; bottom: 10px; transform: rotate(5deg); }
.leaf { position: absolute; background: #69866d; border-radius: 90% 10% 90% 10%; width: 35px; height: 65px; transform-origin: bottom right; }
.leaf-a { bottom: 52px; left: 4px; transform: rotate(-35deg); background: #87966d; }
.leaf-b { bottom: 65px; left: 31px; transform: rotate(25deg); }
.leaf-c { bottom: 35px; left: 28px; width: 32px; height: 50px; transform: rotate(65deg); background: #a5ac7a; }
.pot { width: 66px; height: 57px; background: linear-gradient(90deg,#b87552,#d4976a); clip-path: polygon(0 0,100% 0,85% 100%,15% 100%); position: absolute; bottom: 0; left: 16px; border-radius: 5px; }
.library-bottom { display: flex; justify-content: space-between; align-items: center; gap: var(--space-6); padding: var(--space-6) 0 var(--space-16); }
.edition { font-size: var(--text-xs); letter-spacing: .1em; color: var(--muted); }
.library-bottom a { display: inline-flex; align-items: center; gap: var(--space-4); min-height: 44px; font-size: var(--text-sm); text-decoration: none; }
.library-bottom a:hover,.back-link:hover { color: var(--orange); }
.format { max-width: var(--width); margin: 0 auto; padding: var(--space-16) var(--gutter) var(--space-24); display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.15fr); column-gap: var(--space-24); position: relative; }
.format:before { content: ''; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); border-top: 1px solid var(--line); }
.format h2 { font-size: clamp(36px,3.8vw,52px); margin: var(--space-6) 0; }
.format>div>p { max-width: 360px; font-size: var(--text-base); line-height: 1.8; color: var(--muted); }
.format-details article { display: flex; gap: var(--space-6); padding: var(--space-6) 0; border-bottom: 1px solid var(--line); }
.format-details article:first-child { padding-top: 0; }
.format-icon { width: 48px; height: 48px; flex-shrink: 0; display: grid; place-items: center; background: #e8e8d8; border: 1px solid #dcdfca; border-radius: 14px; color: var(--green); }
.format-icon .icon { width: 24px; height: 24px; }
.format-details h3 { font-size: var(--text-base); line-height: 1.5; font-weight: 700; letter-spacing: -.02em; margin-bottom: var(--space-2); }
.format-details p { font-size: var(--text-sm); line-height: 1.8; color: var(--muted); }
.format-details .development-note { margin-top: var(--space-6); font-size: var(--text-xs); }
footer { max-width: var(--width); margin: 0 auto; padding: var(--space-8) var(--gutter); border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: var(--space-6); color: var(--muted); font-size: var(--text-xs); }

/* The same physical cover travels from the shelf and hinges into the spread. */
body.reader-visible { overflow: hidden; }
dialog { border: 0; padding: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: transparent; color: var(--ink); overflow: hidden; isolation: isolate; }
dialog::backdrop { background: transparent; }
.reader-shade { position: fixed; inset: 0; z-index: -1; background: rgba(30,44,32,.4); backdrop-filter: blur(8px); pointer-events: none; }
.reader-toolbar { height: clamp(64px,8dvh,88px); padding: var(--space-4) clamp(24px,3vw,48px); display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); color: var(--paper); position: relative; z-index: 10; }
.reader-brand { font-size: var(--text-xs); letter-spacing: .12em; font-weight: 600; text-shadow: 0 1px 4px #26372c66; }
.close-button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-3); min-height: 44px; padding: 10px var(--space-4); border: 0; border-radius: 99px; background: var(--paper); color: var(--ink); font-size: var(--text-sm); font-weight: 600; box-shadow: 0 3px 12px #17271e20; }
.close-button:hover { background: #e5e7d7; }
.opened-book { width: calc(100% - clamp(28px,6vw,110px)); max-width: 1600px; height: calc(100dvh - clamp(64px,8dvh,88px) - clamp(24px,4dvh,64px)); margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; position: relative; perspective: 2400px; border-radius: 8px; transform-origin: center; overflow: visible; }
.left-page,.right-page { position: relative; height: 100%; min-width: 0; padding: clamp(32px,3.6vw,64px); background: var(--page); overflow: hidden; }
.left-page { border-radius: 8px 0 0 8px; background: linear-gradient(90deg,#f5f0de,#faf7eb 85%,#d5ceba); display: flex; flex-direction: column; justify-content: space-between; }
.right-page { border-radius: 0 8px 8px 0; background: linear-gradient(90deg,#e5decb,#faf7eb 5%); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #a4ae93 transparent; }
.right-page h2 { font-size: clamp(48px,5.2vw,80px); margin: var(--space-8) 0 var(--space-6); }
#reader-title { font-size: clamp(36px,4vw,58px); }
.right-page p { font-size: var(--text-sm); line-height: 1.8; max-width: 540px; color: var(--muted); }
.right-page .eyebrow { font-size: var(--text-xs); letter-spacing: .1em; }
.right-page .reader-lead { font-size: var(--text-lead); line-height: 1.65; color: var(--ink); margin-bottom: var(--space-6); }
.primary { min-height: 52px; display: inline-flex; justify-content: space-between; align-items: center; gap: var(--space-6); margin-top: var(--space-8); padding: var(--space-4) var(--space-6); background: var(--ink); color: #fff9e8; border: 0; border-radius: 8px; font-size: var(--text-sm); font-weight: 600; transition: background .2s; }
.primary:hover { background: #497555; }
.right-page .reader-status { display: flex; align-items: baseline; gap: var(--space-2); margin-top: var(--space-6); font-size: var(--text-xs); }
.reader-status .status-dot { align-self: center; }
.page-footnote { position: relative; z-index: 3; font-family: var(--font-accent); font-style: italic; font-size: 16px; line-height: 1.6; color: var(--muted); }
.opening-cover { position: absolute; left: 50%; top: 0; bottom: 0; width: 50%; z-index: 8; padding: 0; transform-origin: left top; transform: rotateY(0deg); transform-style: preserve-3d; backface-visibility: visible; border-radius: 0 8px 8px 0; pointer-events: none; }
.cover-print { position: absolute; left: 0; top: 0; transform-origin: left top; transform-style: flat; backface-visibility: hidden; -webkit-backface-visibility: hidden; text-align: left; }
.cover-print .book-cover,.cover-print .book-pages { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.cover-print .book-cover { width: 100%; height: 100%; }
.cover-print .book-pages { inset: 4px -5px -2px 8px; }
.cover-inside { position: absolute; inset: 0; transform: rotateY(180deg) translateZ(1px); backface-visibility: hidden; -webkit-backface-visibility: hidden; background: linear-gradient(90deg,#f5f0de 0%,#faf7eb 86%,#ddd5bd 100%); border-radius: 8px 0 0 8px; box-shadow: inset -8px 0 16px #c9bea330; pointer-events: none; }
.popup-scene { position: relative; width: 330px; height: 330px; flex-shrink: 0; align-self: center; perspective: 700px; scale: 1.25; }
.popup-scene>div { transform: translateY(80px) scaleY(.1); transform-origin: center bottom; opacity: 0; }
.unfolded .popup-scene>div { transform: translateY(0) scaleY(1); opacity: 1; }
.popup-sun { position: absolute; width: 104px; height: 104px; border-radius: 50%; background: #e8b76d; right: 20px; top: 7px; box-shadow: 4px 4px 0 #a56f3e13; }
.popup-hill { position: absolute; bottom: 30px; width: 260px; height: 100px; background: #b6c9a1; border-radius: 80% 80% 0 0; box-shadow: 0 7px 8px #52604217; }
.hill-back { right: -10px; bottom: 46px; background: #d4dcb1; height: 145px; }
.popup-building { position: absolute; width: 140px; height: 165px; bottom: 54px; left: 68px; background: #416a52; box-shadow: 13px 8px 0 #274c38; display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; padding: 27px 20px; clip-path: polygon(0 0,100% 7%,100% 100%,0 92%); z-index: 2; }
.popup-building i { height: 29px; background: #ece6c4; box-shadow: inset 3px 3px 0 #e4cd94; }
.popup-tree { position: absolute; width: 70px; height: 150px; bottom: 50px; right: 30px; z-index: 3; border-left: 5px solid #ad7a51; transform-origin: left bottom !important; }
.popup-tree span { position: absolute; width: 76px; height: 100px; background: #8ca574; border-radius: 80% 20% 70% 30%; left: -38px; top: -20px; box-shadow: 5px 5px 0 #6a895a; }
.popup-tree span:last-child { width: 50px; height: 60px; top: 36px; left: -18px; background: #b1c28d; }
.hill-front { left: -40px; bottom: 10px; width: 280px; height: 56px; background: #a5b88a; z-index: 4; }
.popup-label { position: absolute; bottom: -20px; left: 5px; font-family: var(--font-accent); font-style: italic; font-size: 18px; color: var(--muted); z-index: 5; }
.extracted { visibility: hidden; }
#reader[data-phase="extracting"] .opened-book { transform: translateX(-25%); }
#reader[data-phase="extracting"] .left-page,#reader[data-phase="extracting"] .right-page { visibility: hidden; }
#reader[data-phase="open"] .opening-cover,#reader[data-phase="closing"] .opening-cover { visibility: hidden; }
#reader[data-phase="open"] .opened-book { box-shadow: 0 24px 65px rgba(25,40,30,.23); }
#reader[data-phase="opening"] .right-page,#reader[data-phase="extracting"] .right-page { pointer-events: none; }
.back-link { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: var(--text-sm); }
.contents-view h2 { font-size: clamp(40px,4vw,60px); margin: var(--space-4) 0 var(--space-6); }
.contents-view>p { margin-bottom: var(--space-6); }
.contents-view details { border-bottom: 1px solid var(--line); }
.contents-view summary { position: relative; cursor: pointer; list-style: none; display: block; padding: var(--space-6) var(--space-8) var(--space-6) 0; font-size: var(--text-sm); line-height: 1.6; font-weight: 700; }
.contents-view summary::-webkit-details-marker { display: none; }
.disclosure-icon { position: absolute; right: 0; top: 26px; width: 18px; height: 18px; transition: transform .2s var(--ease); }
details[open]>summary>.disclosure-icon { transform: rotate(180deg); }
.contents-view .chapter-details { margin: 0 0 var(--space-2) var(--space-3); border-bottom: 0; }
.contents-view .chapter-details>summary { padding-top: var(--space-3); padding-bottom: var(--space-3); font-weight: 600; }
.chapter-details .disclosure-icon { top: 14px; }
.contents-view .subsections { list-style: none; margin: 0 0 var(--space-4) var(--space-1); padding: 0 0 0 var(--space-4); border-left: 1px solid var(--line); }
.contents-view .subsections li { display: flex; gap: var(--space-3); padding: var(--space-2) 0; font-size: var(--text-sm); line-height: 1.7; color: var(--muted); }
.subsection-number { min-width: 36px; color: #7b866d; font-variant-numeric: tabular-nums; }

.motion-on #open-book:not(.extracted) { animation: shelf-invitation 5s ease-in-out infinite; }
.motion-on #open-book:hover,.motion-on #open-book:focus-visible { animation: none; transform: translateY(-18px) rotate(-2deg) rotateY(-12deg); }
.motion-on .wall-doodle { animation: curious-star 12s ease-in-out infinite; }
.motion-on .plant { animation: plant-sway 6s ease-in-out infinite; transform-origin: center bottom; }
.motion-on .caption-arrow { animation: invitation-arrow 2.8s ease-in-out infinite; }
@keyframes shelf-invitation { 0%,100% { transform: translateY(0) rotate(-6deg); } 45%,55% { transform: translateY(-9px) rotate(-3deg); } }
@keyframes curious-star { 0%,100% { transform: rotate(12deg) scale(1); } 50% { transform: rotate(42deg) scale(1.1); } }
@keyframes plant-sway { 0%,100% { rotate: -2deg; } 50% { rotate: 3deg; } }
@keyframes invitation-arrow { 0%,100% { translate: 0 0; } 50% { translate: -4px -5px; } }
html.no-motion { scroll-behavior: auto; }
.no-motion *,.no-motion *:before,.no-motion *:after { animation: none !important; transition: none !important; }
.no-motion .popup-scene>div { opacity: 1 !important; transform: translateY(0) scaleY(1) !important; }
.no-motion .opening-cover { display: none !important; }

@media (max-width: 1000px) {
  .header-note { display: none; }
  .intro { column-gap: var(--space-8); grid-template-columns: minmax(0,1fr) 260px; }
  .intro>p { font-size: var(--text-sm); }
  .shelf-content { padding-left: 2%; gap: var(--space-12); }
  .shelf-space p { font-size: 28px; }
  .plant { right: 0; scale: .85; transform-origin: bottom; }
  .format { column-gap: var(--space-12); }
  .popup-scene { scale: .85; }
  .left-page,.right-page { padding: var(--space-8); }
  .right-page h2 { font-size: 52px; }
}
@media (max-height: 800px) and (min-width: 701px) {
  .left-page,.right-page { padding: var(--space-8); }
  .right-page h2 { font-size: clamp(44px,4.5vw,64px); margin: var(--space-6) 0; }
  .popup-scene { scale: .9; }
}
@media (max-width: 700px) {
  :root { --gutter: 24px; }
  .header { padding-top: var(--space-6); padding-bottom: var(--space-6); gap: var(--space-3); }
  .brand { font-size: 22px; gap: var(--space-2); }
  .brand-icon { width: 28px; height: 28px; }
  .motion-control { padding: 10px var(--space-3); }
  .library { padding-top: var(--space-8); }
  .intro { display: block; }
  .intro>.eyebrow { font-size: 10px; margin-bottom: var(--space-6); }
  h1 { font-size: clamp(44px,8vw,60px); }
  .hero-accent>svg { bottom: -16px; }
  .intro>p { max-width: 380px; margin-top: var(--space-8); font-size: var(--text-sm); }
  .intro>p br { display: none; }
  .shelf-stage { margin-top: var(--space-12); padding: var(--space-16) 0 0; }
  .wall-label { font-size: 10px; }
  .wall-doodle { width: 32px; height: 32px; right: 9%; top: 48px; }
  .shelf-content { height: 304px; padding-left: 6%; gap: var(--space-8); }
  .shelf-book { width: 188px; height: 268px; }
  .book-cover { padding: 20px 16px 16px 24px; }
  .cover-title { font-size: 21px; margin-top: var(--space-3); }
  .cover-art { height: 100px; }
  .cover-top,.cover-bottom { font-size: 6px; }
  .book-badge { font-size: 8px; top: -28px; }
  .book-caption { font-size: 14px; gap: var(--space-1); }
  .book-caption .icon { width: 20px; height: 20px; }
  .shelf-space { align-self: flex-end; margin: 0 0 48px; }
  .shelf-space p { font-size: 23px; }
  .shelf-space .shelf-note-arrow { width: 28px; height: 28px; }
  .shelf-space>span,.plant { display: none; }
  .wood-shelf { margin: 0; }
  .shelf-shadow { margin: 0; }
  .library-bottom { padding: var(--space-6) 0 var(--space-12); gap: var(--space-3); align-items: flex-start; }
  .edition { max-width: 145px; font-size: 10px; line-height: 1.8; }
  .library-bottom a { min-height: 36px; font-size: var(--text-xs); gap: var(--space-2); }
  .format { display: block; padding-top: var(--space-12); padding-bottom: var(--space-16); }
  .format h2 { font-size: 42px; }
  .format>div>p { max-width: 440px; font-size: var(--text-sm); }
  .format-details { margin-top: var(--space-12); }
  .format-details article { gap: var(--space-4); }
  footer { flex-direction: column; gap: var(--space-2); padding-top: var(--space-6); padding-bottom: var(--space-6); }
  .reader-toolbar { height: 72px; padding: var(--space-3) var(--space-4); }
  .reader-brand { font-size: 10px; letter-spacing: .08em; }
  .close-button { font-size: var(--text-xs); gap: var(--space-2); padding: 10px var(--space-3); }
  .opened-book { display: block; width: calc(100% - 28px); height: calc(100dvh - 96px); }
  .left-page { display: none; }
  .right-page { padding: var(--space-8) var(--space-6); border-radius: 8px; background: linear-gradient(90deg,#e5decb,#faf7eb 3%); }
  .right-page .eyebrow { font-size: 10px; }
  .right-page h2 { font-size: clamp(44px,11vw,64px); margin-top: var(--space-8); }
  .right-page .reader-lead { font-size: var(--text-lead); }
  .primary { width: 100%; padding: var(--space-4); gap: var(--space-3); }
  .opening-cover { left: 0; width: 100%; height: 100%; }
  #reader[data-phase="extracting"] .opened-book { transform: none; }
  .contents-view h2 { font-size: 44px; margin-top: var(--space-4); }
  .contents-view .chapter-details { margin-left: var(--space-2); }
  .contents-view .subsections { padding-left: var(--space-3); }
}
@media (max-width: 400px) {
  :root { --gutter: 20px; }
  .brand { font-size: 20px; }
  .brand-icon { width: 24px; height: 24px; }
  .motion-control { font-size: 10px; gap: 6px; padding: 10px; }
  .shelf-content { gap: var(--space-6); padding-left: 4%; }
  .shelf-book { width: 168px; height: 244px; }
  .book-cover { padding: 16px 12px 14px 20px; }
  .cover-title { font-size: 19px; }
  .cover-art { height: 90px; }
  .shelf-space p { font-size: 18px; }
  .book-caption { font-size: 13px; }
  .edition { max-width: 128px; }
  .library-bottom a { gap: var(--space-1); font-size: 11px; }
  .reader-brand { font-size: 9px; }
  .right-page { padding: var(--space-6) 20px; }
  .right-page h2 { font-size: 42px; }
}
@media (max-width: 350px) {
  .shelf-content { gap: var(--space-3); padding-left: 0; }
  .shelf-space p { font-size: 18px; }
  h1 { font-size: 42px; }
  .format h2 { font-size: 36px; }
  .reader-brand { max-width: 110px; }
  .primary { font-size: 12px; }
}

/* CHAPTER_READER_STYLES */
/* Reading pages share the paper and gutter of the existing book. */
dialog#reader { position:fixed;inset:0; }
.start-chapter { display:flex;align-items:center;gap:12px;min-height:44px;background:transparent;border:0;padding:12px 0;color:var(--green);font-size:14px; }
.contents-view .section-read-link { display:flex;gap:12px;text-align:left;padding:4px 0;min-height:44px;background:transparent;border:0;line-height:1.7;font-size:14px;color:var(--green);width:100%; }
.section-read-link:hover { color:var(--orange); }
.chapter-view { grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;height:100%;min-height:0;position:relative; }
.chapter-left,.chapter-right { min-width:0;min-height:0;height:100%;display:flex;flex-direction:column; }
.chapter-left { padding:20px clamp(24px,3.3vw,54px) 0;background:linear-gradient(90deg,#f5f0de,#faf7eb 85%,#d5ceba);border-radius:8px 0 0 8px; }
.chapter-right { padding:0 clamp(20px,2.6vw,44px);background:linear-gradient(90deg,#e5decb,#faf7eb 5%);border-radius:0 8px 8px 0; }
.chapter-player { display:flex;align-items:center;gap:8px;min-height:44px;margin-bottom:8px;flex-shrink:0;color:var(--muted);font-size:12px; }
.chapter-play { border:1px solid #b8bea6;display:grid;place-items:center;width:30px;height:30px;padding:6px;border-radius:50%;background:#f2efdf;flex-shrink:0; }
.chapter-play .icon { width:14px;height:14px; }
.chapter-play[aria-pressed=true] { color:var(--page);background:var(--ink);border-color:var(--ink); }
.chapter-play:hover:not(:disabled) { background:#e1e6cd;color:var(--ink); }
.chapter-play:disabled { opacity:.45;cursor:default; }
.chapter-time { margin-left:auto;font-size:11px;white-space:nowrap;font-variant-numeric:tabular-nums; }
.chapter-audio-error { font-size:12px;color:var(--orange);line-height:1.5;margin-bottom:8px; }
.chapter-text-window { flex:1;min-height:0;position:relative; }
.chapter-scroll { height:100%;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#a4ae93 transparent;padding:0 12px 52px 0; }
.chapter-eyebrow { font-size:10px;letter-spacing:1px;text-transform:uppercase;line-height:1.6;color:var(--muted); }
#chapter-title { font-size:clamp(25px,2.25vw,36px);line-height:1.22;letter-spacing:-.8px;font-weight:500;margin:14px 0 16px; }
#chapter-title em { font-family:var(--font-accent);font-weight:400;color:var(--orange); }
.chapter-hint { font-size:12px;line-height:1.6;color:var(--muted);margin-bottom:20px; }
.chapter-paragraph { margin:0 0 10px; }
.chapter-fragment { display:block;width:100%;padding:9px 9px 9px 11px;border:0;border-left:2px solid transparent;border-radius:0 5px 5px 0;background:transparent;text-align:left;font-size:15px;line-height:1.72;font-weight:400;user-select:text;transition:background .25s; }
.chapter-fragment:hover { background:#e8eadc88; }
.chapter-fragment[aria-pressed=true] { background:#e4e9d3a8;border-left-color:var(--orange); }
.chapter-speaking,.chapter-speaking-title { background:#d4dfb488;text-decoration:underline;text-decoration-color:#c85b3370;text-decoration-thickness:2px;text-underline-offset:4px; }
.chapter-text-fade { height:56px;position:absolute;bottom:-1px;left:0;right:12px;background:linear-gradient(transparent,#faf7ebe6 64%,#faf7eb);pointer-events:none; }
.chapter-end { font-family:var(--font-accent);font-style:italic;color:var(--muted);font-size:15px;padding:20px 12px; }
.chapter-page-footer { display:flex;align-items:center;justify-content:space-between;gap:12px;height:64px;flex-shrink:0;border-top:1px solid #d8d2bd88;color:var(--muted);font-size:11px; }
.chapter-page-arrow { display:flex;align-items:center;gap:12px;min-height:44px;padding:8px 0;border:0;background:transparent;font-size:13px;line-height:1.4;text-align:left; }
.chapter-page-arrow span[aria-hidden] { font-size:24px;color:var(--ink); }
.chapter-page-arrow:hover:not(:disabled) { color:var(--orange); }
.chapter-page-arrow:disabled { opacity:.55;cursor:default; }
#chapter-scene-name { font-family:var(--font-accent);font-style:italic;font-size:14px;line-height:1.4;max-width:52%; }
.chapter-scene-stage { position:relative;flex:1;min-height:0; }
#chapter-scene { display:block;position:absolute;inset:0;width:100%;height:100%; }
.reading .opening-cover { display:none; }
@media(max-width:700px) {
  .chapter-view { grid-template-columns:1fr;grid-template-rows:minmax(0,1.05fr) minmax(0,1fr); }
  .chapter-left { padding:10px 20px 0;border-radius:8px 8px 0 0;background:linear-gradient(90deg,#f5f0de,#faf7eb 85%,#e8e0c9); }
  .chapter-right { padding:0 20px;border-top:1px solid #ded7c2;border-radius:0 0 8px 8px; }
  .chapter-player { margin-bottom:4px; }
  .chapter-play { width:36px;height:36px;position:relative; }
  .chapter-play:before { content:'';position:absolute;inset:-4px; }
  #chapter-title { font-size:25px; }
  .chapter-page-footer { height:48px;gap:8px; }
  .chapter-page-arrow { font-size:12px;gap:8px; }
  .chapter-hint { font-size:11px;margin-bottom:14px; }
  #chapter-scene-name { font-size:12px; }
}
@media(max-height:600px) and (min-width:701px) { .chapter-left { padding-top:8px; } .chapter-page-footer { height:48px; } }

/* Keep the original book spread while its media is temporarily unavailable. */
.chapter-view--text-only .chapter-hint,
.chapter-view--text-only #chapter-scene,
.chapter-view--text-only #chapter-scene-name { display:none; }
.chapter-view--text-only .chapter-paragraph { padding:9px 9px 9px 11px;font-size:15px;line-height:1.72;user-select:text; }
