:root{color-scheme:light;--paper:#f7f5ee;--card:#fffef9;--ink:#34463d;--muted:#778179;--line:#e2e5da;--green:#456552;--soft:#e9eee3;--room-width:100vw;--room-height:100dvh;font-family:ui-sans-serif,-apple-system,BlinkMacSystemFont,"Apple SD Gothic Neo","Noto Sans KR",sans-serif;color:var(--ink);background:var(--paper);font-synthesis:none}
*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit;color:inherit}button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}button{cursor:pointer;border:0;background:transparent;touch-action:manipulation}button:disabled{cursor:default;opacity:.38}button,a,select{transition:background .18s,color .18s,box-shadow .18s}button:hover:not(:disabled){background:var(--soft)}button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible,textarea:focus-visible,summary:focus-visible{outline:2px solid #668665;outline-offset:4px}svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}a{color:var(--green);text-underline-offset:5px}[hidden]{display:none!important}.symbol-library{position:absolute;width:0;height:0;overflow:hidden}h1,h2,p,figure{margin:0}.eyebrow{display:block;color:var(--muted);font-size:11px;letter-spacing:.09em}.masthead{max-width:1360px;margin:auto;padding:22px 42px 18px;display:flex;align-items:center;justify-content:space-between;gap:20px}.brand{display:flex;align-items:center;gap:14px}.brand-mark{width:46px;height:50px;display:grid;place-items:center;border-radius:16px;color:#8c7551}.brand-mark svg{width:32px;height:32px;stroke-width:1.3}h1{font-family:ui-serif,Georgia,"Nanum Myeongjo","AppleMyungjo",serif;font-size:26px;font-weight:500;letter-spacing:-.035em;margin-top:5px}.settings-button{display:flex;align-items:center;gap:14px;border:1px solid var(--line);border-radius:30px;min-height:44px;padding:9px 16px;font-size:12px;letter-spacing:.05em}.divider{height:15px;width:1px;background:var(--line)}.reading-room{max-width:1400px;margin:auto;padding:0 42px}.book-stage{display:flex;align-items:center;justify-content:center}.book{display:flex;width:min(100%,1120px,calc((100dvh - 340px)*2));position:relative;aspect-ratio:2/1;background:#fffefb;perspective:2200px;isolation:isolate;overflow:hidden;box-shadow:0 15px 45px -26px #40554461,0 1px 4px #40554410;border-radius:3px}.book figure{position:relative;width:50%;aspect-ratio:1;background:#fffefb;flex-shrink:0}.book img{display:block;width:100%;height:100%;object-fit:contain;user-select:none;-webkit-user-drag:none}.book figure small{position:absolute;bottom:9px;left:50%;transform:translateX(-50%);font-size:9px;color:#586253a6;background:#fff9;padding:2px 6px;border-radius:10px}.book:after{content:"";position:absolute;top:0;bottom:0;left:calc(50% - 11px);width:22px;background:linear-gradient(90deg,transparent,#2842350e 45%,#28423519 50%,transparent);pointer-events:none;z-index:7}.book figure.reading:after{content:"";position:absolute;bottom:0;left:25%;width:50%;height:2px;background:#76977599}.turn-layer{position:absolute;top:0;height:100%;width:50%;pointer-events:none}.turn-fixed{z-index:3;background:#fff}.turn-fixed.on-left{left:0}.turn-fixed.on-right{right:0}.turn-sheet{z-index:5;transform-style:preserve-3d}.turn-sheet.forward{left:50%;transform-origin:left center}.turn-sheet.backward{left:0;transform-origin:right center}.turn-face{position:absolute;inset:0;backface-visibility:hidden;-webkit-backface-visibility:hidden;background:#fff;overflow:hidden}.turn-face.back{transform:rotateY(180deg)}.turn-face:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,#3345320c,transparent 15%,transparent 80%,#3345320a)}.page-hit{position:absolute;top:0;bottom:0;z-index:9;border-radius:0;padding:0}.page-hit:hover:not(:disabled){background:transparent}.hit-left{left:0;width:35%}.hit-center{left:35%;width:30%}.hit-right{right:0;width:35%}.page-hit span{position:absolute;bottom:25px;left:50%;transform:translateX(-50%);white-space:nowrap;font-size:11px;background:#fffdf5e8;padding:7px 12px;border-radius:25px;opacity:0}.page-hit:focus-visible{outline-offset:-5px}.page-hit:focus-visible span{opacity:1}.caption-box{min-height:99px;padding:18px 20px 10px;text-align:center;max-width:1000px;margin:auto}.reading-meta{display:flex;justify-content:center;gap:14px;min-height:16px;font-size:10px;letter-spacing:.06em;color:var(--muted)}#speaker{color:var(--green)}#caption{font-size:clamp(22px,2.2vw,31px);line-height:1.55;font-weight:450;letter-spacing:-.035em;word-break:keep-all;margin-top:4px}.reader-chrome{max-width:760px;margin:0 auto}.reader-dock{display:flex;align-items:center;justify-content:center;gap:14px;padding:7px 12px;border:1px solid var(--line);background:#fffdf8d9;box-shadow:0 4px 18px #31493b04;border-radius:60px;width:max-content;max-width:100%;margin:auto}.dock-action{display:flex;align-items:center;gap:7px;padding:10px 12px;font-size:12px;border-radius:30px;min-height:44px;white-space:nowrap}.dock-action[aria-pressed=true]{background:var(--soft);color:#355c40}.dock-action svg{width:18px;height:18px}.playback-group{display:flex;align-items:center;gap:4px}.icon-button{display:grid;place-items:center;width:44px;height:44px;flex-shrink:0;border-radius:50%}.primary{background:var(--green);color:#fffdf5;border-radius:25px;padding:13px 22px;font-size:13px;min-height:44px;white-space:nowrap}.primary:hover:not(:disabled){background:#35533f}#play{min-width:126px}.reading-footnote{display:flex;justify-content:center;gap:18px;margin-top:14px;font-size:10px;letter-spacing:.04em;color:#899087}.tap-hint:before{content:"·";margin-right:18px}.reader-status{font-size:11px;line-height:1.6;color:var(--muted);text-align:center;min-height:25px;margin:14px auto 0;max-width:720px}.colophon{display:flex;align-items:center;justify-content:center;gap:7px;margin:16px 0 15px;color:#989d8f;font-size:10px;letter-spacing:.025em}.colophon svg{width:14px;height:14px}.is-quiet .caption-box{min-height:56px;padding:8px}.is-quiet .reading-meta,.is-quiet #caption{display:none}
/* Reading preferences and the quiet invitation at the end. */
dialog{color:var(--ink);background:var(--card);border:1px solid #fff9;border-radius:26px;padding:30px;width:min(480px,calc(100vw - 32px));max-height:calc(100dvh - 40px);box-shadow:0 28px 100px #233f3330,0 4px 18px #233f3310;overscroll-behavior:contain}dialog[open]{animation:dialog-in .5s cubic-bezier(.2,.7,.3,1)}dialog::backdrop{background:#293e333d;backdrop-filter:blur(5px);animation:shade-in .5s ease}.dialog-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:28px}h2{font-family:ui-serif,Georgia,"AppleMyungjo",serif;font-size:26px;font-weight:500;letter-spacing:-.04em;margin-top:8px}.dialog-heading .icon-button{background:var(--paper)}.setting-block{margin:22px 0}.setting-block label,.field-label{display:block;font-size:13px;font-weight:500;margin-bottom:10px}.setting-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.setting-row label{margin:0}.setting-row #language{flex:1;min-width:0}select,input,textarea{background:#f5f5ee;border:1px solid var(--line);border-radius:12px;padding:12px 14px;max-width:100%;font-size:13px;min-height:44px}select{cursor:pointer}textarea{resize:vertical}.fine-print{color:var(--muted);font-size:11px;line-height:1.75;margin-top:10px}.subtle-button{background:var(--soft);border-radius:12px;padding:12px 16px;font-size:12px;min-height:44px}.mode-options{display:grid;grid-template-columns:1fr 1fr;gap:9px}.mode-options button{border:1px solid var(--line);border-radius:13px;padding:14px 8px;display:flex;align-items:center;justify-content:center;gap:9px;font-size:12px}.mode-options button[aria-pressed=true]{background:var(--soft);border-color:#a5b49d}.mode-options svg{width:18px;height:18px}input[type=range]{width:100%;min-height:30px;padding:0;accent-color:var(--green)}#jump-label{float:right;font-size:11px;color:var(--muted)}summary{font-size:13px;cursor:pointer;padding:16px 0;min-height:44px}.settings-details{border-top:1px solid var(--line);border-bottom:1px solid var(--line)}#text{white-space:pre-wrap;font-size:15px;line-height:1.9;padding:0 0 18px}.name-note{padding:24px 0 20px}.name-pair{display:grid;grid-template-columns:1fr 1fr;margin:15px 0}.name-pair strong{font-family:Georgia,serif;font-size:20px;font-weight:normal}.name-pair strong span{font-family:ui-sans-serif,sans-serif;color:var(--muted);font-size:11px;margin-left:5px}.name-pair em{display:block;font-family:Georgia,serif;font-style:italic;font-size:16px;color:#92977e;margin-top:4px}.name-note>p{font-family:Georgia,serif;font-size:12px;line-height:1.7;color:var(--muted)}.recording-note{border-top:1px solid var(--line);padding:20px 0 5px}.recording-note a{font-size:12px}.text-button{padding:12px 0;min-height:44px;font-size:12px;color:var(--green);text-align:left}.text-button:hover:not(:disabled){background:none;text-decoration:underline;text-underline-offset:5px}.ending-dialog{width:min(450px,calc(100vw - 32px));text-align:center;padding:32px}.end-close{position:absolute;right:12px;top:12px}.ending-acorn{display:block;width:42px;height:42px;margin:6px auto 20px;color:#95835f;stroke-width:1.1}.ending-intro h2{font-size:25px;margin:13px 0}.ending-intro>p{color:var(--muted);font-size:13px;line-height:1.85}.support-card{border:1px solid var(--line);border-radius:18px;margin:26px 0 10px;padding:20px 16px 15px}.support-card>.field-label{color:var(--muted);font-size:11px}.support-stepper{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:8px 0 20px}.support-stepper button{padding:8px;border-radius:10px;min-height:44px;font-size:18px}.support-stepper button span{font-size:11px}.support-stepper strong{font-size:25px;font-weight:450;font-variant-numeric:tabular-nums;letter-spacing:-.03em}.support-submit{width:100%;background:var(--soft);border-radius:12px;padding:13px;font-size:12px}.support-submit:disabled{opacity:1;color:#899383}.support-card .fine-print{font-size:10px}.comment-card{text-align:left;border-bottom:1px solid var(--line)}.comment-card summary{font-size:12px}.comment-card label{display:block;font-size:11px;margin:12px 0 7px}.comment-card label span{color:var(--muted)}.comment-card input,.comment-card textarea{width:100%}.comment-form-footer{display:flex;align-items:center;justify-content:space-between;margin-top:8px}.comment-form-footer span{font-size:10px;color:var(--muted)}.comment-form-footer .primary{font-size:12px}.comment-item{padding:14px 0;border-top:1px solid var(--line);font-size:12px}.comment-meta{display:flex;justify-content:space-between;font-size:10px;margin-bottom:8px}.comment-meta time{color:var(--muted)}.comment-item p{white-space:pre-wrap;word-break:break-word;line-height:1.7}.comment-delete{font-size:10px;min-height:32px;padding:6px 0;color:var(--muted)}.comment-empty{font-size:11px;color:var(--muted);padding:15px 0}.ending-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px}.enjoy-ending{background:none;color:var(--muted);font-size:11px;margin-top:6px}.share-dialog{position:relative}.share-dialog h2{font-size:24px;margin:15px 0}.share-dialog>p{font-size:13px;line-height:1.7;color:var(--muted)}.share-dialog-close{float:right;padding:9px 13px;background:var(--soft);border-radius:20px;font-size:11px;min-height:36px}.share-dialog-actions{display:grid;gap:10px;margin:24px 0}.share-dialog-actions button,.share-dialog-actions a{display:block;text-align:center;border:1px solid var(--line);border-radius:13px;padding:14px;font-size:13px;text-decoration:none}.share-dialog-actions .share-primary{background:var(--green);color:white}.share-note{font-size:11px!important}
/* Full-bleed landscape also works when the browser cannot lock orientation. */
body.immersive-active{overflow:hidden;overscroll-behavior:none}#reader-app.immersive{position:fixed;inset:0;z-index:30;width:100%;height:100%;background:#eaf0e9;overflow:hidden;--paper:#eaf0e9}.immersive .masthead,.immersive .caption-box,.immersive .colophon,.immersive .reader-status{display:none}.immersive .reading-room{padding:0;max-width:none;width:100%;height:100%}.immersive .book-stage{height:100%;width:100%}.immersive .book{width:min(var(--room-width),calc(var(--room-height)*2));height:min(calc(var(--room-width)/2),var(--room-height));max-width:none;flex-shrink:0;box-shadow:none;border-radius:0}.immersive .book figure small,.immersive .book figure.reading:after{display:none}.immersive .reader-chrome{position:absolute;bottom:max(12px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 24px);z-index:15;transition:opacity .35s,translate .35s}.immersive .reader-dock{background:#fffdf3eb;backdrop-filter:blur(14px);box-shadow:0 8px 28px #1d3d3320}.immersive .reading-footnote{margin-top:8px;color:#465444;background:#fffdf3bd;width:max-content;max-width:100%;padding:4px 10px;border-radius:20px;margin-inline:auto}.immersive-exit{position:absolute;right:max(14px,env(safe-area-inset-right));top:max(12px,env(safe-area-inset-top));background:#fffdf3e6;z-index:16;transition:opacity .35s}.immersive.controls-hidden .reader-chrome,.immersive.controls-hidden .immersive-exit{opacity:0;pointer-events:none}.immersive.controls-hidden .reader-chrome{translate:0 8px}.immersive-hint{position:absolute;top:24px;left:50%;transform:translateX(-50%);z-index:14;background:#fffdf3ec;border-radius:40px;padding:12px 20px;color:#4a614e;font-size:12px;white-space:nowrap;pointer-events:none;animation:shade-in .4s}#reader-app.immersive.is-rotated{inset:auto;left:50%;top:50%;width:100dvh!important;height:100dvw!important;transform:translate(-50%,-50%) rotate(90deg)}.immersive.is-rotated dialog[open]{position:fixed;inset:auto;left:50%;top:50%;margin:0;transform:translate(-50%,-50%) rotate(90deg);width:min(480px,calc(100dvh - 32px));max-height:calc(100dvw - 24px);animation:shade-in .5s}
@keyframes dialog-in{from{opacity:0;translate:0 12px;box-shadow:0 8px 20px #233f3300}to{opacity:1;translate:0 0}}@keyframes shade-in{from{opacity:0}to{opacity:1}}
@media(max-width:760px){.masthead{padding:22px 20px 18px}.reading-room{padding:0 16px}.brand{gap:8px}.brand-mark{width:36px}.brand-mark svg{width:29px;height:29px}.eyebrow{font-size:9px}.brand h1{font-size:22px}.settings-button{gap:10px;padding:8px 12px}.book{width:100%}.caption-box{min-height:115px;padding:20px 5px 13px}#caption{font-size:23px}.reader-dock{gap:3px;padding:5px 7px}.dock-action{padding:9px;gap:5px}.dock-action>span{display:none}.dock-action{width:42px;justify-content:center}.reader-dock .icon-button{width:34px}.playback-group{gap:0}.primary{padding:12px 15px}#play{min-width:113px;font-size:12px}.reader-status{max-width:340px;font-size:10px;padding:0 12px}.reading-footnote{font-size:9px;gap:10px}.tap-hint:before{margin-right:10px}.colophon{font-size:9px;margin-top:25px}.is-quiet .caption-box{min-height:28px}.immersive .reader-dock{gap:8px}.immersive .dock-action{width:auto}.immersive .dock-action>span{display:inline}.immersive .reader-status{display:none}dialog{padding:25px}.ending-dialog{padding:28px 24px}}
@media(max-height:500px) and (orientation:landscape){.masthead{padding:12px 25px}.masthead .eyebrow{display:none}.brand h1{font-size:20px;margin:0}.brand-mark{height:34px}.book{width:min(100%,calc((100dvh - 160px)*2))}.caption-box{min-height:46px;padding:5px 0}.reading-meta{font-size:9px;min-height:10px}#caption{font-size:19px;line-height:1.4;margin:0}.reader-dock{padding:3px 6px;gap:8px}.reading-footnote{margin-top:5px}.reader-status,.colophon{display:none}.immersive .book{width:min(var(--room-width),calc(var(--room-height)*2))}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}

.reader-status:not(.has-error){position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;padding:0;margin:0;min-height:0}

@media(max-width:760px){.dock-action{flex-direction:column;gap:4px;padding:8px 5px;width:44px;min-height:48px}.dock-action>span{display:block;font-size:8px;letter-spacing:-.03em}.dock-action svg{width:17px;height:17px}.immersive .dock-action{flex-direction:row;padding:9px}.immersive .dock-action>span{font-size:11px}}
html:fullscreen{background:var(--paper);overflow:hidden}

/* v17: fit the measured mobile viewport, with no desktop size cap or nested percentage shrink. */
#reader-app.immersive{inset:auto;left:0;top:0;width:var(--room-width);height:var(--room-height)}
#reader-app.immersive .reading-room,#reader-app.immersive .book-stage{width:100%;height:100%;max-width:none;padding:0;margin:0}
#reader-app.immersive .book{width:var(--book-width);height:var(--book-height);min-width:var(--book-width);max-width:none;max-height:none;margin:0;flex:none}
#reader-app.immersive .book figure{width:50%;height:100%;aspect-ratio:auto}
#reader-app.immersive.is-rotated{width:var(--room-width)!important;height:var(--room-height)!important;left:50%;top:50%}
.immersive-only{display:none}.immersive .immersive-only{display:flex}
.immersive .reader-dock{gap:4px}.immersive .dock-action{flex-direction:column;padding:7px 8px;gap:3px;width:auto;min-width:43px}.immersive .dock-action>span{display:block;font-size:9px}
.immersive .reader-chrome{max-width:calc(100% - 16px);bottom:max(8px,env(safe-area-inset-bottom))}.immersive .reading-footnote{margin-top:4px}
#scene-sound{appearance:auto;accent-color:var(--green);width:22px;min-height:22px;margin:0 4px}
.install-reading{border:1px solid var(--line);border-radius:14px;padding:0 14px;font-size:12px;line-height:1.8}.install-reading p{margin:0 0 12px}.install-reading summary{font-size:12px}
.sound-credit-link{display:block;font-size:11px;margin-top:15px;color:var(--muted)}
/* A quiet reading surface, with one small, transient control dock. */
#reader-app:not(.immersive):not(.study-mode){min-height:100dvh;position:relative;padding:64px 0 100px}
#reader-app:not(.immersive):not(.study-mode) .masthead{position:absolute;inset:10px auto auto 24px;padding:0;z-index:15}
#reader-app:not(.immersive):not(.study-mode) .brand{gap:6px}
#reader-app:not(.immersive):not(.study-mode) .brand .eyebrow{display:none}
#reader-app:not(.immersive):not(.study-mode) .brand h1{font-size:17px;margin:0;color:#66766a}
#reader-app:not(.immersive):not(.study-mode) .brand-mark{width:36px;height:40px}
#reader-app:not(.immersive):not(.study-mode) .brand-mark svg{width:25px;height:25px}
#reader-app:not(.immersive):not(.study-mode) .reading-room{padding:0 24px;max-width:1480px}
#reader-app:not(.immersive):not(.study-mode) .book{width:min(100%,1240px,calc((100dvh - 265px)*2));min-width:260px}
#reader-app:not(.immersive):not(.study-mode).is-quiet .book{width:min(100%,1240px,calc((100dvh - 164px)*2))}
#reader-app:not(.immersive):not(.study-mode) .reader-chrome{position:fixed;bottom:max(20px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);z-index:15;width:max-content;max-width:calc(100% - 24px)}
.reader-chrome,.masthead,.immersive-exit{transition:opacity .45s ease,translate .45s ease}
.controls-hidden .reader-chrome,.controls-hidden .masthead,.controls-hidden .immersive-exit{opacity:0;pointer-events:none}
.controls-hidden .reader-chrome{translate:0 6px}
.reader-dock{gap:8px;padding:6px 8px;background:#fffdf6e8;backdrop-filter:blur(12px);box-shadow:0 6px 24px #31493b0c}
.reader-dock #open-settings{border-left:1px solid var(--line);border-radius:0 24px 24px 0;width:48px}
.reading-footnote{margin-top:8px;font-size:10px}
.colophon{display:none}
.complete-reading{min-height:44px;padding:10px 14px;white-space:nowrap;background:var(--soft);border-radius:24px;font-size:12px}
#reader-app #play{display:grid;place-items:center;min-width:48px;width:48px;min-height:44px;padding:8px;font-size:19px;line-height:1}
.setting-shortcuts{display:flex;gap:8px;margin:20px 0}
.setting-shortcuts .dock-action{flex:1;flex-direction:row;justify-content:center;width:auto;border:1px solid var(--line);border-radius:14px;gap:8px;font-size:12px}
.setting-shortcuts .dock-action>span{display:inline;font-size:12px}
.language-badge{font-size:10px;color:var(--muted);margin-left:8px;font-weight:400;letter-spacing:.06em}
.reader-dialog.ending-dialog{background:rgba(255,254,249,.84);backdrop-filter:blur(10px);border-color:#ffffffb3;box-shadow:0 20px 90px #203b3324}
#reader-app .ending-dialog[open]{animation:shade-in 1.25s ease-out both;translate:none}
.ending-dialog::backdrop{background:rgba(47,64,54,.16);backdrop-filter:blur(3px);animation:shade-in 1.25s ease-out both}
.ending-dialog .end-close{position:sticky;top:-16px;display:grid;margin:-16px -12px -28px auto;background:#fffdf4e6;z-index:2}
.ending-dialog .ending-intro{padding-top:6px}
.ending-dialog .enjoy-ending{width:100%;margin:18px 0 8px;padding:13px 18px;min-height:46px;border:1px solid #cdd9c7;color:#415c49;background:#edf2e6c9;font-size:13px;border-radius:16px}
.ending-dialog .support-card{background:#fffdf270}
@media(max-width:760px){#reader-app:not(.immersive):not(.study-mode){padding-top:64px}#reader-app:not(.immersive):not(.study-mode) .reading-room{padding:0 12px}#reader-app:not(.immersive):not(.study-mode) .masthead{left:14px}.tap-hint{display:none}}
@media(max-height:500px) and (orientation:landscape){#reader-app:not(.immersive):not(.study-mode){padding-top:48px}#reader-app:not(.immersive):not(.study-mode) .book{width:min(100%,calc((100dvh - 180px)*2))}.reader-chrome{bottom:10px}}
@media(prefers-reduced-motion:reduce){#reader-app .ending-dialog[open],.ending-dialog::backdrop{animation:none!important}}
@media(pointer:coarse){.immersive .reader-dock{padding:4px 6px}.immersive .reader-dock .primary{min-width:106px}.immersive .reader-dock .icon-button{width:32px}.immersive .reader-dock .dock-action{min-width:42px;padding-inline:6px}}

#reader-app:not(.immersive):not(.study-mode) .book-stage{min-height:max(0px,calc(100dvh - 265px))}
#reader-app:not(.immersive):not(.study-mode).is-quiet .book-stage{min-height:max(0px,calc(100dvh - 164px))}

/* The same selected acorns appear in the ending and settings. */
.acorn-gift{text-align:center;padding:23px 20px 18px}
.settings-gift{margin:16px 0 0;background:#f3f1e6;border-color:#e2dfcc}
.gift-heading{font-family:ui-serif,Georgia,"AppleMyungjo",serif;font-size:23px;font-weight:500;letter-spacing:-.035em;line-height:1.5;margin:0 0 12px}
.gift-unit{font-size:11px;color:var(--muted);letter-spacing:.025em}
.gift-selection{padding:20px 0 18px}
.gift-count{display:flex;align-items:center;justify-content:center;gap:10px;color:#796440}
.gift-count svg{width:34px;height:36px;stroke-width:1.35;fill:#e8ddbb55}
.gift-count strong{font-size:24px;font-weight:500;letter-spacing:-.04em;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.gift-amount{font-size:11px;color:var(--muted);margin-top:9px}
.gift-amount span{font-size:14px;font-weight:500;color:var(--ink);margin-left:7px;font-variant-numeric:tabular-nums}
.gift-stepper{display:grid;grid-template-columns:1fr 1.35fr;gap:10px;margin:0 0 12px}
.gift-stepper button{background:#ffffff80;border:1px solid var(--line);font-size:17px;min-height:46px}
.gift-stepper [data-support-plus]{background:#e5ecdd;border-color:#d2ddc8;color:#415c49}
.gift-stepper button span{font-size:12px}
.gift-stepper button:hover:not(:disabled){background:#dce6d2}
.acorn-gift .support-submit{font-size:11px;background:transparent;border:1px dashed var(--line);padding:11px}

.bedtime-listen{display:block;width:fit-content;max-width:100%;margin:10px auto 0;padding:8px 14px;border-radius:20px;color:#405441;background:#e0e8d8;font-size:13px;text-decoration:none;text-align:center}.bedtime-listen:focus-visible{outline:3px solid #6b8055;outline-offset:3px}
/* Korean study is the primary learning entry. */
.mode-options #experience-study{display:block;grid-column:1 / -1;min-height:112px;font-size:22px;background:#e7eddf;border-color:#b7c8ad;line-height:1.5}
.mode-options #experience-study[aria-pressed="true"]{background:#d4e2c9;border-color:#6e8962}
.mode-options .mode-hint{display:block;font-size:12px;font-weight:400;color:var(--muted);margin-top:8px}
.mode-options #experience-other{font-size:14px;line-height:1.6}
@media(max-width:540px){.study-top h2{font-size:19px}.mode-options #experience-study{min-height:104px}}
/* Reading index — literary hierarchy, one continuous scrolling surface. */
#settings-dialog{width:min(560px,calc(100vw - 28px));padding:0 32px 28px;border-radius:12px;border:1px solid #e4e0d5;background:#faf8f1;max-height:calc(100dvh - 32px);overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;overscroll-behavior:contain}
#settings-dialog .dialog-heading{position:sticky;top:0;z-index:2;background:#faf8f1;margin:0;padding:24px 0 20px;align-items:flex-start;border-bottom:1px solid #deded2}
#settings-dialog .dialog-heading h2{font-size:27px;line-height:1.4;margin-top:8px}#settings-dialog .eyebrow{font-size:10px;letter-spacing:.12em;color:#64705e}#settings-dialog .dialog-heading .icon-button{background:none}
.reading-choice{border-bottom:1px solid #deded2}.intent-row{width:100%;display:grid;grid-template-columns:26px minmax(0,1fr) 18px;gap:14px;text-align:left;padding:23px 0;align-items:start;border-radius:0;color:#364238;min-height:100px}.intent-row:hover:not(:disabled){background:transparent;color:#426345}.intent-number{font:italic 14px Georgia,serif;color:#788273;padding-top:4px}.intent-row strong{display:block;font-family:Georgia,'AppleMyungjo',serif;font-weight:500;font-size:23px;letter-spacing:-.045em;line-height:1.35}.intent-row em{display:block;font:normal 12px Georgia,serif;color:#64705e;margin-top:5px}.intent-row small{display:block;font-size:13px;color:#667061;margin-top:9px;line-height:1.6}.intent-arrow{font-size:18px;font-weight:300;line-height:1.7}.intent-row[aria-expanded=true] .intent-arrow{font-size:0}.intent-row[aria-expanded=true] .intent-arrow:after{content:'−';font-size:18px}
.intent-content{padding:0 0 20px 40px;animation:index-reveal .18s ease}.intent-content label{display:block;font-size:12px;color:#4e5c4d;margin:14px 0 8px}.intent-content select{width:100%;font-size:15px;border:0;border-bottom:1px solid #c8cfc0;background:transparent;border-radius:0;padding:10px 0;min-height:46px}.intent-content p{font-size:13px;line-height:1.7;color:#667061}.index-start{min-height:48px;padding:14px 0 4px;font-size:14px;color:#3d6045}.index-start:hover{text-decoration:underline;text-underline-offset:5px}
#settings-dialog .options-secondary{padding:18px 0 12px}#settings-dialog .setting-block{margin:12px 0}#settings-dialog .setting-block label{font-size:13px}#settings-dialog .setting-row select{font-size:14px;background:transparent;border:0;border-bottom:1px solid #c8cfc0;border-radius:0}#settings-dialog .setting-shortcuts{display:flex;gap:24px;margin:4px 0}#settings-dialog .dock-action{width:auto;min-height:44px;padding:10px 0;border:0;border-radius:0;color:#52634f;font-size:13px}#settings-dialog .dock-action svg{display:none}#settings-dialog .dock-action span{display:inline}#settings-dialog .bedtime-listen{display:block;background:none;border:0;padding:12px 0;margin:0;text-align:left;border-radius:0;font-size:13px;color:#52634f;min-height:44px;text-decoration:none}#settings-dialog details{border:0}#settings-dialog summary{font-size:13px;color:#52634f}#settings-dialog .fine-print{font-size:12px;color:#667061}#settings-dialog #scene-sound{accent-color:#526c4b;min-height:24px;width:24px;height:24px}#settings-dialog .options-donation{border-top:1px solid #deded2;margin-top:22px;padding-top:24px}#settings-dialog .options-donation p{font-family:Georgia,'AppleMyungjo',serif;font-size:16px;color:#58634f}#settings-dialog .options-donation button{font-size:14px;display:block}#settings-dialog .options-donation small{font-size:11px;color:#67725e}#support-custom{display:block;width:100%;margin:12px 0;font-size:16px}
@keyframes index-reveal{from{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:none}}
@media(max-width:540px){#settings-dialog{width:calc(100vw - 20px);max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 20px);padding:0 22px calc(24px + env(safe-area-inset-bottom));margin:auto}#settings-dialog .dialog-heading{padding-top:20px}#settings-dialog .dialog-heading h2{font-size:24px}.intent-row{gap:10px;padding:19px 0}.intent-row strong{font-size:21px}.intent-content{padding-left:36px}.intent-row small{font-size:12px}}
@media(prefers-reduced-motion:reduce){.intent-content{animation:none}}
.paypal-support{margin:24px 0;padding:24px 0;border-top:1px solid #d9ded1;border-bottom:1px solid #d9ded1;text-align:left}.paypal-support h3{font:24px Georgia,serif;color:#364238;margin:0 0 12px}.paypal-support>p{font-size:14px;line-height:1.7}.paypal-fields{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:20px 0}.paypal-fields label{display:block;font-size:13px;color:#435343}.paypal-fields input,.paypal-fields select{display:block;width:100%;min-width:0;margin-top:8px;padding:12px;font-size:16px;border:1px solid #c8cfc0;border-radius:8px;background:#faf8f1;color:#364238}.paypal-support .primary{width:100%;min-height:48px}.paypal-support .fine-print{font-size:12px;line-height:1.65;color:#5b6857}.support-card[hidden]{display:none!important}@media(max-width:380px){.paypal-fields{grid-template-columns:1fr}}
.paypal-presets{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.paypal-presets:empty{display:none}.paypal-presets button{min-height:44px;padding:8px 18px}.paypal-support>input{display:block;width:100%;box-sizing:border-box;margin:8px 0 16px;padding:12px;border:1px solid #cbd2c7;border-radius:10px;background:#fffef9;color:#263d34;font:inherit}.paypal-support button:disabled{opacity:.55;cursor:not-allowed}
/* A small gift from the actual picture book. */
.gift-entry{margin:8px 0 24px;padding:18px 0;border-top:1px solid #d8ddd3;border-bottom:1px solid #d8ddd3}.gift-entry #open-ending{display:flex;align-items:center;gap:16px;width:100%;text-align:start;font-size:18px;min-height:58px}.story-acorn{width:64px;height:52px;flex:none;border-radius:50%;mix-blend-mode:multiply}.gift-entry p,.gift-entry small{margin:4px 0 0 80px;font-size:12px}.gift-play{text-align:center}.gift-acorn-button{border:0;background:transparent;cursor:pointer;display:inline-flex;flex-direction:column;align-items:center;gap:8px;color:inherit;padding:12px;border-radius:20px;font:inherit}.gift-acorn-button .story-acorn{width:112px;height:88px}.gift-acorn-button:active{transform:scale(.96)}.gift-acorn-button:focus-visible{outline:2px solid #496b53;outline-offset:4px}.gift-total{display:flex;align-items:center;justify-content:center;gap:12px;margin:12px 0}.gift-total output{font-size:30px;font-variant-numeric:tabular-nums}.gift-checkout{display:block;text-decoration:none;margin:16px auto;padding:14px;max-width:300px}.gift-basket{width:220px;height:120px;margin:0 auto 8px;position:relative}.basket-weave{position:absolute;bottom:0;width:100%;height:60px;border-radius:8px 8px 55px 55px;background:repeating-linear-gradient(0deg,transparent 0 9px,#8a634a55 10px 12px),repeating-linear-gradient(90deg,#c39b70 0 14px,#a67a52 15px 18px);border:3px solid #8f6d4c;box-sizing:border-box}.basket-weave:before{content:'';position:absolute;left:-3px;right:-3px;top:-5px;height:10px;border-radius:50%;background:#a17b54;border:2px solid #8f6d4c}#gift-acorns{position:absolute;inset:0 12px 35px}#gift-acorns svg{position:absolute;left:var(--x);bottom:var(--y);width:50px;height:42px;transform:rotate(var(--turn))}.acorn-drop{animation:acorn-drop .55s ease-out}@keyframes acorn-drop{from{translate:0 -65px;opacity:0}70%{translate:0 4px;opacity:1}to{translate:0 0;opacity:1}}.country-preview select{max-width:100%;width:100%}[dir=rtl] .intent-row{text-align:right}[dir=rtl] .gift-entry p,[dir=rtl] .gift-entry small{margin-right:80px;margin-left:0}@media(prefers-reduced-motion:reduce){.acorn-drop{animation:none}.gift-acorn-button:active{transform:none}}
.ending-dialog .ending-acorn{display:none}.ending-dialog .ending-intro h2{font-size:24px;line-height:1.4;margin:10px 0}.ending-dialog .enjoy-ending{margin:0;padding:8px;min-height:44px;border:0;background:transparent}.paypal-support.gift-play{margin:8px 0;padding:14px 0}.gift-play .gift-basket{height:95px}.gift-play .gift-acorn-button{padding:8px}.gift-play .fine-print{text-align:start}.gift-custom input{width:130px}.gift-custom .paypal-presets{justify-content:center}
.gift-reaction{width:240px;height:120px;margin:0 auto;background:url('assets/gift-reactions-v64.png') no-repeat;background-size:200% 300%;background-position:0 0;transform-origin:50% 100%;}
.gift-reaction[data-pose=dance]{background-position:100% 0}.gift-reaction[data-pose=thanks]{background-position:0 50%}.gift-reaction[data-pose=hanbok]{background-position:100% 50%}.gift-reaction[data-pose=bow]{background-position:0 100%}.gift-reaction[data-pose=hug]{background-position:100% 100%}
.gift-reaction.moving{animation:gift-sway .6s ease-in-out 3}.reaction-controls{text-align:center}.reaction-controls button{min-width:44px;min-height:44px;color:#496351}.gift-checkout:disabled{opacity:.65;cursor:not-allowed}.gift-play [hidden]{display:none!important}
@keyframes gift-sway{0%,100%{transform:rotate(0)}30%{transform:translateY(-5px) rotate(-3deg)}70%{transform:rotate(3deg)}}
@media(prefers-reduced-motion:reduce){.gift-reaction.moving{animation:none}}
.reader-invitation{position:fixed;bottom:max(16px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);z-index:40;padding:12px 18px;background:#fffff1ed;box-shadow:0 4px 24px #22332220;border-radius:14px;max-width:calc(100vw - 24px);display:flex;gap:12px;align-items:center;animation:invite-in 1.2s ease}.reader-invitation[hidden]{display:none}.reader-invitation button{min-height:44px}.reader-invitation p{margin:0;font-size:14px}@keyframes invite-in{from{opacity:0}to{opacity:1}}@media(prefers-reduced-motion:reduce){.reader-invitation{animation:none}}
.gift-reaction{clip-path:inset(8px 0 0)}.journey-preferences{padding:12px 0;font-size:14px}.journey-preferences label{display:flex;gap:10px;align-items:center}.journey-preferences button{min-height:44px}
/* Korean learning starts at the trailing edge on both narrow and wide screens. */
#intent-start-ko{display:block;width:max-content;max-width:100%;margin-left:auto;margin-right:0;text-align:right;min-height:44px}

/* Match the gift entry to the reading index and align every start action. */
#settings-dialog .index-start{display:block;width:max-content;max-width:100%;margin-left:auto;margin-right:0;text-align:right;min-height:44px}
#settings-dialog .options-donation.gift-entry{margin:0;padding:0;border-top:0;border-bottom:1px solid #deded2}
#settings-dialog .gift-entry #open-ending{display:grid;grid-template-columns:26px minmax(0,1fr) 18px;gap:14px;align-items:start;padding:23px 0;min-height:100px;font-size:inherit}
#settings-dialog .gift-entry .story-acorn{width:26px;height:26px;margin-top:3px}
#settings-dialog .gift-entry small{margin:9px 0 0;font-size:13px;color:#667061;line-height:1.6}
#settings-dialog .gift-entry #gift-entry-currency{margin-top:3px;font-size:11px}

/* Rotated reader dialogs use swapped, measured dimensions, not portrait vh. */
#reader-app.immersive.is-rotated dialog[open]{
 left:var(--visible-center-x);top:var(--visible-center-y);
 width:min(480px,calc(var(--room-width) - 32px));
 max-width:calc(var(--room-width) - 32px);max-height:calc(var(--room-height) - 24px);
 margin:0;overflow-y:auto;overflow-x:hidden;
}
#reader-app.immersive.is-rotated #settings-dialog[open]{
 width:min(560px,calc(var(--room-width) - 32px));
 max-width:calc(var(--room-width) - 32px);max-height:calc(var(--room-height) - 24px);
 padding:0 22px 24px;
}
#reader-app.immersive.is-rotated #settings-dialog .dialog-heading{padding:12px 0;}
#reader-app.immersive.is-rotated #settings-dialog .dialog-heading h2{font-size:22px;margin-top:4px;}

/* Opaque cut-out acorns: back rows behind front rows, basket wall in front. */
.gift-play .gift-basket{height:130px;isolation:isolate;}
.gift-basket:before{content:'';position:absolute;left:3px;right:3px;bottom:47px;height:28px;border-radius:50%;background:#886747;z-index:0;}
#gift-acorns{inset:0 12px 43px;z-index:1;}
#gift-acorns .story-acorn{mix-blend-mode:normal;opacity:1;border-radius:0;filter:drop-shadow(0 2px 1px #4c302b35);}
.gift-basket .basket-weave{z-index:2;}

.ending-dialog .ending-intro h2{word-break:keep-all;overflow-wrap:break-word;text-wrap:balance}

/* Primary reading actions are centered; silent reading is a direct entry. */
#settings-dialog #intent-start-listen,#settings-dialog #intent-start-ko{margin-left:auto;margin-right:auto;text-align:center}

/* Isolated scene viewport: explicit source rectangles prevent adjacent-frame bleed. */
#gift-reaction{width:min(360px,100%);height:180px;max-height:none;aspect-ratio:auto;background:none;clip-path:none;overflow:hidden;margin:8px auto 10px;display:flex;align-items:center;justify-content:center}
#gift-reaction svg{display:block;width:100%;height:100%;overflow:hidden}
#gift-reaction[data-group="pair"] svg{width:260px;max-width:100%}
.gift-play .gift-basket{width:180px;height:var(--pile-height,131px);margin:0 auto 14px;overflow:hidden}
.gift-basket .basket-weave{height:50px}
.gift-basket:before{bottom:38px;height:24px}
#gift-acorns{inset:0 10px 36px}
#gift-acorns svg{width:40px;height:34px}
.gift-play .gift-acorn-button{flex-direction:row;gap:10px;min-height:48px;padding:6px 12px;border-radius:12px;font-size:13px;max-width:100%}
.gift-acorn-button .story-acorn{width:56px;height:44px}
.gift-total{flex-wrap:wrap;gap:8px;margin:12px 0 2px}
@media(max-width:380px){#gift-reaction{height:155px}.gift-total output{font-size:26px}}

#gift-reaction[data-group="pair"]{height:140px}

.reading-outro{position:fixed;z-index:14;bottom:max(100px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);max-width:calc(100% - 32px);padding:6px 16px 0;border-radius:16px;text-align:center;background:#faf9f1e8;color:#4b5c4c;animation:outro-in 1s ease both}
.reading-outro[hidden]{display:none}.reading-outro p{font-family:Georgia,'AppleMyungjo',serif;font-size:15px;margin:4px 0 0;line-height:1.6}.reading-outro>div{display:flex;justify-content:center;align-items:center;gap:12px}.reading-outro button{background:none;font-size:12px;min-height:44px;padding:8px 6px;color:#3e5b44}.reading-outro button:hover{text-decoration:underline;text-underline-offset:4px}.reading-outro button:focus-visible{outline:2px solid #496b53;outline-offset:2px}.controls-hidden .reading-outro{bottom:max(16px,env(safe-area-inset-bottom))}
@keyframes outro-in{from{opacity:0}to{opacity:1}}@media(prefers-reduced-motion:reduce){.reading-outro{animation:none}}

/* Donation: one clear action, with the complete illustration and basket above it. */
body:has(#ending-dialog[open]){overflow:hidden;overscroll-behavior:none}
#reader-app #ending-dialog[open]{position:fixed;inset:auto;left:calc(var(--gift-vleft,0px) + var(--gift-vwidth,100vw)/2);top:calc(var(--gift-vtop,0px) + var(--gift-vheight,100dvh)/2);transform:translate(-50%,-50%);rotate:none;translate:none;margin:0;padding:0;width:min(480px,calc(var(--gift-vwidth,100vw) - 40px));max-width:calc(var(--gift-vwidth,100vw) - 24px);max-height:calc(var(--gift-vheight,100dvh) - 32px);overflow:auto;overflow-x:hidden;scroll-padding:110px 0 24px;background:#faf9f2;box-sizing:border-box;border-radius:24px;animation:shade-in .2s ease-out}
#ending-dialog .gift-header{position:sticky;top:0;z-index:5;background:#faf9f2;padding:20px 60px 12px 24px;text-align:start;border-bottom:1px solid #e4e5db}
#ending-dialog .end-close{position:absolute;inset:12px 12px auto auto;margin:0;width:44px;height:44px;background:#eef0e7;border-radius:50%}
#ending-dialog .ending-intro{padding:0}#ending-dialog .ending-intro .eyebrow{font-size:10px;line-height:1.4}#ending-dialog .ending-intro h2{font-size:21px;line-height:1.4;margin:6px 0 0;letter-spacing:-.025em}
#ending-dialog .gift-content{padding:0 24px max(18px,env(safe-area-inset-bottom))}
#ending-dialog .gift-play{margin:0;padding:8px 0 0}
#ending-dialog #gift-reaction{height:150px;margin:0 auto 4px}
#ending-dialog #gift-reaction[data-group="pair"]{height:125px}
#ending-dialog .gift-basket{margin:0 auto 4px}
#ending-dialog .gift-total{display:grid;grid-template-columns:1fr;gap:2px;margin:4px 0 12px;line-height:1.2}
#gift-amount-label{font-size:12px;color:#626f60}#ending-dialog .gift-total output{font-size:36px;font-weight:500;letter-spacing:-.03em}#gift-count{font-size:12px;color:#626f60;margin-top:2px}
#ending-dialog .gift-acorn-button{display:flex;justify-content:center;width:100%;max-width:100%;min-height:56px;padding:10px 14px;gap:10px;background:#42654c;color:#fffdf5;border:1px solid #42654c;border-radius:14px;font-size:16px;font-weight:600;line-height:1.4;box-shadow:0 3px 0 #2f4e38;touch-action:manipulation}
#ending-dialog .gift-acorn-button:hover:not(:disabled){background:#36583f}#ending-dialog .gift-acorn-button:active:not(:disabled){transform:translateY(2px);box-shadow:0 1px 0 #2f4e38}#ending-dialog .gift-acorn-button:disabled{opacity:.55}
#ending-dialog .gift-acorn-button .story-acorn{width:34px;height:30px;mix-blend-mode:normal;flex-shrink:0}
#ending-dialog #gift-remove{display:block;margin:4px auto 0;min-height:44px;padding:10px 16px;font-size:13px;text-align:center;color:#52634f}#ending-dialog #gift-remove:disabled{opacity:.45;cursor:default}
#ending-dialog .gift-custom{border-top:1px solid #dedfd4;margin-top:2px;padding-bottom:6px}#ending-dialog .gift-custom summary{font-size:14px;text-decoration:underline;text-underline-offset:4px;padding:12px 0}#ending-dialog .gift-custom input{font-size:16px;width:160px;margin-inline-start:8px}
#ending-dialog .gift-play .fine-print{text-align:center;font-size:12px;margin:6px 0;line-height:1.55}#ending-dialog .gift-checkout{width:100%;max-width:none;margin:10px 0 8px;min-height:48px;font-size:14px}#ending-dialog .gift-checkout:disabled{background:#eceee6;color:#626d5d;opacity:1}
#ending-dialog #checkout-status:empty{display:none}#ending-dialog .ending-actions{flex-wrap:wrap}#ending-dialog :focus-visible{outline:3px solid #8ba47b;outline-offset:3px}#ending-dialog [hidden]{display:none!important}
/* Only the new acorn falls; the painted acorns remain opaque while stacking. */
@keyframes acorn-drop{from{translate:0 -48px}70%{translate:0 3px}to{translate:0 0}}
@media(max-width:600px){
 #reader-app #ending-dialog[open]{left:var(--gift-vleft,0px);top:calc(var(--gift-vtop,0px) + var(--gift-vheight,100dvh));transform:translateY(-100%);width:var(--gift-vwidth,100vw);max-width:100%;max-height:calc(var(--gift-vheight,100dvh) - max(8px,env(safe-area-inset-top)));border-radius:22px 22px 0 0;border-bottom:0;scroll-padding-top:115px}
 #ending-dialog .gift-header{padding:14px 60px 10px max(18px,env(safe-area-inset-left));}#ending-dialog .ending-intro h2{font-size:19px}
 #ending-dialog .gift-content{padding:0 max(18px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left))}
 #ending-dialog #gift-reaction{height:120px}#ending-dialog #gift-reaction[data-group="pair"]{height:105px}#ending-dialog .gift-play{padding-top:4px}#ending-dialog .gift-total{margin:2px 0 10px}#ending-dialog .gift-total output{font-size:32px}
}
@media(prefers-reduced-motion:reduce){#reader-app #ending-dialog[open],#ending-dialog .acorn-drop{animation:none}#ending-dialog .gift-acorn-button:active:not(:disabled){transform:none}}

/* Quiet, localized name meanings in reading options. */
#name-meanings{padding:0;}
#name-meanings>p{font-family:inherit;font-size:14px;line-height:1.85;color:var(--ink);margin:0 0 20px;overflow-wrap:anywhere;}
/* Readable native-language text, with the original spread left intact. */
.story-language{font-size:12px;color:var(--green);min-height:44px;max-width:42vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:8px 12px;border-radius:22px;text-align:end}
#reader-app:not(.immersive):not(.study-mode) .masthead{right:24px;max-width:none}
#reader-app:not(.immersive):not(.study-mode) .book-stage{min-height:0}
#reader-app:not(.immersive):not(.study-mode) .book{width:min(100%,1120px,calc((100dvh - 410px)*2))}
.story-text{max-width:850px;margin:22px auto 12px;padding:0 20px}
.story-text header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:8px}
.story-text h2{font:11px/1.5 inherit;color:var(--muted);letter-spacing:.04em;margin:0;flex-shrink:0}
.story-text .text-button{font-size:12px;text-align:end;padding:8px 0;white-space:normal;line-height:1.5}
#story-lines{margin:0;padding:0;list-style:none;display:grid;gap:10px}
#story-lines li{font-size:clamp(17px,1.5vw,21px);line-height:1.75;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--ink);border-inline-start:2px solid transparent;padding-inline-start:12px}
#story-lines li[aria-current=true]{border-inline-start-color:#6c896c;background:linear-gradient(90deg,#e9eee388,transparent);border-radius:2px}
.caption-box{display:none}
#reader-app.immersive .story-text{display:none}
#reader-app.immersive .caption-box{display:block;position:absolute;inset:auto 7% 100px;z-index:10;min-height:0;padding:8px 16px;border-radius:10px;background:#fffdf5ed;max-width:900px;max-height:35%;overflow:auto}
#reader-app.immersive .caption-box:has(#caption:empty){display:none}
#reader-app.immersive #caption{font-size:clamp(16px,2vw,23px);line-height:1.6}
#reader-app.immersive .reading-meta{display:none}
#reader-app.study-mode .story-text{display:none}
@media(max-width:760px){
 #reader-app:not(.immersive):not(.study-mode){padding:64px 0 calc(130px + env(safe-area-inset-bottom))}
 #reader-app:not(.immersive):not(.study-mode) .masthead{right:14px}
 #reader-app:not(.immersive):not(.study-mode) .book{width:100%;min-width:0}
 .story-text{padding:0 10px;margin-top:18px}
 .story-text header{gap:12px;align-items:start}
 .story-text h2{padding-top:12px}
 #story-lines li{font-size:18px;line-height:1.8;padding-inline-start:10px}
 #reader-app:not(.immersive):not(.study-mode) .reader-dock .icon-button{width:44px;height:44px}
 .story-language{font-size:11px;max-width:46vw;padding:8px}
 .story-text .text-button{max-width:68%}
 #reader-app:not(.immersive):not(.study-mode).controls-hidden .reader-chrome{opacity:1;pointer-events:auto;translate:0}
 #reader-app:not(.immersive):not(.study-mode).controls-hidden .masthead{opacity:1;pointer-events:auto}
}
#reader-app:not(.immersive):not(.study-mode).is-quiet .book-stage{min-height:0}
.story-text h2{font-family:inherit;font-size:11px;font-weight:400;line-height:1.5}
#reader-app:not(.immersive):not(.study-mode).is-quiet .book{width:min(100%,1120px,calc((100dvh - 410px)*2))}
@media(min-width:761px){
 #reader-app:not(.immersive):not(.study-mode) .reader-chrome{position:relative;inset:auto;transform:none;margin:18px auto 0}
}
@media(max-width:760px){#reader-app:not(.immersive):not(.study-mode).is-quiet .book{width:100%}}

/* Direct landscape control beside reading options; mobile and touch devices. */
#quick-fullscreen{display:none}
@media(max-width:760px),(pointer:coarse){#quick-fullscreen{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;flex-shrink:0}#quick-fullscreen[aria-pressed="true"]{background:var(--pale,#e9eee4);color:var(--green)}}

/* Give hidden mobile transport space back to the subtitles, including CSS-rotated reading. */
@media(max-width:760px),(pointer:coarse){
 #reader-app.immersive .caption-box{transition:bottom .35s ease}
 #reader-app.immersive.controls-hidden .caption-box{bottom:max(8px,env(safe-area-inset-bottom))}
}
@media(prefers-reduced-motion:reduce){#reader-app.immersive .caption-box{transition:none}}
