/* The switch shares the existing 50px decade row in both views. */
.view-switch[hidden]{display:none}
.view-switch{display:flex;flex:none;height:40px;background:#faf7f1;border:1px solid var(--gold);border-radius:3px}
.view-switch button{min-width:40px;min-height:40px;height:40px;margin-top:-1px;padding:0 2px;font:inherit;font-size:.8125rem;line-height:1;white-space:nowrap;background:none;color:#283e88;border:0;cursor:pointer}
.view-switch button[aria-pressed=true]{background:var(--primary);color:var(--primary-ink)}
nav:has(.view-switch:not([hidden])){padding-left:8px;padding-right:8px}
.nav-row{display:flex;align-items:center;gap:2px;max-width:668px;height:50px;margin:auto;padding-top:6px}
.nav-row .decade-nav{flex:none;justify-content:flex-start;gap:0;height:40px;min-height:40px;margin:0 auto 0 0;padding:0}
.nav-row .decade-nav a{flex:0 0 40px;width:40px;height:40px}
.nav-row .language-control{position:relative;top:auto;right:auto;flex:none;color:#283e88}
.nav-row .language-more summary{min-width:40px;min-height:40px;height:40px;padding:0 5px;gap:4px;border:1px solid var(--gold);background:#faf7f1}
.nav-row .language-more summary svg{width:20px;height:20px;flex:none}
.nav-row .language-code{font:600 .75rem/1 'Source Serif 4',Georgia,serif}
.nav-row .language-menu{z-index:40;right:0;top:calc(100% + 6px)}
@media(max-width:379px){.nav-row .language-code{display:none}}
.book-controls,.book-contents,.book-title,.book-indicator,.book-pray-title{display:none}
html.view-book{color-scheme:light;--bg:#f1e6cb;--card:#f6ecd3;--ink:#2b2118;--mute:#54463a;--accent:#283e88;--gold:#b38a31;--gilt:#e1c46e;--rubric:#a3301b;--line:#ccb989;--soft:#eadcb9;--primary:#283e88;--primary-ink:#fbf1dc;--focus:#a3301b}
html.view-book body{background:radial-gradient(ellipse at 25% 10%,#fffae866,transparent 60%),linear-gradient(90deg,#ba9b5422,transparent 12%,transparent 88%,#ba9b5422),var(--bg)}
html.view-book body>header,html.view-book body>footer{display:none}
/* Book starts at the viewport edge; reserve only the measured navigation height. */
html.view-book body{padding-top:calc(var(--nav-offset,132px) - 12px)}
html.view-book body>nav{position:fixed;inset:0 0 auto;width:100%;margin:0;z-index:20}
html.view-book main{padding:8px 24px calc(118px + env(safe-area-inset-bottom))}
html.view-book main>section{display:none;padding-top:0}
html.view-book main>section.book-section{display:block}
html.view-book main>section>h2,html.view-book main>section>.days,html.view-book .jump-strip{display:none}
html.view-book main article{display:none}
/* Red inner rule, blue double outer rule and two gilt corner diamonds. */
html.view-book :is(article.book-page,.book-title:not([hidden]),.book-contents:not([hidden])){display:flow-root;position:relative;min-height:65vh;margin:16px 0 22px;padding:22px 16px 26px;border:1px solid var(--rubric);border-radius:0;outline:4px double var(--accent);outline-offset:4px;box-shadow:inset 9px 0 18px #a8842820,0 7px 18px #51390814;background:radial-gradient(ellipse at 70% 20%,#fff9e455,transparent 65%),var(--card)}
html.view-book :is(.book-page,.book-title,.book-contents)::before,html.view-book :is(.book-page,.book-title,.book-contents)::after{content:'';position:absolute;width:12px;height:12px;background:var(--gold);transform:rotate(45deg);z-index:1}
html.view-book :is(.book-page,.book-title,.book-contents)::before{left:-12px;top:-12px}
html.view-book :is(.book-page,.book-title,.book-contents)::after{right:-12px;bottom:-12px}
html.view-book .book-title[hidden],html.view-book .book-contents[hidden]{display:none}
html.view-book .book-page>.num{position:absolute;top:22px;inset-inline-start:16px;float:none;margin:0;border:0;background:none;color:var(--rubric);font-family:Georgia,serif;height:48px}
html.view-book .book-page>h3{font-size:1.9rem;color:var(--ink);font-variant-caps:small-caps;text-align:center}
html.view-book .book-page>.fruit{color:var(--rubric);margin-left:0;margin-right:0;text-align:center}
html.view-book .book-page>.share-actions{top:22px;inset-inline-end:16px}
/* Keep words intact; fit only an over-wide word, using the loaded font metrics. */
html.view-book :is(.book-page>h3,.book-title h2,.book-contents h2,.book-home-actions h3,.book-set-entry){overflow-wrap:normal;word-break:normal;hyphens:auto}
html.view-book article.book-page:has(>.share-actions)>h3{clear:both;margin-top:56px;padding:0;min-height:0;overflow-wrap:normal;word-break:normal;hyphens:none;text-wrap:balance;letter-spacing:0}
html.view-book .book-title-phrase{white-space:nowrap}
html.view-book .book-heading-fitted{font-size:var(--book-heading-fit)!important}
.book-word-probe{position:absolute!important;visibility:hidden!important;pointer-events:none!important;width:max-content!important;max-width:none!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important;white-space:nowrap!important;float:none!important}
html.view-book .book-title h2.book-word-probe:not(.book-first-word):first-letter{font-size:inherit;line-height:inherit}
.book-contents button>span:first-of-type,.book-title .book-list button>span:nth-child(2){min-width:0;overflow-wrap:normal;word-break:normal;hyphens:auto}
html.view-book figure.art>a{display:block;max-width:420px;margin:auto;padding:7px;border:0;border-radius:50% 50% 2px 2px / 36px 36px 2px 2px;background:linear-gradient(135deg,#dfbf70,#987023,#e2c579);box-shadow:none}
html.view-book figure.art img{display:block;width:100%;height:260px;max-height:46vh;object-fit:cover;object-position:var(--focus,50% 50%);border-radius:50% 50% 0 0 / 30px 30px 0 0}
html.view-book figure.art figcaption{font-style:italic;text-align:center;border:0;padding:0;font-size:.875rem;line-height:1.5}
html.view-book .book-title figure.art img{height:175px;object-position:var(--focus-title,center 38%)}
html.view-book .book-title figure.art{margin:0 0 16px}
html.view-book .book-title h2{display:flow-root;text-align:center;font:500 clamp(2.4rem,9vw,3.25rem)/1.05 'Cormorant Garamond',Georgia,serif;color:var(--ink);margin:12px 0}
html.view-book .book-title h2:first-letter{font-size:1.6em;color:var(--accent);line-height:.8}
html.view-book .book-title .days{text-align:center;color:var(--rubric);font-style:italic;font-size:1.0625rem;margin:10px 0 20px}
html.view-book .book-page .refl{border-color:var(--gold);font-size:1.125rem}
html.view-book .book-page .refl::before{color:var(--gold)}
html.view-book .book-page .refl:first-letter{initial-letter:normal;float:left;font:600 3.4rem/.95 Georgia,serif;background:var(--accent);color:var(--gilt);margin:6px 12px 0 0;padding:5px 9px;box-shadow:inset 0 0 0 2px var(--accent),inset 0 0 0 3px var(--gilt);outline:1px solid var(--rubric);outline-offset:3px}
html.view-book .book-page>.next-mystery{display:none}
html.view-book .book-page>.pray-open{display:flex;width:100%;background:var(--rubric);box-shadow:inset 0 0 0 3px var(--rubric),inset 0 0 0 4px var(--gilt);font-variant-caps:small-caps}
/* Navigation stays reachable at the end of any length of reading. */
html.view-book .book-controls{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.3fr);gap:6px;position:fixed;inset:auto 0 0;z-index:30;width:100%;max-width:700px;margin:auto;padding:12px 8px calc(12px + env(safe-area-inset-bottom));border-top:3px double var(--rubric);background:var(--bg);box-shadow:0 -3px 12px #51390818}
.book-controls button,.book-contents button,.book-title button{min-height:56px;padding:10px 8px;border:1px solid var(--gold);border-radius:0;background:transparent;color:var(--ink);font:inherit;font-size:1rem;line-height:1.4;cursor:pointer;overflow-wrap:normal;hyphens:auto}
html.view-book .book-controls>button{min-width:0;padding:8px 3px;white-space:nowrap;font-size:clamp(.875rem,3.9vw,1rem);hyphens:none}
html.view-book #book-next,html.view-book .book-title .book-begin{background:var(--primary);color:var(--primary-ink);box-shadow:inset 0 0 0 3px var(--primary),inset 0 0 0 4px var(--gilt);font-variant-caps:small-caps;letter-spacing:.04em}
html.view-book .book-indicator{display:block;text-align:right;font-size:.8125rem;line-height:1.3;color:var(--rubric);max-width:652px;margin:8px auto 0;padding:0 24px}
html.view-book .book-contents h2{color:var(--rubric);font-variant-caps:small-caps;border-bottom:1px solid var(--line);padding-bottom:12px}
.book-contents button,.book-title .book-list button{display:flex;align-items:baseline;gap:8px;width:100%;text-align:left;border:0;padding:12px 0;background:none}
.book-contents .leader,.book-title .leader{flex:1;min-width:12px;border-bottom:2px dotted #8c784e88;transform:translateY(-4px)}
.book-roman{flex:0 0 22px;color:var(--rubric);font:1rem Georgia,serif}
.book-folio{color:var(--mute);font-style:italic}
.book-contents .book-set-entry{color:var(--accent);font:600 1.75rem/1.2 'Cormorant Garamond',Georgia,serif;margin-top:24px}
.book-contents .days{color:var(--rubric);font-style:italic;font-size:1rem;margin:0 0 8px}
html.view-book .book-home-actions h3{color:var(--rubric);font-size:1.25rem;font-variant-caps:small-caps;margin:24px 0 12px}
html.view-book .book-home-actions :is(a,button){display:flex;align-items:center;justify-content:center;width:100%;min-height:56px;box-sizing:border-box;margin:10px 0;padding:14px 10px;border:1px solid var(--gold);border-radius:0;background:transparent;color:var(--ink);font:inherit;line-height:1.4;text-align:center;text-decoration:none}
html.view-book .book-home-actions [data-pray-today],html.view-book .book-home-actions [aria-current=page]{color:var(--primary-ink);background:var(--primary);box-shadow:inset 0 0 0 3px var(--primary),inset 0 0 0 4px var(--gilt)}
.book-home-icon{display:inline-block;width:1em;height:1em;margin-right:.35em;vertical-align:-.1em;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.book-title .book-begin{display:block;width:100%;min-height:60px;margin-top:20px}
html.view-book :lang(zh) .book-title h2{font-family:'Source Serif 4','Noto Serif CJK TC','PMingLiU',serif;font-size:2.2rem;line-height:1.5}
html.view-book :lang(zh) .book-title h2:first-letter{font-size:inherit;color:inherit;line-height:inherit}
html.view-book :lang(zh) .book-page .refl:first-letter{initial-letter:normal;float:none;font:inherit;background:none;color:inherit;margin:0;padding:0;box-shadow:none;outline:0}
@media(prefers-reduced-motion:no-preference){html.view-book :is(.book-page,.book-title:not([hidden])){animation:book-leaf .24s ease-out;transform-origin:left center}@keyframes book-leaf{from{opacity:.5;transform:perspective(1200px) rotateY(5deg)}to{opacity:1;transform:none}}}
@media(prefers-reduced-motion:reduce){.book-page,.book-title{animation:none!important}}
