/*
 * Reader VNext comparison only. This stylesheet lives outside ./site.
 * Editorial and Nightfall are alternative treatments of the SAME text/layout.
 * No font downloads, advertisements, external assets, or reader-data migration.
 */
:root{
  color-scheme:light;
  --page:#e8ebe4;
  --paper:#faf8f2;
  --ink:#292d28;
  --secondary:#566159;
  --line:#d9dbd2;
  --accent:#306549;
  --accent-soft:#e3efe6;
  --chapter-font:Georgia,"Times New Roman",serif;
  --ui-font:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --prose-size:19px;
  --prose-leading:1.67;
  --prose-font:var(--chapter-font);
  --max-prose:64ch;
}
:root[data-look="nightfall"]{
  color-scheme:dark;
  --page:#0b1310;
  --paper:#16221e;
  --ink:#e8ece5;
  --secondary:#aebcaf;
  --line:#35473b;
  --accent:#b1dfbe;
  --accent-soft:#25392d;
}
*{box-sizing:border-box}
html{scroll-behavior:auto}
body{margin:0;background:var(--page);color:var(--ink);font-family:var(--ui-font)}
a{color:inherit;text-decoration:none}
a:hover{text-decoration:underline;text-underline-offset:3px}
button,select{font:inherit;color:inherit}
button,select,summary{cursor:pointer}
:where(a,button,select,summary):focus-visible{outline:3px solid var(--accent);outline-offset:3px;border-radius:4px}
.site-header{width:min(100%,1010px);margin:0 auto;padding:14px clamp(20px,4vw,45px);display:flex;align-items:center;justify-content:space-between;gap:24px}
.site-logo{padding:13px 0;font-size:15px;font-weight:800;letter-spacing:.055em}
.site-logo span{font-weight:400;color:var(--secondary);letter-spacing:0}
.site-header nav{display:flex;align-items:center;gap:clamp(10px,2vw,26px)}
.site-header nav>a,.site-header nav>button,.site-header summary{font-size:13px;font-weight:650;white-space:nowrap;min-height:44px;display:flex;align-items:center}
.site-header nav>button{border:0;background:transparent;padding:0 9px;border-radius:6px}
.site-header summary{min-width:44px;justify-content:center;background:var(--accent-soft);border-radius:8px;color:var(--accent);font-size:17px}
.site-header nav>button[aria-pressed="true"]{color:var(--accent)}
.appearance{position:relative}
.appearance summary{list-style:none}
.appearance summary::-webkit-details-marker{display:none}
.appearance summary:after{content:none}
.appearance-panel{position:absolute;z-index:5;right:0;top:calc(100% + 8px);width:235px;display:grid;gap:9px;padding:17px;background:var(--paper);border:1px solid var(--line);box-shadow:0 20px 45px #0002;border-radius:12px}
/* A six-control Aa panel must remain usable on a short phone viewport. */
.appearance-panel{max-height:calc(100vh - 96px);max-height:calc(100dvh - 96px);overflow-y:auto;overscroll-behavior:contain}
.appearance-panel label{font-size:12px;font-weight:650;color:var(--secondary)}
.appearance-panel select{width:100%;min-height:43px;margin-bottom:7px;padding:8px 10px;background:var(--accent-soft);border:1px solid var(--line);border-radius:7px;font-size:14px}
.reading-shell{width:min(calc(100% - 32px),930px);min-height:calc(100vh - 120px);margin:0 auto 50px;padding:clamp(32px,2.7vw,38px) clamp(30px,8vw,104px) 75px;background:var(--paper);border:1px solid var(--line);border-radius:8px;box-shadow:0 22px 65px #0000000c}
.chapter-header{text-align:left;font:400 var(--prose-size)/1.67 var(--prose-font);width:min(100%,var(--max-prose));margin:0 auto clamp(23px,2.2vw,26px)}
.chapter-context{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:5px 16px;margin:0 0 11px;padding:0 0 8px;border-bottom:1px solid var(--line);font:600 12px/1.5 var(--ui-font);color:var(--secondary)}
.chapter-context .series-name{color:var(--accent);text-transform:uppercase;letter-spacing:.115em;font-size:11px;font-weight:750}
.chapter-meta{display:flex;align-items:center;gap:9px;min-width:0}
.chapter-context .chapter-number{font-variant-numeric:tabular-nums;white-space:nowrap;letter-spacing:.015em}
.chapter-top-nav{display:inline-flex;align-items:center;gap:4px}
.chapter-top-nav a{display:grid;place-items:center;width:44px;height:44px;flex:none;border:1px solid var(--line);border-radius:6px;color:var(--ink);font:600 18px/1 var(--ui-font);text-decoration:none}
.chapter-top-nav a:hover,.chapter-top-nav a:focus-visible{background:var(--accent-soft);border-color:var(--accent)}
.bookmark-toggle{margin-left:auto;min-height:44px;padding:0 7px;border:0;border-radius:5px;background:transparent;color:var(--secondary);font:600 12px/1.3 var(--ui-font)}
.bookmark-toggle:hover,.bookmark-toggle[aria-pressed="true"]{color:var(--accent);background:var(--accent-soft)}

.chapter-eyebrow{text-transform:uppercase;color:var(--accent);font-size:12px;letter-spacing:.16em;font-weight:750;margin:0 0 18px}
.chapter-header h1{margin:0;font:500 clamp(33px,3.4vw,39px)/1.2 var(--chapter-font);letter-spacing:-.03em;text-wrap:pretty}
/* Recovery feedback appears only if a saved paragraph cannot be verified. */
.reader-resume-warning{margin:12px 0 0;color:var(--secondary);font:500 12px/1.5 var(--ui-font)}

.chapter-prose{max-width:var(--max-prose);margin:auto;font:400 var(--prose-size)/var(--prose-leading) var(--prose-font);letter-spacing:.002em;overflow-wrap:break-word}
body[data-reader-width="narrow"]{--max-prose:54ch}
body[data-reader-width="wide"]{--max-prose:78ch}
body[data-reader-leading="compact"]{--prose-leading:1.48}
body[data-reader-leading="spacious"]{--prose-leading:1.9}
body[data-reader-face="sans"]{--prose-font:var(--ui-font)}
.chapter-prose .prose{margin:0}
.chapter-prose p{margin:0 0 1.05em;overflow-wrap:break-word}
.chapter-prose .intro-author-note{
  margin:0 0 1.6em;padding:0 0 1.15em;
  border-bottom:1px solid var(--line);
  border-left:0;background:transparent;color:inherit;
  font-size:inherit;font-style:italic;line-height:inherit
}
.chapter-prose .intro-author-note p{margin:0 0 .65em}
.chapter-prose .intro-author-note p:last-child{margin-bottom:0}
.chapter-prose h1,.chapter-prose h2,.chapter-prose h3{font:600 1.12em/1.47 var(--ui-font);letter-spacing:-.02em;margin:1.8em 0 .7em}
.chapter-prose .duplicate-chapter-heading{display:none}
.chapter-prose strong{font-weight:700}
.chapter-prose blockquote{margin:1.6em 0;padding:0 0 0 20px;border-left:2px solid var(--accent);color:var(--secondary)}
.chapter-prose pre{white-space:pre-wrap;overflow-wrap:anywhere}
.chapter-prose a{color:var(--accent);text-decoration:underline;text-underline-offset:3px}
.chapter-prose img{max-width:100%;height:auto}
/* Measure the header, prose and footer on the same adjustable reading axis.
 * ch units use the element's own font: the old 16px UI-font footer
 * narrowed Previous/Next below 19–24px story text, while Modern text
 * changed prose width but left the Georgia-based header behind. The
 * visible chapter title keeps its book typography in the h1 rule. */
.chapter-footer{width:min(100%,var(--max-prose));margin:44px auto 0;padding-top:22px;border-top:1px solid var(--line);font:400 var(--prose-size)/var(--prose-leading) var(--prose-font)}

.chapter-navigation{display:flex;justify-content:space-between;gap:14px;align-items:stretch}
.chapter-navigation>a{display:flex;flex:1 1 0;min-width:0;flex-direction:column;align-items:flex-start;justify-content:center;gap:8px;min-height:78px;padding:14px 17px;border:1px solid var(--line);border-radius:7px;font:600 14px/1.3 var(--ui-font)}
.chapter-link-label{font:700 11px/1.3 var(--ui-font);text-transform:uppercase;letter-spacing:.065em;color:var(--secondary)}
/* The published English catalogue contains many chapter names longer than
   two lines, including names over 120 characters. Chapter navigation must
   identify the destination without a hover tooltip on ANY screen size. */
.chapter-link-title{font:500 16px/1.35 var(--chapter-font);display:block;overflow-wrap:anywhere}
.chapter-navigation .next-chapter{background:var(--accent-soft)}
.chapter-navigation>a:hover{text-decoration:none;background:var(--accent-soft)}
.chapter-navigation>a.next-chapter{border-color:var(--accent);color:var(--ink)}
.chapter-navigation>a.next-chapter .chapter-link-label{color:var(--accent)}
.original-link{display:block;text-align:center;margin:25px auto 0;min-height:44px;padding:12px 0;color:var(--secondary);font:400 12px/1.67 var(--ui-font)}
.original-link:hover{color:var(--accent)}
.reading-progress{position:fixed;z-index:70;top:0;left:0;width:100%;height:3px;pointer-events:none}
.reading-progress span{display:block;width:0;height:100%;background:var(--accent);transition:width .09s linear,height .09s linear}
body[data-progress="left"] .reading-progress,body[data-progress="right"] .reading-progress{height:100%;width:3px}
body[data-progress="right"] .reading-progress{left:auto;right:0}
body[data-progress="left"] .reading-progress span,body[data-progress="right"] .reading-progress span{height:0;width:100%}
body[data-progress="off"] .reading-progress{display:none}
/* Focus is distraction-free: no floating exit covers prose.
   Double-tap the story; scrolling and pinch zoom must still work. */
.chapter-prose .prose{touch-action:manipulation}
body.focus-mode .site-header{display:none}
body.focus-mode .reading-shell{padding-top:30px}
.focus-first-tip[hidden],.focus-accessible-exit[hidden]{display:none!important}
.focus-first-tip{
 position:fixed;z-index:40;top:calc(12px + env(safe-area-inset-top));
 left:50%;transform:translateX(-50%);
 width:min(440px,calc(100vw - 28px));
 padding:13px 56px 13px 17px;
 background:var(--paper);color:var(--ink);
 border:1px solid var(--line);border-radius:12px;
 box-shadow:0 8px 25px #0005;
 font:500 13px/1.5 var(--ui-font);
}
.focus-tip-dismiss{
 position:absolute;right:5px;top:2px;
 min-width:44px;min-height:44px;
 padding:0;border:0;border-radius:7px;
 color:var(--ink);background:transparent;
 font:22px/1 var(--ui-font);
}
.focus-accessible-exit:not([hidden]){
 position:fixed;z-index:41;left:0;top:0;
 width:1px;height:1px;margin:0;padding:0;
 overflow:hidden;white-space:nowrap;
 clip-path:inset(50%);border:0;
}
.focus-accessible-exit:focus-visible{
 clip-path:none;overflow:visible;
 left:12px;top:calc(10px + env(safe-area-inset-top));
 width:auto;height:auto;padding:10px 15px;
 background:var(--paper);color:var(--ink);
 border:2px solid var(--accent);border-radius:7px;
}
/* On small screens the three-second hint and keyboard exit otherwise
   occupy the same top-left reading space. Avoid the hint only while it
   exists; tablets/desktop keep the original unobtrusive exit position. */
@media(max-width:720px){
 .focus-accessible-exit:focus-visible{
  top:max(calc(10px + env(safe-area-inset-top)),
          var(--reader-focus-tip-bottom,0px))
 }
}
/* Mouse/trackpad: a temporary exit at the header edge, not over story prose. */
@media (any-hover:hover) and (any-pointer:fine){
 body.focus-mode.focus-pointer-at-top .focus-accessible-exit:not([hidden]){
  clip-path:none;overflow:visible;cursor:pointer;
  left:auto;right:16px;top:calc(10px + env(safe-area-inset-top));
  width:auto;height:auto;padding:10px 15px;
  background:var(--paper);color:var(--ink);
  border:2px solid var(--accent);border-radius:7px;
 }
}
/* Reader home and chapter lookup. */
.preview-index .preview-list{max-width:825px;margin:0 auto;padding:0 clamp(19px,4vw,44px) 80px}
.visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.home-topline{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:70px;padding:12px 0 14px;border-bottom:1px solid var(--line)}
.home-topline .site-logo{flex-shrink:0}
.home-topline nav{display:flex;align-items:center;flex-wrap:nowrap;gap:clamp(6px,1.8vw,19px)}
.home-topline nav>a{min-height:44px;display:inline-flex;align-items:center;padding:0 2px;border-bottom:2px solid transparent;font:650 13px/1.3 var(--ui-font);color:var(--secondary);white-space:nowrap}
.home-topline nav>a:hover,.home-topline nav>a[aria-current="page"]{color:var(--accent);text-decoration:none}
.home-topline nav>a[aria-current="page"]{border-bottom-color:var(--accent)}
.home-intro{padding:clamp(55px,9vw,95px) 0 clamp(48px,7vw,72px)}
.home-intro .chapter-eyebrow{margin:0 0 16px}
.preview-list h1{max-width:670px;font:500 clamp(39px,6vw,65px)/1.14 var(--chapter-font);letter-spacing:-.04em;margin:0 0 15px;text-wrap:balance}
.preview-list p{color:var(--secondary);line-height:1.6}
.home-intro>p:not(.chapter-eyebrow){margin:0;max-width:540px}
.home-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:26px}
.home-actions a{min-height:46px;padding:12px 18px;display:inline-flex;align-items:center;justify-content:center;border-radius:7px;font-size:14px;font-weight:700}
.home-actions .home-primary{color:var(--paper);background:var(--accent)}
.home-actions .home-secondary{border:1px solid var(--line);color:var(--ink);background:var(--paper)}
.home-actions a[hidden]{display:none}
.home-library{scroll-margin-top:20px}
.library-heading{display:flex;align-items:baseline;justify-content:space-between;gap:14px;flex-wrap:wrap}
.library-heading h2{margin:0;font:500 28px/1.3 var(--chapter-font)}
.library-heading>span{font-size:12px;color:var(--secondary)}
.library-tools{display:flex;gap:10px;margin-top:20px}
.library-tools input,.library-tools select{min-height:47px;padding:11px 13px;border:1px solid var(--line);border-radius:7px;background:var(--paper);color:var(--ink);font-size:14px}
.library-tools input{width:100%;min-width:0;flex:1}
.library-tools select{width:150px}
.library-count{margin:14px 0 6px;font-size:12px}
.preview-list ul{margin:0;padding:0;list-style:none;border-top:1px solid var(--line)}
.library-entry[hidden]{display:none}
.preview-list li a{min-height:76px;padding:14px 3px;display:flex;align-items:center;gap:15px;border-bottom:1px solid var(--line)}
.library-entry-identity{display:flex;flex:1;min-width:0;flex-direction:column;gap:4px}
.library-entry-number{color:var(--secondary);font-size:12px;font-weight:550}
.library-entry-title{color:var(--ink);font:500 17px/1.3 var(--chapter-font);overflow-wrap:anywhere}
.library-entry-status{color:var(--secondary);font-size:12px;white-space:nowrap}
.library-entry-arrow{color:var(--accent);font-size:20px}
#chapter-empty{padding:19px 0;margin:0}
@media(max-width:520px){.home-intro{padding:51px 0 44px}.library-tools{flex-wrap:wrap}.library-tools select{width:100%}.library-entry-status{font-size:11px}.library-entry-title{font-size:16px}}
@media(max-width:640px){
  .site-header{padding:8px 17px;gap:8px;background:var(--paper);border-bottom:1px solid var(--line)}
  .site-logo{font-size:15px}
  .site-header nav{gap:5px}
  .site-header nav>a,.site-header nav>button{font-size:13px}
  .site-header summary{font-size:17px}
  .reading-shell{width:100%;min-height:calc(100vh - 64px);margin:0;padding:20px 21px 72px;border:0;border-radius:0;box-shadow:none}
  .chapter-header{margin-bottom:22px}
  .chapter-context{margin-bottom:10px;padding-bottom:8px;font-size:11px}
  .chapter-context .series-name{font-size:10px}
  .chapter-header h1{font-size:clamp(30px,7.5vw,38px);line-height:1.2}
  .chapter-prose{font-size:var(--prose-size);line-height:var(--prose-leading)}
  body[data-reader-width="narrow"] .reading-shell{padding-left:30px;padding-right:30px}
  body[data-reader-width="wide"] .reading-shell{padding-left:16px;padding-right:16px}
  .chapter-prose p{margin-bottom:1em}
  .chapter-footer{margin-top:38px}
  .chapter-navigation>a{padding:12px 13px;min-height:76px}
  .chapter-link-label{font-size:10px}
  .chapter-link-title{font-size:14px}
  .chapter-navigation{gap:10px}
  .appearance-panel{right:-4px}
}
/* Default to full-width Previous/Next below 721px. Exceptional
   published titles over 100 characters cannot comfortably occupy two
   half-width cards on a small tablet. The source-backed shorter-title
   exceptions below restore compact rows only where names remain readable. */
@media(max-width:720px){
  body[data-chapter] .chapter-navigation{flex-direction:column;gap:10px}
  body[data-chapter] .chapter-navigation>a{
    flex:0 0 auto;min-height:68px;padding:12px 15px
  }
  body[data-chapter] .chapter-link-title{
    font-size:clamp(15px,3.2vw,17px);line-height:1.38
  }
}
/* Short adjacent source titles deserve compact Previous/Next treatment
 * instead of two 68px+ footer rows. Genuine long-title chapter pairs keep
 * the existing full-width phone layout, including source-complete names.
 * Below 380px only pairs of <=24 characters qualify; 380–559px phones
 * fit two <=36-character names without clipped words.
 * Wider phones and small tablets (560–720px) fit two <=50-character names.
 * Do not alter the chapter toolbar or the story text's reading measure. */
@media(min-width:320px) and (max-width:379px){
 body[data-chapter] .chapter-navigation.chapter-navigation--short{
  flex-direction:row;align-items:stretch
 }
 body[data-chapter] .chapter-navigation.chapter-navigation--short>a{
  flex:1 1 0;min-width:0
 }
}
@media(min-width:380px) and (max-width:720px){
 body[data-chapter] .chapter-navigation.chapter-navigation--balanced{
  flex-direction:row;align-items:stretch
 }
 body[data-chapter] .chapter-navigation.chapter-navigation--balanced>a{
  flex:1 1 0;min-width:0
 }
}
@media(min-width:560px) and (max-width:720px){
 /* Wider story measure gives <=50-character approved titles two readable
  * columns; exceptional long names still get whole-width navigation rows. */
 body[data-chapter] .chapter-navigation.chapter-navigation--tablet{
  flex-direction:row;align-items:stretch
 }
 body[data-chapter] .chapter-navigation.chapter-navigation--tablet>a{
  flex:1 1 0;min-width:0
 }
}
@media(max-width:360px){
  /* CSS zoom on mobile WebKit magnifies the inner Home frame while
     100vw still describes the outer viewport. Keep Home navigation
     within its OWN padded column so 125% zoom cannot add horizontal
     scrolling; the wide desktop shared header remains unchanged. */
  .preview-index .home-topline{width:100%;left:auto;transform:none}
  /* Wrap controls without pushing the first prose below the established
     phone chapter entrance. All links retain their full 44px targets. */
  .site-header{padding-top:3px;padding-bottom:3px;align-items:flex-start}
  /* Preserve all five primary controls when browser text/zoom enlarges them.
     Wrapping within the navigation beats overlapping Focus and Aa. */
  .site-header nav{flex:1;min-width:0;flex-wrap:wrap;justify-content:flex-end;column-gap:6px;row-gap:0}
  .site-header nav>a,.site-header nav>button{font-size:12px}
  .site-logo span{display:none}
  /* At strong browser zoom, fixed 24px narrow-mode gutters can leave too
     little room for 24px book text, and lengthy chapter headings consume
     most of the first screen. Scale gutters smoothly to the existing 360px
     rules; retain the user's Narrow/Normal/Wide distinction and the complete
     untruncated source title. No desktop or ordinary-phone change. */
  .reading-shell{padding-left:clamp(10px,4.45vw,16px);padding-right:clamp(10px,4.45vw,16px)}
  body[data-reader-width="narrow"] .reading-shell{
    padding-left:clamp(16px,6.67vw,24px);padding-right:clamp(16px,6.67vw,24px)
  }
  body[data-reader-width="wide"] .reading-shell{
    padding-left:clamp(8px,3.34vw,12px);padding-right:clamp(8px,3.34vw,12px)
  }
  .chapter-header h1{font-size:clamp(25px,8.33vw,30px)}
}
/* Passage Search is a quiet separate page, never an in-chapter toolbar. */
.search-intro{padding:42px 0 22px}.search-intro h1{font-size:clamp(35px,5vw,49px)}
.passage-form{padding:20px;border:1px solid var(--line);background:var(--paper);border-radius:10px}
.passage-form>label{display:block;font-size:13px;font-weight:650;margin-bottom:9px}
.passage-query-row{display:flex;gap:10px}
.passage-query-row input{min-width:0;flex:1;padding:11px;background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:7px;font:inherit}
.passage-query-row button,#passage-more{padding:10px 16px;min-height:44px;border:0;border-radius:7px;background:var(--accent);color:var(--paper);font:650 14px var(--ui-font)}
.passage-filters{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-top:16px;color:var(--secondary);font-size:13px}
.passage-filters #passage-through{width:83px;min-height:42px;padding:8px;background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:6px}
.passage-filters label:last-child{display:flex;gap:7px;align-items:center;margin-left:auto}
.passage-filters input[type=checkbox]{width:18px;height:18px;accent-color:var(--accent)}
.passage-coverage{font-size:12px;line-height:1.55;color:var(--secondary);margin:9px 0 0}
#passage-status{min-height:30px;font-size:13px;margin:16px 0 7px}
.passage-group{padding:8px 0 14px;border-bottom:1px solid var(--line)}
.passage-group h2{font-size:15px;line-height:1.5;margin:10px 0}
.passage-hit{display:block;margin:7px 0;padding:12px 14px;border:1px solid var(--line);border-radius:7px;background:var(--paper);font:400 15px/1.65 var(--chapter-font);overflow-wrap:anywhere}
.passage-hit:hover{border-color:var(--accent);text-decoration:none}
.passage-chapter-actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:9px 0 5px}
.passage-chapter-count{font:12px/1.5 var(--ui-font);color:var(--secondary);margin-right:auto}
.passage-chapter-actions button,#passage-previous{min-height:44px;padding:9px 12px;
 border:1px solid var(--line);border-radius:7px;background:var(--accent-soft);
 color:var(--ink);font:600 13px/1.4 var(--ui-font);cursor:pointer}
.passage-chapter-actions button:hover,#passage-previous:hover{border-color:var(--accent)}
.passage-chapter-actions button:focus-visible,#passage-previous:focus-visible{
 outline:2px solid var(--accent);outline-offset:2px}
#passage-previous{margin:18px 10px 0 0}
.passage-chapter-actions button[hidden],#passage-previous[hidden]{display:none}
.passage-hit mark,.lookup-hit{background:#f5d879;color:#272219;box-decoration-break:clone}
#passage-more{margin:18px 0}.search-home{margin:30px 0 40px}
.lookup-context{display:flex;gap:12px;justify-content:space-between;flex-wrap:wrap;font:500 12px/1.5 var(--ui-font);color:var(--secondary);margin:0 0 14px}
.lookup-context a{font-weight:700;color:var(--accent)}
@media(max-width:520px){.passage-query-row{flex-wrap:wrap}.passage-query-row button{width:100%}.passage-filters label:last-child{margin-left:0}.passage-form{padding:15px}}
/* Saved is a working library of bookmarks and imported notes, not a dashboard. */
.saved-empty a,.saved-note a,.saved-bookmark a{color:var(--accent)}
.saved-intro{padding:37px 0 24px}
.saved-intro h1{font-size:clamp(35px,5vw,50px)}
.saved-intro p:last-child{margin:0}
.saved-section{margin:0 0 32px}
.saved-section-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:0 0 11px;border-bottom:1px solid var(--line)}
.saved-section-heading h2{margin:0;font:500 26px/1.4 var(--chapter-font)}
.saved-section-heading span{font-size:12px;color:var(--secondary)}
.saved-help{max-width:650px;font-size:13px;margin:12px 0 16px}
.saved-bookmark{padding:13px 0;border-bottom:1px solid var(--line)}
.saved-chapter-link{display:inline-block;max-width:100%;font:500 17px/1.4 var(--chapter-font);overflow-wrap:anywhere}
.saved-bookmark p{margin:4px 0 0;font-size:12px}
.saved-empty,.saved-unavailable{font-size:13px;margin:15px 0}
.saved-note{padding:17px 0;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
.saved-note h3{font-size:15px;line-height:1.45;margin:0 0 8px}
.saved-note blockquote{font:15px/1.6 var(--chapter-font);padding:0 0 0 13px;margin:10px 0;border-left:2px solid var(--accent);white-space:pre-wrap;overflow-wrap:anywhere}
.saved-note>p{margin:9px 0;font-size:14px;white-space:pre-wrap}
.saved-note>a{display:inline-flex;padding:7px 0;font-size:13px;font-weight:650}
.saved-note .saved-availability{font-size:12px;color:var(--secondary)}
.saved-quote-toggle{display:inline-flex;align-items:center;min-height:38px;
 padding:7px 0;margin:0 0 5px;border:0;background:transparent;
 font:650 12px/1.5 var(--ui-font);color:var(--accent);cursor:pointer}
.saved-quote-toggle:hover{text-decoration:underline}
#saved-warning{font-size:13px;color:var(--secondary);white-space:pre-wrap}
#saved-passage-retry{
 display:inline-flex;align-items:center;min-height:44px;padding:9px 14px;
 border:1px solid var(--line);border-radius:7px;background:var(--accent-soft);
 color:var(--ink);font:650 13px/1.4 var(--ui-font)
}
#saved-passage-retry[hidden]{display:none}
#saved-more-notes{margin:20px 0 0;background:var(--accent-soft);border:1px solid var(--line);border-radius:7px;padding:12px 15px;min-height:44px}
.saved-chapter-return{display:inline-flex;margin-bottom:12px;color:var(--accent);font:650 12px/1.5 var(--ui-font)}
@media(max-width:520px){.home-topline{gap:8px}.home-topline nav>a{font-size:12px}.saved-intro{padding:37px 0 28px}.saved-section-heading h2{font-size:23px}.saved-note blockquote{font-size:14px}}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;transition:none!important}
}

/* Explicit recovery in catalogue, not between story text and chapter navigation. */
.reading-recovery{margin:30px 0 0;padding:16px 0;border-top:1px solid var(--line);font:14px/1.5 var(--ui-font)}
.reading-recovery summary{display:flex;align-items:center;min-height:44px;font-weight:650;color:var(--secondary)}
.reading-recovery summary::after{content:'▸';margin-left:auto;padding:0 7px;color:var(--accent);font-size:17px}
.reading-recovery[open] summary::after{content:'▾'}
.recovery-panel{display:grid;gap:12px;max-width:540px;padding:8px 0 16px}
.recovery-panel p{margin:0;color:var(--secondary)}
.recovery-panel button{min-height:44px;border:1px solid var(--line);padding:9px 12px;border-radius:6px;background:var(--accent-soft);color:var(--ink)}
.recovery-panel button:disabled{opacity:.5}
.recovery-panel input,.recovery-panel select{font:inherit;max-width:100%}
.recovery-original{display:flex;flex-wrap:wrap;gap:8px}
.recovery-original select{background:var(--paper);color:var(--ink);padding:9px;flex:1 1 145px;border:1px solid var(--line)}
#backup-status{white-space:pre-line}

/* Homepage: use the first screen for reading actions, not an oversized synopsis. */
.preview-index .home-intro{padding:clamp(30px,5vw,48px) 0 26px}
.preview-index .home-intro .chapter-eyebrow{
 margin-bottom:10px;font-size:11px;letter-spacing:.11em
}
.preview-index .home-intro h1{
 max-width:100%;font-size:clamp(34px,4.5vw,50px);
 line-height:1.09;letter-spacing:-.045em;margin-bottom:10px
}
.preview-index .home-intro .home-description{
 font:400 14px/1.45 var(--ui-font);max-width:510px;
 margin:0;color:var(--secondary)
}
.preview-index .home-actions{gap:10px;margin-top:21px}
.preview-index .home-actions a{
 padding:10px 15px;min-height:44px;font-size:13px
}
.preview-index .home-library{border-top:1px solid var(--line);padding-top:19px}
.preview-index .library-heading{align-items:center}
.preview-index .library-heading h2{font-size:27px}
.preview-index .library-tools{margin-top:12px}
.preview-index .library-count{margin:10px 0 5px}
.preview-index .chapter-more{
 width:100%;min-height:46px;margin-top:12px;
 padding:10px 16px;border:1px solid var(--line);border-radius:8px;
 background:var(--paper);color:var(--accent);
 font:650 13px/1.45 var(--ui-font);cursor:pointer
}
.preview-index .chapter-more:hover{border-color:var(--accent)}
.preview-index .chapter-more:focus-visible{
 outline:2px solid var(--accent);outline-offset:3px
}
.preview-index .chapter-more[hidden]{display:none}
@media(max-width:520px){
 .preview-index .preview-list{padding:0 18px 55px}
 .preview-index .home-topline{min-height:58px;padding:8px 0;gap:7px}
 .preview-index .home-topline nav{gap:7px}
 .preview-index .home-topline nav>a{
  min-height:42px;font-size:12px;padding:0 3px
 }
 .preview-index .home-intro{padding:25px 0 23px}
 .preview-index .home-intro h1{
  font-size:clamp(32px,9vw,40px);line-height:1.11
 }
 .preview-index .home-intro .home-description{
  font-size:13px;line-height:1.45
 }
 .preview-index .home-actions{
  margin-top:15px;gap:8px
 }
 .preview-index .home-actions a{
  min-height:44px;padding:9px 12px;font-size:13px
 }
 .preview-index .home-library{padding-top:15px}
 .preview-index .library-heading h2{font-size:25px}
 .preview-index .library-heading>span{font-size:11px}
 .preview-index .library-tools{margin-top:12px;gap:8px}
 .preview-index .library-tools input,
 .preview-index .library-tools select{min-height:44px}
 .preview-index .preview-list li a{
  min-height:65px;padding:10px 2px;gap:12px
 }
 .preview-index .library-entry-identity{gap:2px}
 .preview-index .library-entry-title{font-size:16px}
 .preview-index .library-entry-arrow{font-size:18px}
}

/* Unified navigation: meaningful destinations and one-tap theme everywhere. */
.home-topline nav #theme-toggle,
.site-header nav #theme-toggle{
 flex:0 0 42px;min-width:42px;min-height:44px;
 border:1px solid var(--line);border-radius:9px;
 color:var(--accent);background:var(--accent-soft);
 font:600 19px/1 var(--ui-font);display:inline-flex;
 justify-content:center;align-items:center;
 padding:0;cursor:pointer
}
.home-topline nav #theme-toggle:hover,
.site-header nav #theme-toggle:hover{border-color:var(--accent)}
.reader-home .home-intro{padding-top:clamp(40px,7vw,80px)}
.reader-home .home-actions{margin-bottom:18px}
.library-index .home-library{
 border-top:0; padding-top:34px;scroll-margin-top:0
}
.library-index .library-heading h1{
 margin:0;font:500 clamp(35px,5vw,50px)/1.15 var(--chapter-font)
}
.home-topline .site-logo[aria-current="page"]{color:var(--accent)}
@media(max-width:640px){
 .site-header{flex-wrap:wrap;row-gap:0}
 .site-header nav{flex:1 1 100%;justify-content:space-between;gap:3px;flex-wrap:wrap}
 .site-header nav>a,.site-header nav>button{font-size:12px;min-height:44px}
 .site-header nav #theme-toggle{min-width:42px}
 .library-index .home-library{padding-top:25px}
 .reader-home .home-intro{padding-top:clamp(35px,11vw,58px)}
 .home-topline nav{gap:4px}
 .home-topline nav>a{padding:0 1px}
 .home-topline nav #theme-toggle{min-width:42px}
}
/* Keep chapter prose high on 320px screens even with the extra theme action. */
@media(max-width:640px){
 .reading-shell{padding-top:5px}
 .chapter-header{margin-bottom:9px}
 .chapter-context{margin-bottom:5px;padding-bottom:5px}
}
@media(max-width:360px){
 .home-topline .site-logo span{display:none}
 .preview-index .home-topline{flex-wrap:wrap;row-gap:2px}
 .preview-index .home-topline nav{
  flex:1 1 auto;min-width:0;flex-wrap:wrap;
  justify-content:flex-end;column-gap:3px;row-gap:1px
 }
 .home-topline nav>a{font-size:11px;padding:0 1px}
 .home-topline nav #theme-toggle{min-width:38px;flex-basis:38px;min-height:40px}
}

/* Resume-first Home. Progress is derived from the existing recorded
 * chapter/paragraph anchor, never estimated as a made-up percentage. */
.reader-home .home-reading-card{
 max-width:620px;border:1px solid var(--line);
 background:var(--paper);border-radius:12px;
 padding:clamp(18px,4vw,25px);margin:24px 0 8px
}
.reader-home .home-reading-card[hidden]{display:none}
.reader-home .home-reading-card .chapter-eyebrow{
 margin:0 0 10px;font-size:10px;letter-spacing:.11em
}
.reader-home .home-reading-card h2{
 margin:8px 0 18px;max-width:550px;
 font:500 clamp(22px,4vw,31px)/1.2 var(--chapter-font)
}
.reader-home .home-reading-progress{
 font:550 12px/1.6 var(--ui-font);color:var(--secondary);margin:0
}
.reader-home .home-reading-card .home-primary{
 display:inline-flex;min-height:44px;align-items:center;
 padding:10px 16px;border-radius:7px;background:var(--accent);
 color:var(--paper);font:700 13px/1.4 var(--ui-font);
 text-decoration:none
}
.reader-home .home-reading-card .home-primary[hidden]{display:none}
.reader-home .home-reading-card .home-primary:focus-visible{
 outline:2px solid var(--accent);outline-offset:3px
}
@media(max-width:520px){
 .reader-home .home-reading-card{padding:18px;margin:19px 0 7px}
 .reader-home .home-reading-card h2{font-size:24px;margin:6px 0 13px}
 .reader-home .home-reading-progress{font-size:12px}
}

/* Library chapter ranges: quick, bounded navigation without extra catalogue. */
.library-index .library-tools #chapter-range{width:155px}
@media(max-width:520px){
 .library-index .library-tools input{
  flex:1 1 100%;width:100%
 }
 .library-index .library-tools #chapter-view,
 .library-index .library-tools #chapter-range{
  flex:1 1 calc(50% - 5px);
  width:calc(50% - 5px);
  min-width:0
 }
}

/* Chapter jump replaces the static chapter-number label, without another toolbar. */
@media(max-width:640px){
 /* One compact two-row context; keep first prose visible at 320px. */
 .chapter-context{
  display:grid;grid-template-columns:minmax(0,1fr) auto;
  grid-template-rows:auto auto;gap:0 8px;align-items:center
 }
 .chapter-context .series-name{grid-column:1;grid-row:1}
 /* A saved bookmark label is wider than "Bookmark"; keep chapter arrows
    on their own full-width row instead of letting controls overlap. */
 .chapter-context .chapter-meta{grid-column:1 / -1;grid-row:2;gap:6px}
 /* Keep the same full touch targets in this later mobile override. */
 .chapter-top-nav a{width:44px;height:44px}
 .bookmark-toggle{grid-column:2;grid-row:1;margin-left:0}
}

/* Shown only when browser storage refuses to preserve reading state. */
.reader-save-warning{
 position:fixed;z-index:90;bottom:calc(12px + env(safe-area-inset-bottom));
 left:50%;transform:translateX(-50%);width:min(540px,calc(100vw - 24px));
 margin:0;padding:12px 15px;border:1px solid var(--line);border-radius:9px;
 background:var(--paper);color:var(--ink);box-shadow:0 10px 32px #0005;
 font:600 13px/1.5 var(--ui-font);
}

/* Only shown when existing site reading history is detected. */
.home-history-notice[hidden]{display:none}
.home-history-notice{margin-top:19px;padding:14px 17px;border:1px solid var(--line);border-radius:8px;background:var(--accent-soft)}
.home-history-notice p{margin:0 0 6px!important;color:var(--ink);font:600 13px/1.5 var(--ui-font)}
.home-history-notice a{display:inline-block;min-height:36px;padding:7px 0;color:var(--accent);font:700 13px/1.5 var(--ui-font)}

/* Stronger Library: 25-chapter disclosures in a two-column desktop catalogue.
 * Source ordering, read state and bookmarks are shared with the normal reader. */
.library-index .preview-list{max-width:1160px}
.library-index .library-tools{display:flex;align-items:end;flex-wrap:wrap;gap:13px}
.library-index .library-tools>input{flex:1 1 330px}
.library-jump{display:flex;flex:0 1 225px;flex-direction:column;gap:5px}
.library-jump label{font:650 12px/1.3 var(--ui-font);color:var(--secondary)}
.library-jump .chapter-jump-controls{display:flex;gap:5px}
.library-jump .chapter-jump-controls input{width:100%;min-width:0;min-height:44px}
.library-jump .chapter-jump-controls button{min-height:44px}
.library-filter-bar{display:flex;align-items:center;justify-content:space-between;
 flex-wrap:wrap;gap:12px;margin:15px 0}
.library-filters,.library-group-actions{display:flex;flex-wrap:wrap;gap:5px}
.library-filter,.library-group-actions button{min-height:44px;padding:9px 12px;
 border:1px solid var(--line);border-radius:8px;background:var(--paper);
 color:var(--secondary);font:650 13px/1.3 var(--ui-font)}
.library-filter[aria-pressed="true"]{background:var(--accent-soft);
 color:var(--accent);border-color:var(--accent)}
.library-group-actions button:hover,.library-filter:hover{border-color:var(--accent)}
.library-index #chapter-range{min-height:44px;padding:8px 10px;width:auto;
 border:1px solid var(--line);border-radius:8px;background:var(--paper);
 color:var(--ink);font:600 12px/1.3 var(--ui-font)}
#chapter-list.library-groups{border:0;display:grid;align-items:start;
 grid-template-columns:repeat(2,minmax(0,1fr));gap:13px 18px}
#chapter-list>.library-range-item{min-width:0;list-style:none}
#chapter-list>.library-range-item[hidden]{display:none}
.library-group{border:1px solid var(--line);border-radius:10px;
 background:var(--paper);overflow:hidden}
.library-group>summary{display:flex;align-items:center;justify-content:space-between;
 gap:8px;min-height:56px;padding:11px 15px;cursor:pointer;
 color:var(--ink);font:700 14px/1.3 var(--ui-font)}
.library-group>summary::marker{color:var(--accent)}
.library-group>summary:hover,.library-group[open]>summary{background:var(--accent-soft)}
.library-group-count{font:550 11px/1.3 var(--ui-font);color:var(--secondary);white-space:nowrap}
.library-group-entries{border-top:1px solid var(--line)!important}
.library-group-entries .library-entry{display:flex;align-items:center;
 padding:0 10px 0 0;min-width:0;border-bottom:1px solid var(--line)}
.library-group-entries .library-entry:last-child{border-bottom:0}
.library-group-entries .library-entry[hidden]{display:none}
/* A returned chapter row can receive programmatic focus after mouse
 * navigation, where :focus-visible is not guaranteed. Keep the destination
 * easy to spot in both themes without adding another control or animating
 * the full catalogue. Keyboard outlines remain unchanged. */
.library-index .library-group-entries .library-entry:focus-within{
 background:var(--accent-soft)
}
.library-index .library-group-entries .library-entry>a{
 flex:1;min-width:0;border-bottom:0;min-height:56px;padding:9px 12px}
.library-index .library-group-entries .library-entry-title{font-size:15px}
.library-index .library-group-entries .library-entry-number{font-size:11px}
.library-entry-bookmark{flex:0 0 44px;min-width:44px;min-height:44px;
 border:0;border-radius:7px;background:transparent;color:var(--secondary);
 font-size:22px;line-height:1}
.library-entry-bookmark[aria-pressed="true"],.library-entry-bookmark:hover{
 background:var(--accent-soft);color:var(--accent)}
@media(max-width:720px){
 #chapter-list.library-groups{grid-template-columns:1fr}
 .library-jump{flex:1 1 160px}
 .library-index .library-group-entries .library-entry>a{min-height:57px}
}

/* Persistent chapter controls: keep navigation, Jump, Focus and Aa accessible
 * while scrolling; normal Focus mode intentionally hides the header. */
body[data-chapter]{background:var(--paper)}
body[data-chapter] .reading-shell{background:transparent;box-shadow:none;
 border:0;border-radius:0}
.site-header{position:sticky;top:0;z-index:50;background:var(--paper);
 border-bottom:1px solid var(--line)}
.toolbar-jump{position:relative}
.toolbar-jump>summary{list-style:none;display:flex;align-items:center;
 justify-content:center;min-height:44px;padding:0 9px;
 font:650 13px/1.4 var(--ui-font);color:var(--accent)}
.toolbar-jump>summary::-webkit-details-marker{display:none}
.toolbar-jump>form{position:absolute;right:0;top:calc(100% + 8px);
 width:225px;max-width:calc(100vw - 25px);padding:14px;z-index:80;
 border:1px solid var(--line);border-radius:10px;background:var(--paper);
 box-shadow:0 16px 40px #0004}
.toolbar-jump label{display:block;margin-bottom:8px;font:650 12px/1.3 var(--ui-font)}
.toolbar-jump [role="status"]{font-size:12px;color:var(--secondary)}
.chapter-header,.chapter-prose{scroll-margin-top:80px}
@media(max-width:640px){
 .site-header{padding-top:2px;padding-bottom:2px}
 .toolbar-jump>summary{min-height:44px;padding:0 6px;font-size:12px}
 .site-header nav{row-gap:0}
}

/* Third, pre-existing reader theme restored without changing the default. */
:root[data-look="warm"]{
 color-scheme:light;--page:#ede4d7;--paper:#fff8ec;--ink:#40352c;
 --secondary:#675a4a;--line:#dccfbd;--accent:#775333;--accent-soft:#f1e3ce
}

/* Compact persistent controls on phones without sacrificing the keyboard/
 * pointer exits or burying Aa/Focus behind an overflow drawer. */
@media(max-width:640px){
 body[data-chapter] .site-header{align-items:center;gap:5px}
 body[data-chapter] .site-header .site-logo{flex:0 0 auto;
   display:inline-flex;align-items:center;justify-content:center;
   min-height:44px;min-width:44px;
   padding:2px 0;font-size:13px;line-height:1.3}
 body[data-chapter] .site-header .site-logo span{display:none}
 body[data-chapter] .site-header nav{flex:1 1 auto;min-width:0;
   justify-content:flex-end;column-gap:4px;row-gap:0}
 body[data-chapter] .site-header nav>a,
 body[data-chapter] .site-header nav>button,
 body[data-chapter] .site-header nav>details>summary{
   font-size:12px;min-width:44px;min-height:44px;padding-inline:4px}
 body[data-chapter] .site-header nav>button{min-width:44px}
 body[data-chapter] .site-header .appearance summary{font-size:16px}
 body[data-chapter] .site-header #theme-toggle{min-width:40px}
}
/* Seven real reader actions and the logo cannot reliably occupy one
   320–390px row. Restore the earlier flexible two-stage arrangement:
   direct controls remain visible/tappable, never off the right edge.
   Wider devices keep the compact single-row header. */
@media(max-width:460px){
 body[data-chapter] .site-header{
  flex-wrap:wrap;row-gap:0;padding-inline:clamp(10px,3vw,17px)
 }
 body[data-chapter] .site-header nav{
  flex:1 1 100%;min-width:0;justify-content:space-between;
  flex-wrap:wrap;column-gap:5px;row-gap:0
 }
}

/* The single Jump control is in persistent chapter navigation. The shared
 * form styles also serve the Library's direct chapter picker. */
.chapter-jump-controls{display:flex;gap:7px}
.chapter-jump-controls input{
 width:100%;min-width:0;min-height:44px;
 padding:9px 11px;border:1px solid var(--line);border-radius:6px;
 background:var(--paper);color:var(--ink);
 font:600 16px/1 var(--ui-font)
}
.chapter-jump-controls button{
 min-height:44px;padding:8px 14px;border:0;border-radius:6px;
 background:var(--accent);color:var(--paper);font:700 13px/1 var(--ui-font)
}


/* Small-screen chapter chrome reveals when it is needed instead of occupying
 * the reading viewport permanently. Large screens keep persistent navigation. */
@media(max-width:720px){
 /* A permanent will-change:transform makes this sticky header a containing
    block for fixed Aa overlays. Native focus scrolling of their controls can
    then move the story after its reading-line correction. Let the actual
    hide/reveal transition manage compositing instead. */
 body[data-chapter] .site-header{transition:transform .18s ease-out}
 body[data-chapter] .site-header.site-header-hidden{
  transform:translateY(calc(-100% - env(safe-area-inset-top)))
 }
 /* Reveal keyboard-focused controls before the browser scrolls their
    translated rectangle into view. Animating this reveal moves the story
    backward before Aa can preserve its current paragraph. */
 body[data-chapter] .site-header:focus-within{
  transform:none;transition:none
 }
}
@media(prefers-reduced-motion:reduce){
 body[data-chapter] .site-header{transition:none}
}

/* Restore a direct escape from an empty filtered catalogue. */
#library-clear{display:inline-flex;align-items:center;min-height:44px;
 margin-left:8px;padding:8px 12px;border:1px solid var(--line);
 border-radius:8px;background:var(--accent-soft);color:var(--accent);
 font:650 12px/1.4 var(--ui-font)}
#library-clear:hover{border-color:var(--accent)}

/* Existing series introduction: make arrival useful without duplicate actions. */
.reader-home .home-intro .home-series-lede{
 max-width:38ch;margin:0 0 12px;color:var(--ink);
 font:500 clamp(18px,2.5vw,22px)/1.4 var(--chapter-font)
}
.reader-home .home-intro .home-description{
 max-width:62ch;color:var(--secondary);
 font:400 14px/1.65 var(--ui-font)
}
@media(max-width:520px){
 .reader-home .home-intro .home-series-lede{font-size:18px;line-height:1.38;margin-bottom:9px}
 .reader-home .home-intro .home-description{font-size:13px;line-height:1.55}
}

/* One collapsed catch-up utility in Library, never on chapter-reading pages. */
.library-bulk{margin:8px 0 15px;border-top:1px solid var(--line);
 border-bottom:1px solid var(--line);color:var(--secondary);font:13px/1.5 var(--ui-font)}
.library-bulk>summary{cursor:pointer;min-height:44px;display:flex;align-items:center;font-weight:650}
#library-bulk-form{padding:3px 0 15px}
#library-bulk-form>label{display:block;margin-bottom:7px;font-weight:650}
.library-bulk-controls{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.library-bulk-controls input{min-width:120px;max-width:190px;min-height:44px;
 padding:8px 12px;border:1px solid var(--line);border-radius:7px;background:var(--paper);color:var(--ink);font:inherit}
.library-bulk-controls button{min-height:44px;padding:9px 12px;border:1px solid var(--line);
 border-radius:7px;background:var(--accent-soft);color:var(--ink);font:650 13px var(--ui-font)}
.library-bulk-help{font-size:12px;color:var(--secondary)}
#library-bulk-status{min-height:18px;color:var(--secondary)}

/* Useful old Notes gallery search, confined to Saved. Never alters or
 * re-serializes original backup bytes. */
#saved-note-search{display:block;max-width:580px;width:100%;min-height:44px;
 margin:7px 0 15px;padding:10px 13px;border:1px solid var(--line);
 border-radius:8px;background:var(--paper);color:var(--ink);
 font:14px var(--ui-font)}

/* Source-hash-verified author notes: italic normal-color text, quiet divider.
 * No invented heading, card, or changed paragraph anchors. */
.chapter-prose .prose > .verified-author-note-body{
 color:inherit;font-style:italic
}
.chapter-prose .prose > .verified-author-note-start{
 margin-top:1.8em;padding-top:1em;border-top:1px solid var(--line)
}
.chapter-prose .prose > .verified-author-note-start.verified-note-after-rule{
 border-top:0;padding-top:0;margin-top:.6em
}
.chapter-prose .prose > .verified-note-opening,
.chapter-prose .prose > .verified-note-opening-prelude{
 color:inherit;font-style:italic
}
.chapter-prose .prose > .verified-note-opening{margin-bottom:1em}
.chapter-prose .prose > .verified-note-source-divider{border-color:var(--line)}
.chapter-prose .prose .verified-inline-note{
 color:inherit;font-style:italic;display:block;
 margin-top:.85em;padding-top:.85em;border-top:1px solid var(--line);
 white-space:pre-wrap
}

/* The source has no rule for these verified author-note openings; add one
 * quiet story-facing divider without duplicating existing source rules. */
.chapter-prose .prose > .verified-note-opening.verified-note-needs-divider{
 border-bottom:1px solid var(--line);padding-bottom:.9em;margin-bottom:1.25em
}

/* Explicit reading-motion choice complements (never overrides) OS setting. */
:root[data-motion="reduced"] *, :root[data-motion="reduced"] *::before,
:root[data-motion="reduced"] *::after{
 scroll-behavior:auto!important;animation-duration:.01ms!important;
 transition-duration:0s!important
}

/* Existing Jump's title suggestions sit inside the same compact disclosure. */
.reader-jump-options[hidden]{display:none}
.reader-jump-options{max-height:min(280px,45dvh);overflow-y:auto;
 border-top:1px solid var(--line);margin-top:9px;padding-top:5px}
.reader-jump-options button{display:block;width:100%;min-height:42px;
 text-align:left;padding:8px;border:0;border-radius:6px;background:transparent;
 font:550 12px/1.4 var(--ui-font);color:var(--ink);white-space:normal}
.reader-jump-options button.selected,.reader-jump-options button:hover,
.reader-jump-options button:focus-visible{background:var(--accent-soft)}

/* Saved comment controls are reader-owned overlays; imported JSON is immutable. */
.saved-note-actions,.saved-note-editor,.saved-note-feedback{
 display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:11px 0 0}
.saved-note-actions button,.saved-note-editor button,
.saved-note-feedback button,#saved-hidden-toggle,#saved-clear-progress{
 min-height:42px;padding:9px 12px;border:1px solid var(--line);
 border-radius:7px;background:var(--accent-soft);color:var(--accent);
 font:650 12px/1.35 var(--ui-font)}
.saved-note-editor[hidden],#saved-note-undo[hidden],#saved-hidden-toggle[hidden]{display:none}
.saved-note-editor textarea{width:100%;min-height:96px;resize:vertical;
 border:1px solid var(--line);border-radius:7px;padding:10px;
 color:var(--ink);background:var(--paper);font:14px/1.5 var(--ui-font)}
.saved-note-feedback p{flex:1 1 220px;font-size:12px;color:var(--secondary)}

/* Compact Library and responsive Home: visual-only, no reading-state changes. */
.reader-home .preview-list{max-width:1140px}
.reader-home .home-intro{display:grid;
 grid-template-columns:minmax(0,1.1fr) minmax(290px,.85fr);
 align-items:start;column-gap:clamp(22px,4.5vw,56px);row-gap:10px;
 padding:clamp(27px,4vw,46px) 0 28px}
.reader-home .home-copy{grid-column:1;grid-row:1;min-width:0}
.reader-home .home-copy h1{max-width:620px}
.reader-home .home-description-column{grid-column:1;grid-row:2;min-width:0}
.reader-home .home-reading-column{grid-column:2;grid-row:1 / span 2;min-width:0;padding-top:4px}
.reader-home .home-reading-card{width:100%;max-width:none;margin:0 0 12px}
.reader-home .home-reading-card h2{
 font-size:clamp(21px,2.7vw,29px);
 /* The full chapter title is still readable, but comes AFTER the Resume
    action. Long published names must not bury the only reading CTA. */
 margin:12px 0 0
}
.reader-home .home-reading-column .home-actions{margin:10px 0 0}
.reader-home .home-history-notice{grid-column:1/-1;max-width:680px;margin-top:0}
@media(max-width:800px){
 .reader-home .home-intro{grid-template-columns:minmax(0,1fr);gap:16px;padding:26px 0 28px}
 .reader-home .home-copy,.reader-home .home-reading-column,
 .reader-home .home-description-column{grid-column:1;grid-row:auto}
 .reader-home .home-reading-column{padding-top:0}
 .reader-home .home-reading-card{margin:0 0 10px}
 .reader-home .home-copy h1{max-width:none}
}
@media(max-width:520px){
 .reader-home .home-intro{gap:14px;padding-top:20px}
 .reader-home .home-reading-column .home-actions{margin-top:9px}
}
.library-index .home-library{padding-top:clamp(12px,2vw,21px)}
.library-index .library-heading h1{font-size:clamp(32px,3.2vw,42px)}
#library-locate-current{
 min-height:40px;padding:7px 2px;border:0;background:transparent;
 color:var(--accent);font:650 12px/1.4 var(--ui-font);
 cursor:pointer;text-align:left
}
#library-locate-current:hover{text-decoration:underline}
#library-locate-current[hidden]{display:none}
@media(max-width:520px){
 .library-index .library-heading{align-items:center;gap:7px 12px}
 #library-locate-current{min-height:40px;font-size:12px}
}
.library-index .library-tools{gap:10px;margin-top:12px}
.library-index .library-tools>input{min-height:44px}
.library-index .library-filter-bar{gap:9px;margin:10px 0 8px}
.library-index .library-filters,.library-index .library-group-actions{gap:5px}
.library-index .library-filter,.library-index .library-group-actions button{
 min-height:40px;padding:8px 11px}
.library-index #chapter-range{min-height:40px}
.library-index .library-count{margin:9px 0 9px}
#chapter-list.library-groups{gap:10px 13px}
.library-group>summary{min-height:52px;padding:9px 15px}
.library-group>summary:focus-visible{outline:2px solid var(--accent);outline-offset:-3px}
@media(min-width:721px){
 #chapter-list.library-groups>.library-range-item:has(.library-group[open]){grid-column:1/-1}
 .library-group[open]>.library-group-entries{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
 .library-group[open]>.library-group-entries .library-entry{
  min-width:0;border-bottom:1px solid var(--line)}
}
.library-index .library-bulk{margin:23px 0 6px;border-top:1px solid var(--line);border-bottom:0}
.library-index .library-bulk>summary{color:var(--secondary);font-size:12px}
@media(max-width:720px){
 .library-index .library-filter,.library-index .library-group-actions button,
 .library-index #chapter-range{min-height:44px}
 #chapter-list.library-groups{gap:8px}
 .library-group>summary{min-height:50px}
}

/* Previous-reading transfer stays discoverable without a large colored card. */
.reader-home .home-history-notice{
 border:0;border-top:1px solid var(--line);border-radius:0;
 background:transparent;padding:10px 0;max-width:100%;margin:2px 0 0
}
.reader-home .home-history-notice p{
 display:inline;margin:0 12px 0 0!important;font-weight:550;font-size:12px
}
.reader-home .home-history-notice a{
 display:inline;min-height:0;padding:0;font-size:12px
}

/* Keep common finding on one field; optional catalogue operations stay nearby. */
.library-index .library-tools{display:block}
.library-index .library-find{display:flex;align-items:stretch;gap:8px;width:100%}
.library-index .library-find input{flex:1 1 auto;min-width:0;min-height:44px;
 padding:11px 13px;border:1px solid var(--line);border-radius:7px;
 background:var(--paper);color:var(--ink);font:14px var(--ui-font)}
.library-index .library-find button{flex:0 0 auto;min-width:48px;min-height:44px;
 padding:9px 12px;border:0;border-radius:7px;background:var(--accent);
 color:var(--paper);font:700 13px var(--ui-font)}
.library-index #library-jump-status:not([hidden]){margin:7px 0 0;
 font:550 12px/1.4 var(--ui-font);color:var(--secondary)}
.library-more-controls{flex:0 0 auto;margin-left:auto}
.library-more-controls>summary{list-style:none;display:flex;align-items:center;
 min-height:44px;padding:8px 12px;border:1px solid var(--line);
 border-radius:8px;background:var(--paper);color:var(--secondary);
 font:650 12px/1.35 var(--ui-font)}
.library-more-controls>summary::-webkit-details-marker{display:none}
.library-more-inner{display:flex;flex-wrap:wrap;align-items:center;gap:8px;
 margin:8px 0 2px;padding:9px;border:1px solid var(--line);border-radius:8px}
@media(max-width:720px){
 .library-index .library-filter-bar{align-items:center}
 .library-index .library-filters{flex-wrap:wrap;min-width:0;max-width:100%;gap:5px}
 .library-index .library-filter{padding-inline:8px;font-size:12px}
 .library-more-controls{flex:1 1 100%;margin-left:0}
 .library-more-controls>summary{min-height:36px;display:inline-flex;
  padding:5px 9px;border:0;background:transparent;font-size:12px}
}

/* A single chapter-toolbar row on ordinary phones means more readable prose.
 * Reader-primary Library, Jump, Focus, Aa stay visible; Search/Saved remain
 * ordinary links under More; theme is still in Aa, quick toggle stays desktop. */
.reader-more{display:none;position:relative}
.reader-more>summary{list-style:none}
.reader-more>summary::-webkit-details-marker{display:none}
.reader-more-panel{
 position:absolute;right:0;top:calc(100% + 3px);z-index:85;
 display:grid;gap:2px;width:175px;max-width:calc(100vw - 18px);
 padding:7px;border:1px solid var(--line);border-radius:9px;
 background:var(--paper);box-shadow:0 15px 35px #0003
}
.reader-more-panel a{
 display:flex;align-items:center;min-height:44px;padding:9px 13px;
 border-radius:6px;color:var(--ink);font:650 13px/1.3 var(--ui-font)
}
.reader-more-panel a:hover,.reader-more-panel a:focus-visible{
 text-decoration:none;background:var(--accent-soft)
}
@media(max-width:640px){
 body[data-chapter] .site-header{
  flex-wrap:wrap;gap:5px;padding-inline:clamp(9px,2.6vw,18px)
 }
 body[data-chapter] .site-header nav{
  flex:1 1 auto;min-width:0;flex-wrap:wrap;
  justify-content:space-between;column-gap:2px;row-gap:0
 }
 body[data-chapter] .site-header nav>.reader-desktop-link,
 body[data-chapter] .site-header nav>#theme-toggle{display:none}
 body[data-chapter] .site-header nav>.reader-more{display:block}
 body[data-chapter] .site-header nav>.reader-more>summary{
  display:flex;align-items:center;justify-content:center;
  min-height:44px;padding:0 4px;color:var(--accent);
  font:650 12px/1.35 var(--ui-font)
 }
 body[data-chapter] .site-header .site-logo{
  flex:0 0 auto;margin-right:5px
 }
}


/* Mobile chapter navigation overlays must stay within the reader viewport.
 * An absolute Jump box attached to its narrow toolbar label extends left of
 * the screen at 320/390px. At high zoom, Aa can also become unreachable. */
@media(max-width:520px){
 body[data-chapter] .toolbar-jump>form{
  position:fixed;
  top:var(--reader-menu-top,calc(60px + env(safe-area-inset-top)));
  left:12px;right:12px;width:auto;max-width:none;
  max-height:calc(100dvh - var(--reader-menu-top,60px) - 14px);
  overflow-y:auto;overscroll-behavior:contain
 }
}
/* At 320-390px Aa is anchored to a narrow toolbar button close to the
 * viewport's centre; its 235px + padding popover can extend off the LEFT.
 * Use a viewport-bounded, internally scrollable panel below the two-row
 * chapter header, including phones zoomed to smaller CSS viewports. */
@media(max-width:460px){
 body[data-chapter] .appearance-panel{
  position:fixed;
  top:var(--reader-menu-top,calc(102px + env(safe-area-inset-top)));
  left:12px;right:12px;width:auto;max-width:none;
  max-height:calc(100dvh - var(--reader-menu-top,102px) - 14px);
  overflow-y:auto;overscroll-behavior:contain
 }
}
@media(max-width:310px){
 body[data-chapter] .toolbar-jump>form{
  position:fixed;
  top:var(--reader-menu-top,calc(102px + env(safe-area-inset-top)));
  left:8px;right:8px;width:auto;max-width:none;
  max-height:calc(100dvh - var(--reader-menu-top,102px) - 14px);
  overflow-y:auto;overscroll-behavior:contain
 }
 body[data-chapter] .appearance-panel{left:8px;right:8px}
}
@media(max-width:240px){
 body[data-chapter] .chapter-context .chapter-meta{flex-wrap:wrap}
 body[data-chapter] .toolbar-jump>form,
 body[data-chapter] .appearance-panel,
 body[data-chapter] .reader-more-panel{
  position:fixed;left:8px;right:8px;
  top:var(--reader-menu-top,calc(128px + env(safe-area-inset-top)));
  width:auto;max-width:none;
  max-height:calc(100dvh - var(--reader-menu-top,128px) - 14px);
  overflow-y:auto;overscroll-behavior:contain
 }
}

/* Compact all-page phone navigation and passage search without hiding the
 * three main sections. At high zoom below 300 CSS px, the existing wrapping
 * fallback remains accessible instead of squeezing touch targets. */
@media (min-width:300px) and (max-width:520px){
 .preview-index .home-topline{flex-wrap:nowrap;row-gap:0;gap:5px}
 .preview-index .home-topline nav{
  flex:0 1 auto;min-width:0;justify-content:flex-end;
  gap:clamp(2px,1vw,6px)
 }
 .preview-index .home-topline nav>a{padding:0 1px;font-size:12px}
 .preview-index .home-topline nav #theme-toggle{
  flex:0 0 44px;width:44px;min-width:44px;padding:0
 }
 .preview-index .passage-query-row{flex-wrap:nowrap;gap:7px}
 .preview-index .passage-query-row button{
  width:auto;min-width:73px;flex:0 0 auto;padding-inline:10px
 }
}


/* Saved at enlarged phone/browser zoom: notes, bookmark counts and original
 * recovery controls must reflow without creating sideways scrolling.
 * This changes presentation only; backup bytes and editor state stay intact. */
#saved-note-search{box-sizing:border-box;max-width:100%}
.recovery-panel{grid-template-columns:minmax(0,1fr);min-width:0}
.recovery-panel input,.recovery-panel select,.recovery-panel button{
 box-sizing:border-box;min-width:0;max-width:100%;overflow-wrap:anywhere
}
.recovery-original{min-width:0;max-width:100%}
@media(max-width:280px){
 .saved-section-heading{align-items:flex-start;flex-wrap:wrap;column-gap:6px}
 .saved-section-heading h2,.saved-section-heading span{
  min-width:0;max-width:100%;overflow-wrap:anywhere
 }
}


/* Library reflow for strong browser zoom on phones. Keep the ordinary
 * one-row filter bar at >=281 CSS px, but never hide status filters, range
 * choices or the source-preserving catch-up input behind horizontal scroll. */
@media(max-width:280px){
 .library-index .library-filters{flex-wrap:wrap;min-width:0;max-width:100%}
 .library-index .library-filter{flex:0 0 auto}
 .library-more-inner{min-width:0;max-width:100%}
 .library-index #chapter-range{box-sizing:border-box;max-width:100%;width:100%;min-width:0}
 .library-index .library-group>summary{
  flex-wrap:wrap;justify-content:flex-start;gap:4px;
  padding:9px 10px;align-items:flex-start
 }
 .library-index .library-group>summary span{
  min-width:0;max-width:100%;overflow-wrap:anywhere
 }
 .library-index .library-group-count{white-space:normal}
 .library-bulk-controls input{
  box-sizing:border-box;min-width:0;max-width:100%;width:100%;flex:1 1 100%
 }
 .library-bulk-controls button{max-width:100%;overflow-wrap:anywhere}
}


/* Shared navigation frame: align the Home, Library, Search, Saved and
   chapter logo/nav without widening the dedicated reading or Saved column. */
:root{
 --site-frame:1160px;
 --site-gutter:clamp(19px,4vw,44px)
}
.site-header{
 width:min(100%,var(--site-frame));
 padding-inline:var(--site-gutter)
}
.preview-index .home-topline{
 position:relative;
 left:50%;
 transform:translateX(-50%);
 width:min(calc(100vw - 2 * var(--site-gutter)),
           calc(var(--site-frame) - 2 * var(--site-gutter)))
}
.reader-home .preview-list{max-width:1160px}

/* Chapter-first visual rhythm: legible full titles, calmer quick arrows,
   a little breathing room at the first line, unchanged reading measure. */
.chapter-header h1{
 font-size:clamp(30px,3vw,36px);
 line-height:1.19;
 letter-spacing:-.025em
}
.chapter-top-nav a{border-color:transparent;color:var(--secondary)}
.chapter-top-nav a:hover,.chapter-top-nav a:focus-visible{
 border-color:var(--accent);color:var(--ink)
}
@media(max-width:640px){
 body[data-chapter] .site-header{padding-inline:var(--site-gutter)}
 .reading-shell{padding-top:8px}
 .chapter-context{margin-bottom:6px;padding-bottom:6px}
 .chapter-header{margin-bottom:15px}
 .chapter-header h1{font-size:clamp(27px,7.25vw,34px);line-height:1.19}
}
@media(max-width:360px){
 .chapter-header h1{font-size:clamp(25px,7.25vw,28px)}
}


/* Normal phone viewports can fit the five visible chapter controls and
   44px Home target on ONE line. Keep the earlier wrap below 380px (zoomed
   phones), plus the already-approved 460px+ layout and More fallback.
   This returns a full line of screen space to the actual story. */
@media(min-width:380px) and (max-width:460px){
 body[data-chapter] .site-header{
  flex-wrap:nowrap;align-items:center;gap:7px
 }
 body[data-chapter] .site-header .site-logo{
  flex:0 0 auto;margin-right:0
 }
 body[data-chapter] .site-header nav{
  flex:1 1 auto;min-width:0;flex-wrap:nowrap;
  justify-content:space-between;column-gap:3px
 }
}


/* At high browser zoom (241–300 CSS px), More may wrap to the start
   of a toolbar row. Its 175px absolute popup then projects offscreen.
   Use the existing measured header offset, as Aa/Jump already do;
   keep normal-phone anchored More and the <=240px fallback unchanged. */
@media(min-width:241px) and (max-width:300px){
 body[data-chapter] .reader-more-panel{
  position:fixed;left:8px;right:8px;
  top:var(--reader-menu-top,calc(130px + env(safe-area-inset-top)));
  width:auto;max-width:none;
  max-height:calc(100dvh - var(--reader-menu-top,130px) - 12px);
  overflow-y:auto;overscroll-behavior:contain
 }
}


/* Returning Home with very long published chapter names: keep the COMPLETE
   title after the primary Resume action but don't let the card consume most
   of a phone's opening viewport. Chapter-page headings and text stay as-is. */
.reader-home .home-reading-card h2{
 font-size:clamp(19px,2.4vw,25px);
 line-height:1.22;
 letter-spacing:-.015em;
 margin:10px 0 0
}
.reader-home .home-reading-card{
 padding:clamp(16px,3vw,21px)
}


/* The original opening commentary is quiet through italics, spacing
 * and its divider, but must retain the normal story-ink color in every theme. */
.chapter-prose .intro-author-note{
 color:inherit;
 font-size:max(14px,.88em);
 line-height:1.48;
 margin-bottom:1.3em;
 padding-bottom:.9em
}
.chapter-prose .intro-author-note p{margin-bottom:.5em}


/* Two complete tap-target rows instead of three at high browser zoom.
   The logo shares the first row with Library/Jump/Focus; Aa and More
   remain directly reachable in row two. Preserve the <=240px fallback
   and the established >=300px phone header and dropdown positioning. */
@media(min-width:241px) and (max-width:299px){
 body[data-chapter] .site-header{
  flex-wrap:nowrap;align-items:flex-start;gap:4px
 }
 body[data-chapter] .site-header nav{
  flex:1 1 0;min-width:0;flex-wrap:wrap;
  justify-content:space-between;column-gap:4px;row-gap:0
 }
}

/* Source-backed titles of 90+ characters remain complete, but use fewer
   opening lines so story prose is visible sooner. Ordinary chapter headings,
   the prose measure, notes and navigation are unchanged. */
.chapter-header h1.chapter-title-long{
 font-size:clamp(29px,2.6vw,33px);
 line-height:1.19;
 letter-spacing:-.02em
}
@media(max-width:640px){
 .chapter-header h1.chapter-title-long{
  /* On phones 90+ character titles often take 5–8 opening lines,
   * pushing the actual English story below the fold. Let the existing
   * long-title class use a quieter scale, while keeping the COMPLETE
   * approved title visible and the title at least 1px larger than the
   * reader's selected 15–24px Aa prose size. Ordinary titles unchanged. */
  font-size:max(calc(var(--prose-size) + 1px),clamp(22px,6vw,28px));
  line-height:1.2
 }
}

/* Source-approved 60–89-character chapter titles occupy an awkward
 * middle ground on phones. Normal 27–34px headings can add a fourth/fifth
 * line before the first author note or story paragraph, while the existing
 * 90+ titles already get a calmer scale. Treat these 52 medium-long names
 * with the same complete-word, no-ellipsis discipline. Only the chapter
 * h1 at phone widths changes; tablet/desktop, prose/Aa, notes, toolbar,
 * footer and Home/Library keep their approved geometry. */
@media(max-width:640px){
 .chapter-header h1.chapter-title-medium{
  font-size:max(calc(var(--prose-size) + 1px),clamp(24px,6.65vw,30px));
  line-height:1.2
 }
}

/* Explicit source-hash-verified pre-story notes: preserve every paragraph
   and distinguish the note from prose. A divider belongs only at the END,
   including Chapters188/472 with two separate opening-note paragraphs. */
.chapter-prose .prose > p.verified-prestory-note{
 color:inherit;
 font-style:italic;
 font-size:max(14px,.88em);
 line-height:1.48;
 margin-bottom:.48em
}
.chapter-prose .prose > p.verified-prestory-note-end{
 padding-bottom:.7em;
 border-bottom:1px solid var(--line);
 margin-bottom:1.15em
}

/* An author-level display:grid/flex on a disclosure's contents overrides
 * browsers' user-agent closed-details hiding (including Chromium). Aa,
 * Jump, More, the compact Library groups and backup/recovery controls must
 * never be visible or interactive until their native summary opens them.
 * Keep the existing layouts untouched when open. */
details:not([open]) > :not(summary){display:none}


/* Reader touch-target parity: the primary chapter actions already reach
 * 44 CSS pixels; secondary, normally unobtrusive actions must be just as
 * usable on phones and at large text/zoom. The closed chapter disclosures,
 * prose measure and desktop density are unchanged. */
@media(max-width:720px){
 /* Chapter Jump's matched-title rows are interactive buttons, not tiny links. */
 .reader-jump-options button{min-height:44px;font-size:13px;line-height:1.45}
 /* The seven Aa selectors previously stopped at 43px. */
 .appearance-panel select{min-height:44px}
 /* Library recovery and optional operations need the same thumb target as Go. */
 #library-locate-current{min-height:44px}
 .library-more-controls>summary{min-height:44px}
 /* Full-quote review and return-to-Saved are reading journeys too. */
 .saved-quote-toggle{min-height:44px}
 .saved-note-actions button,.saved-note-editor button,
 .saved-note-feedback button,#saved-hidden-toggle,#saved-clear-progress{
  min-height:44px
 }
 .saved-chapter-return{min-height:44px;align-items:center}
 .reader-home .home-history-notice a{
  display:inline-flex;align-items:center;min-height:44px
 }
}
@media(max-width:520px){
 /* The shared site links currently shrink to 42px on phones. */
 .preview-index .home-topline nav>a{min-height:44px}
}
@media(max-width:360px){
 /* The shared centered/translated Home frame can push its first link
    offscreen when the root is enlarged 125% on WebKit. Keep this
    narrow frame within its own column; wrap the links without clipping. */
 .preview-index .home-topline{
  position:relative;left:auto;transform:none;width:100%;
  flex-wrap:wrap;align-items:center;column-gap:6px;row-gap:0
 }
 .preview-index .home-topline nav{
  flex:1 1 100%;width:100%;min-width:0;justify-content:space-between;
  flex-wrap:wrap;column-gap:6px;row-gap:0
 }
 .home-topline nav #theme-toggle{min-height:44px}
}

/* Ordinary 320–379px phones fit the home icon and five reader actions
 * on one row; retain nav wrapping if browser text enlargement requires it. */
@media(min-width:320px) and (max-width:379px){
 body[data-chapter] .site-header{
  flex-wrap:nowrap;align-items:center;column-gap:3px;row-gap:0;
  padding-inline:9px
 }
 body[data-chapter] .site-header .site-logo{
  flex:0 0 auto;margin-right:0
 }
 body[data-chapter] .site-header nav{
  flex:1 1 auto;width:auto;min-width:0;
  flex-wrap:wrap;justify-content:space-between;column-gap:2px;row-gap:0
 }
 body[data-chapter] .site-header nav>a,
 body[data-chapter] .site-header nav>button,
 body[data-chapter] .site-header nav>details>summary{
  flex-shrink:0
 }
}


/* Readable chapter entrance down to 260 CSS px (including strong
 * browser zoom). At 260–319px the old two-row series label and text
 * bookmark waste a full 44px before the first English story line.
 * Actual source-style Chromium geometry confirms the 44px Previous/Next
 * arrows, chapter number and 44px bookmark fit without collision from
 * 260px onward; below that retain the existing safe multi-row fallback.
 * Keep native accessible bookmark label/pressed state and complete prose. */
@media(min-width:260px) and (max-width:640px){
 body[data-chapter] .chapter-context{
  display:flex;align-items:center;justify-content:space-between;
  flex-wrap:nowrap;gap:6px
 }
 body[data-chapter] .chapter-context .series-name{display:none}
 body[data-chapter] .chapter-context .chapter-meta{
  display:flex;min-width:0;gap:6px
 }
 body[data-chapter] .bookmark-toggle{
  display:grid;place-items:center;flex:0 0 44px;
  width:44px;min-width:44px;height:44px;min-height:44px;
  padding:0;font-size:0;line-height:1
 }
 body[data-chapter] .bookmark-toggle::before{
  content:'☆';font:500 24px/1 var(--ui-font)
 }
 body[data-chapter] .bookmark-toggle[aria-pressed="true"]::before{
  content:'★'
 }
}

/* Returning Home is action-first: the long chapter title is information,
 * Continue is the action, and Library is a quiet secondary way out. The
 * first-visit two-button Start/Library treatment remains unchanged. */
/* Both the pre-hydration returning Home hint and the loaded Continue
 * card use the SAME quiet Library link. Never paint a bordered button that
 * morphs to plain text when deferred reader.js reveals the saved chapter. */
html[data-reader-loading="returning"] .reader-home .home-reading-column .home-actions .home-secondary,
.reader-home .home-reading-card:not([hidden]) + .home-actions .home-secondary{
 border:0;background:transparent;color:var(--accent);
 padding-inline:0;font-weight:650;min-height:44px
}
html[data-reader-loading="returning"] .reader-home .home-reading-column .home-actions .home-secondary:hover,
.reader-home .home-reading-card:not([hidden]) + .home-actions .home-secondary:hover{
 text-decoration:underline;text-underline-offset:3px
}


/* The compact Library heading has three independently wrapping pieces:
 * Library, approved-chapter count and (only when progress exists) Find my
 * chapter. Reserve a consistent number/title row, then show the optional
 * recovery link immediately below it. The 25-chapter catalogue remains
 * collapsed and keeps its approved desktop two-column presentation. */
@media(max-width:520px){
 .library-index .library-heading{
  display:grid;grid-template-columns:minmax(0,1fr) auto;
  align-items:baseline;gap:5px 12px
 }
 .library-index .library-heading h1{
  grid-column:1;grid-row:1;min-width:0
 }
 .library-index .library-heading>span{
  grid-column:2;grid-row:1;text-align:right;
  max-width:19ch;line-height:1.4
 }
 .library-index .library-heading #library-locate-current{
  grid-column:1/-1;grid-row:2;justify-self:start;
  max-width:100%
 }
}


/* Library reading state must not steal the chapter title's horizontal
 * space at any size, including two-column expanded desktop ranges. The
 * original identity, status and arrow siblings competed as one flex row:
 * "Your place · Read · Bookmarked" became a whole separate text column.
 * Give original full chapter titles and arrow the first row; keep status
 * beneath them and the separate 44px bookmark action on the right. */
 .library-index .library-group-entries .library-entry>a{
  display:grid;grid-template-columns:minmax(0,1fr) auto;
  grid-template-rows:auto;align-items:center;
  column-gap:8px;row-gap:3px
 }
 .library-index .library-group-entries .library-entry-identity{
  grid-column:1;grid-row:1;min-width:0
 }
 .library-index .library-group-entries .library-entry-arrow{
  grid-column:2;grid-row:1;align-self:center
 }
 .library-index .library-group-entries .library-entry-status{
  grid-column:1/-1;grid-row:2;min-width:0;
  white-space:normal;overflow-wrap:break-word;
  font:550 11px/1.4 var(--ui-font);color:var(--secondary)
 }
 .library-index .library-group-entries .library-entry-status:empty{
  display:none
 }


/* Library empty-filter recovery: an unmatched title or a zero-bookmarks
 * filter must leave one obvious way back to the full approved catalogue.
 * The existing bare browser-default "Clear filters" button is especially
 * hard to recognize or tap at mobile text sizes. This only styles the
 * already-present button/state; no alternate catalogue or read marker. */
#chapter-empty:not([hidden]){
 display:flex;flex-wrap:wrap;align-items:center;
 gap:10px 14px;margin:11px 0 18px;
 padding:17px 18px;border:1px solid var(--line);
 border-radius:9px;background:var(--paper);
 font:550 14px/1.55 var(--ui-font);color:var(--secondary)
}
#chapter-empty button{
 display:inline-flex;align-items:center;justify-content:center;
 min-height:44px;max-width:100%;padding:9px 15px;
 border:1px solid var(--accent);border-radius:7px;
 background:var(--accent-soft);color:var(--accent);
 font:700 13px/1.4 var(--ui-font)
}
#chapter-empty button:hover{background:var(--paper)}
#chapter-empty button:focus-visible{
 outline:3px solid var(--accent);outline-offset:3px
}


/* Actual narrow/large-zoom Library heading: below 260px, the complete
 * "Library" word and the approved chapter-count label cannot share the
 * grid's first row. Even though the document has no horizontal scrollbar,
 * the heading's glyphs overlap the chapter count. Stack them in source
 * order; the optional recovered-place control stays on its own third row.
 * Ordinary phones, tablet and desktop retain the earlier paired heading. */
@media(max-width:259px){
 .library-index .library-heading{grid-template-columns:minmax(0,1fr)}
 .library-index .library-heading h1{
  grid-column:1;grid-row:1;min-width:0
 }
 .library-index .library-heading>span{
  grid-column:1;grid-row:2;justify-self:start;
  text-align:left;max-width:100%
 }
 .library-index .library-heading #library-locate-current{
  grid-column:1;grid-row:3;justify-self:start
 }
}


/* Balanced navigation hitboxes: global header links already have 44px
 * height, but "Saved" may be only 34–38px wide. From 300px onward each
 * primary Home/Library action fits a complete thumb-sized target. The
 * existing <300px high-zoom wrapping fallback remains untouched. */
@media(min-width:300px){
 .preview-index .home-topline nav>a{
  min-width:44px;justify-content:center
 }
 .preview-index .home-topline nav #theme-toggle{
  flex-basis:44px;min-width:44px
 }
}
/* Small tablets show the complete chapter navigation, unlike narrow
 * phones' More menu. Keep its Saved link and theme toggle thumb-sized
 * without reflowing the chapter's prose or desktop title. */
@media(min-width:641px){
 body[data-chapter] .site-header nav>a{
  min-width:44px;justify-content:center
 }
 body[data-chapter] .site-header nav #theme-toggle{
  flex-basis:44px;min-width:44px
 }
}


/* At strong zoom a 44px bookmark plus the chapter link's arrow squeezed
 * actual long English chapter names into a 16–70px column. The browser
 * still reported NO overflow, but the words broke almost character by
 * character. Reflow only <=280px: complete chapter title/status first,
 * separate 44px bookmark action below on the right. This materially
 * reduces long-name wrapping at 160–280px while 281px+ stays compact.
 * Restore the explicit hidden rule because author display:grid otherwise
 * outranks the native hidden attribute on filtered-out list items. */
@media(max-width:280px){
 .library-index .library-group-entries .library-entry{
  display:grid;grid-template-columns:minmax(0,1fr) 44px;
  align-items:start;padding:0 6px
 }
 .library-index .library-group-entries .library-entry[hidden]{
  display:none
 }
 .library-index .library-group-entries .library-entry>a{
  grid-column:1/-1;grid-row:1;padding:10px 6px 4px
 }
 .library-index .library-group-entries .library-entry>.library-entry-bookmark{
  grid-column:2;grid-row:2;justify-self:end;
  min-height:44px;margin:0 0 5px
 }
}


/* Home first paint for a returning reader. The page is intentionally static
 * until deferred catalogue/reader scripts restore the exact saved chapter.
 * An early READ-ONLY hint from the synchronous boot script prevents the
 * misleading "Start reading" CTA flashing before "Continue" is ready.
 * Reserve a quiet card footprint to avoid the long title pushing the premise
 * down when restored; no animation, guessed progress or data writes.
 * The load-event failsafe exposes the ordinary Start link if hydration fails. */
/* During a read-only returning hint, Start must be absent from
 * flex layout, not merely invisible: otherwise Open Library jumps sideways
 * when Continue replaces Start. The boot load failsafe still reveals Start
 * if the deferred reader cannot initialize. */
html[data-reader-loading="returning"] .reader-home #start-reading{
 display:none
}
html[data-reader-loading="returning"] .reader-home .home-reading-column::before{
 content:"";display:block;
 /* The Home card begins in a two-column layout above 800px; its real
  * title can occupy much more height than on tablets. Reserve a balanced
  * footprint instead of pulling the Library link far down on hydration. */
 min-height:280px;margin:0 0 12px;
 border:1px solid var(--line);border-radius:12px;
 background-color:var(--paper);
 /* The read-only pre-hydration card must resemble its real Continue layout,
  * not flash as a blank framed rectangle. Six quiet placeholder strokes
  * stand in for the eyebrow, progress, action and full chapter title. No
  * motion, fabricated source text, additional controls or state writes. */
 background-image:
  linear-gradient(var(--line),var(--line)),
  linear-gradient(var(--line),var(--line)),
  linear-gradient(var(--accent-soft),var(--accent-soft)),
  linear-gradient(var(--line),var(--line)),
  linear-gradient(var(--line),var(--line)),
  linear-gradient(var(--line),var(--line));
 background-size:91px 8px,58% 8px,min(144px,calc(100% - 42px)) 44px,
  84% 8px,67% 8px,48% 8px;
 background-position:21px 23px,21px 56px,21px 88px,21px 156px,21px 181px,21px 206px;
 background-repeat:no-repeat
}
/* Balance short/long published titles without knowing or inventing the
 * reader's saved chapter before deferred catalogue hydration. The mobile
 * placeholder scales continuously rather than jumping 58px at 345px.
 * The last strokes rise on narrower/zoomed screens so they stay inside the
 * smaller panel. The actual saved chapter card retains its natural height. */
@media(max-width:800px){
 html[data-reader-loading="returning"] .reader-home .home-reading-column::before{
  min-height:clamp(195px,calc(240px - 5.8vw),210px);
  background-position:21px 23px,21px 56px,21px 88px,
   21px 141px,21px 165px,21px 185px
 }
}
@media(max-width:520px){
 html[data-reader-loading="returning"] .reader-home .home-reading-column::before{
  min-height:clamp(210px,calc(445px - 55vw),340px);
  margin-bottom:10px
 }
}


/* A 125% browser zoom can leave Home's centered, translated header outside
   the visible viewport despite having no horizontal document scrollbar.
   On narrow and phone-sized layout widths the header belongs within the
   containing column, including zoomed CSS viewports around 420px. */
@media(max-width:520px){
 .preview-index .home-topline{
  left:auto;transform:none;width:100%;max-width:100%
 }
}

/* The saved-place shortcut appears after deferred reader scripts restore the
 * Library state. On a returning browser reserve its real location before
 * that hydration so the chapter finder and 25-chapter groups do not jump
 * down. The button remains visually hidden and cannot receive pointer/
 * keyboard focus until actual supported progress is confirmed.
 * Existing native [hidden] behavior remains for fresh/failed hydration. */
html[data-reader-loading="returning"] .library-index
 #library-locate-current[hidden]{
 display:inline-flex;align-items:center;visibility:hidden
}

/* Shared Home/Library/chapter phone-gutter alignment. Chapter chrome had a
 * narrow 10–17px mobile inset while the Home/Library frames use the shared
 * 19–26px gutter. This visibly shifted the same SLF navigation logo between
 * pages, especially at 320–390px. Keep the five direct chapter controls,
 * 44px hit areas and existing wrapped zoom fallback. Only the outer inset
 * changes; the narrower story/prose measure remains untouched. */
@media(max-width:640px){
 body[data-chapter] .site-header{
  padding-inline:var(--site-gutter)
 }
}
/* Preserve the SAME outer header axis as Home and Library at every zoom.
 * Five 44px reader actions fit beside the 44px SLF icon at 320px when
 * their internal gap is zero; no second toolbar row or 9px logo jump. */
@media(min-width:320px) and (max-width:379px){
 body[data-chapter] .site-header{
  padding-inline:var(--site-gutter);flex-wrap:wrap
 }
 body[data-chapter] .site-header nav{column-gap:0}
}
/* At 480–520px Home/Library use the real 18px column inset,
 * while the chapter header still uses its 4vw gutter (~21px at 520).
 * Match their logo axis without altering story gutters or button sizes.
 * At 521px the shared centered header takes over again. */
@media(min-width:480px) and (max-width:520px){
 body[data-chapter] .site-header{padding-inline:18px}
}
/* Keep the same "SLF Reader" wordmark used on Home and Library as soon as
 * the phone can display it. <=360px all three pages retain the short SLF
 * mark. Between 361–379px the old fixed 44px logo slot must be released,
 * otherwise the newly visible Reader text could overlap Library despite
 * a nominally nonoverlapping hitbox. The five 44px chapter actions remain
 * one row; no control is hidden or reduced to make room. */
@media(min-width:361px) and (max-width:640px){
 body[data-chapter] .site-header .site-logo span{display:inline}
}
@media(min-width:361px) and (max-width:379px){
 body[data-chapter] .site-header .site-logo{flex:0 0 auto}
}

/* The phone-to-tablet change at 640→641px previously removed ~92px of
 * usable story width while adding 24px of empty top padding. On genuine
 * long published headings that can add a title line and push the story
 * downward despite a wider screen. Make only this tablet transition
 * continuous: at 641px the effective gutter remains ~21px (same as phone),
 * and it grows gradually to the existing desktop paper measure by 930px.
 * Header, prose and footer retain one aligned adjustable reading width.
 * Focus keeps its existing 30px top padding and independent exit controls. */
@media(min-width:641px) and (max-width:930px){
 body[data-chapter] .reading-shell{
  padding-top:clamp(12px,calc(7vw - 33px),32px);
  padding-inline:clamp(5px,calc(24vw - 149px),74px)
 }
 body[data-chapter] .chapter-header{
  margin-bottom:clamp(16px,2.5vw,23px)
 }
 body[data-chapter].focus-mode .reading-shell{
  padding-top:30px
 }
}

/* The same 640→641px reader transition also showed a sudden 26px jump
 * in sticky toolbar height: the narrow header used 2px vertical insets
 * while tablet chrome immediately used 14px on each side. Keep the
 * existing full seven tablet actions and their 44px hit targets, but
 * interpolate only the vertical insets through 800px. The Home/Library
 * frames and the desktop header beyond 800px remain unchanged. */
@media(min-width:641px) and (max-width:800px){
 body[data-chapter] .site-header{
  padding-block:clamp(4px,calc(6.25vw - 36px),14px)
 }
}

/* The compact Library already shares Home's exact Continue destination.
 * A returning reader should be able to recognize the right CLOSED range,
 * and their next/saved chapter after opening it, without another panel.
 * Styling follows the existing read-only render state: hidden/filter-excluded
 * rows and groups never receive the marker. The inset does not shift titles,
 * bookmark hitboxes or 25-chapter summary alignment. */
.library-index .library-group.library-group-current>summary{
 box-shadow:inset 3px 0 var(--accent);
}
.library-index .library-group-entries .library-entry.library-entry-current{
 background:var(--accent-soft);
 box-shadow:inset 3px 0 var(--accent);
}

/* Library's existing native details used flex summaries: the browser's
 * list-item disclosure marker is not rendered in that layout. Keep the
 * accepted compact range/count design, but make open/closed intent obvious
 * with one small CSS chevron. More options and device-progress use the
 * same affordance; no extra buttons, scripts, storage or animation. */
/* Suppress the browser-default arrow wherever it survives native
 * details display:flex (notably Safari); never show two disclosure cues. */
.library-index .library-group>summary,
.library-index .library-more-controls>summary,
.library-index .library-bulk>summary{list-style:none}
.library-index .library-group>summary::-webkit-details-marker,
.library-index .library-more-controls>summary::-webkit-details-marker,
.library-index .library-bulk>summary::-webkit-details-marker{display:none}
.library-index .library-group>summary::after,
.library-index .library-more-controls>summary::after,
.library-index .library-bulk>summary::after{
 content:"";display:inline-block;flex:0 0 8px;
 width:8px;height:8px;margin:0 3px 3px 5px;
 border:solid var(--accent);border-width:0 2px 2px 0;
 transform:rotate(45deg)
}
.library-index .library-group[open]>summary::after,
.library-index .library-more-controls[open]>summary::after,
.library-index .library-bulk[open]>summary::after{
 transform:rotate(225deg);margin-bottom:-3px
}

/* The mobile Library "More options" text disclosure previously exposed
 * a 36px pointer target, unlike the 44px filters, locator and range rows.
 * Keep the compact unboxed treatment but restore an honest thumb-size
 * target together with its visible expand/collapse chevron. */
@media(max-width:720px){
 .library-index .library-more-controls>summary{min-height:44px}
}

/* Aa's explicit WIDE measure must still differ from Normal at 24px on
 * desktop. The original 930px outer shell (with 80–104px inner padding)
 * capped both 64ch Normal and 78ch Wide to the same 720–768px column.
 * Grow ONLY a deliberately chosen Wide chapter shell through the existing
 * desktop viewport: Normal/Narrow and all phone/tablet composition stay as
 * approved. The padding starts at the 930px breakpoint's prior value to
 * avoid a second tablet transition; header/prose/footer use the same
 * story-font measure and existing reflow-preserved Aa behavior. */
@media(min-width:931px){
 body[data-chapter][data-reader-width="wide"] .reading-shell{
  width:min(calc(100% - 32px),1180px);
  padding-inline:clamp(74px,8vw,88px)
 }
}

/* Before deferred reader.js runs, the synchronous theme boot also restores
 * the reader's known Aa font/line-spacing/measure choices. These temporary
 * HTML attributes mirror the eventual body settings only UNTIL body has
 * its real data-reader-width; removing them after hydration must cause no
 * visual shift. All choices are read-only and validated against existing
 * preference values; chapter English and paragraph anchors are untouched. */
:root[data-reader-boot-width="narrow"]{--max-prose:54ch}
:root[data-reader-boot-width="wide"]{--max-prose:78ch}
:root[data-reader-boot-face="sans"]{--prose-font:var(--ui-font)}
:root[data-reader-boot-leading="compact"]{--prose-leading:1.48}
:root[data-reader-boot-leading="spacious"]{--prose-leading:1.9}
@media(min-width:931px){
 :root[data-reader-boot-width="wide"] body[data-chapter]:not([data-reader-width]) .reading-shell{
  width:min(calc(100% - 32px),1180px);
  padding-inline:clamp(74px,8vw,88px)
 }
}
@media(min-width:361px) and (max-width:640px){
 :root[data-reader-boot-width="narrow"] body[data-chapter]:not([data-reader-width]) .reading-shell{
  padding-inline:30px
 }
 :root[data-reader-boot-width="wide"] body[data-chapter]:not([data-reader-width]) .reading-shell{
  padding-inline:16px
 }
}
@media(max-width:360px){
 :root[data-reader-boot-width="narrow"] body[data-chapter]:not([data-reader-width]) .reading-shell{
  padding-inline:clamp(16px,6.67vw,24px)
 }
 :root[data-reader-boot-width="wide"] body[data-chapter]:not([data-reader-width]) .reading-shell{
  padding-inline:clamp(8px,3.34vw,12px)
 }
}

/* Complete Aa's existing explicit Wide choice through tablet reading.
 * At 24px, Normal and Wide previously both hit the identical 666px
 * inner-shell ceiling at 768px. Keep every Normal/Narrow gutter and the
 * phone/desktop layouts untouched; give ONLY opted-in Wide more usable
 * measure, tapering back to the desktop rule without a 930px seam.
 * The parser-time preference bootstrap mirrors the same geometry so
 * Next/Continue does not produce a flash of the old narrow shell. */
@media(min-width:641px) and (max-width:768px){
 body[data-chapter][data-reader-width="wide"] .reading-shell,
 :root[data-reader-boot-width="wide"] body[data-chapter]:not([data-reader-width]) .reading-shell{
  padding-inline:clamp(5px,calc(7.875vw - 45.48px),15px)
 }
}
@media(min-width:769px) and (max-width:930px){
 body[data-chapter][data-reader-width="wide"] .reading-shell,
 :root[data-reader-boot-width="wide"] body[data-chapter]:not([data-reader-width]) .reading-shell{
  padding-inline:clamp(15px,calc(36.42vw - 264.71px),74px)
 }
}

/* Complete Aa's three genuinely DIFFERENT reading measures with 24px Book
 * and Modern text. A 54ch Narrow declaration alone can exceed a 736px
 * desktop shell in Modern24, making Narrow identical to Normal. Limit the
 * optional Narrow measure to 630px at high font sizes while leaving smaller
 * Book/Modern sizes' original 54ch measure unchanged. The boot selector
 * mirrors the hydrated state and only affects the explicit Narrow choice. */
:root[data-reader-boot-width="narrow"],
body[data-reader-width="narrow"]{--max-prose:min(54ch,630px)}

/* At tablet widths, the same oversized 54ch Narrow text was also shell-
 * limited: all three Aa options could collapse to one 665px column.
 * Interpolate opt-in Narrow gutters from the existing 640px phone layout
 * to the unchanged desktop rule at 931px, preserving reading-line
 * compensation, title/prose/footer alignment and saved Aa choices.
 * The boot alias prevents chapter-transition first-paint shifts. */
@media(min-width:641px) and (max-width:768px){
 body[data-chapter][data-reader-width="narrow"] .reading-shell,
 :root[data-reader-boot-width="narrow"] body[data-chapter]:not([data-reader-width]) .reading-shell{
  padding-inline:clamp(15px,calc(37vw - 222px),62px)
 }
}
@media(min-width:769px) and (max-width:930px){
 body[data-chapter][data-reader-width="narrow"] .reading-shell,
 :root[data-reader-boot-width="narrow"] body[data-chapter]:not([data-reader-width]) .reading-shell{
  padding-inline:clamp(62px,calc(7.45vw + 4.79px),74px)
 }
}

/* Current visual system. The legacy sheet retains tested controls, saved-data
   surfaces and narrow/zoom fallbacks; this file owns the connected presentation.
   Both preview and production compose these files into the existing reader.css. */
:root {
  --edition-radius: 12px;
  --edition-gutter: clamp(20px, 4.5vw, 56px);
  --scene-sky: #dce7d7;
  --scene-ground: #a9c0ab;
  --scene-light: #fff3cf;
  --scene-mountain-far: #88a68c;
  --scene-mountain-near: #52755e;
}
:root[data-look='nightfall'] {
  --scene-sky: #1a3329;
  --scene-ground: #12251d;
  --scene-light: #dfd9aa;
  --scene-mountain-far: #2d5543;
  --scene-mountain-near: #16392c;
}
.reader-edition {
  -webkit-font-smoothing: antialiased;
}
.reader-edition .site-logo {
  letter-spacing: 0.08em;
}
.reader-edition .site-logo span {
  margin-left: 3px;
}
.reader-edition.preview-index .preview-list {
  max-width: 1240px;
  padding-inline: var(--edition-gutter);
}
.reader-edition .home-topline {
  min-height: 86px;
  padding-block: 12px;
}
.reader-edition .home-topline nav {
  gap: clamp(10px, 2vw, 28px);
}
.reader-edition .home-topline nav > a {
  font-size: 13px;
  font-weight: 550;
}
.reader-edition .home-topline nav #theme-toggle {
  border-radius: 50%;
  background: transparent;
  border-color: var(--line);
}
.reader-edition .chapter-eyebrow {
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 700;
}

/* Home: a title, one clear reading action, and an original window on the world. */
.reader-edition.reader-home .home-intro {
  position: relative;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 0 7%;
  padding: clamp(48px, 6vw, 84px) 0 64px;
  align-items: start;
}
.reader-edition.reader-home .home-copy {
  grid-column: 1;
  grid-row: 1;
  padding-top: 10px;
}
.reader-edition.reader-home .home-copy .chapter-eyebrow {
  margin-bottom: 25px;
}
.reader-edition.reader-home .home-copy h1 {
  max-width: 690px;
  margin: 0;
  font-size: clamp(52px, 5.7vw, 78px);
  line-height: 1.02;
  letter-spacing: -0.055em;
  text-wrap: initial;
}
.reader-edition.reader-home .home-copy h1 em {
  display: block;
  color: var(--accent);
  font-weight: 400;
}
.reader-edition.reader-home .home-description-column .home-series-lede {
  max-width: 34ch;
  margin: 0 0 14px;
  color: var(--ink);
  font: 400 clamp(19px, 1.9vw, 23px)/1.5 var(--chapter-font);
  letter-spacing: -0.015em;
}
.reader-edition.reader-home .home-reading-column {
  grid-column: 1;
  grid-row: 2;
  padding-top: 29px;
}
.reader-edition.reader-home .home-reading-column .home-actions {
  gap: 12px 22px;
  margin: 0;
  align-items: center;
}
.reader-edition.reader-home .home-actions a {
  min-height: 50px;
  border-radius: 6px;
  font-size: 13px;
}
.reader-edition.reader-home .home-actions .home-primary {
  padding-inline: 24px;
}
.reader-edition.reader-home .home-actions .home-secondary {
  padding-inline: 16px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--secondary);
  font-weight: 550;
}
.reader-edition.reader-home .home-actions .home-secondary:hover {
  color: var(--accent);
}
.reader-edition.reader-home .home-description-column {
  grid-column: 1;
  grid-row: 3;
  margin-top: 28px;
}
.reader-edition.reader-home .home-intro .home-description {
  max-width: 52ch;
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
}
.reader-edition.reader-home .home-reading-card {
  padding: 19px 0 0 20px;
  margin: 0 0 4px;
  border: 0;
  border-left: 2px solid var(--accent);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.reader-edition.reader-home .home-reading-card[hidden] {
  display: none;
}
.reader-edition.reader-home .home-reading-card .chapter-eyebrow {
  order: 0;
  margin: 0 0 8px;
  font-size: 9px;
}
.reader-edition.reader-home .home-reading-card .home-reading-progress {
  order: 1;
  margin: 0 0 5px;
  font-size: 11px;
}
.reader-edition.reader-home .home-reading-card h2 {
  order: 3;
  max-width: 40ch;
  margin: 16px 0 6px;
  font: 400 21px/1.35 var(--chapter-font);
}
.reader-edition.reader-home .home-reading-card .home-primary {
  order: 2;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 6px;
  font: 700 13px/1.4 var(--ui-font);
}
.reader-edition.reader-home .home-reading-card .home-primary[hidden] {
  display: none;
}
.reader-edition.reader-home .home-reading-card:not([hidden]) + .home-actions {
  margin-top: 3px;
  padding-left: 20px;
}
.reader-edition.reader-home .home-history-notice {
  grid-column: 1;
  grid-row: 4;
  margin-top: 20px;
}
.frontier-scene {
  grid-column: 2;
  grid-row: 1 / span 4;
  max-width: 430px;
  width: 100%;
  justify-self: end;
  color: var(--accent);
  text-align: center;
  padding-top: 0;
}
.frontier-scene svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Library: a restrained contents page with distinct active and expanded states. */
.reader-edition.library-index .home-library {
  padding-top: 43px;
}
.reader-edition.library-index .home-library > .chapter-eyebrow {
  margin: 0 0 13px;
}
.reader-edition.library-index .library-heading {
  gap: 8px 24px;
  align-items: baseline;
}
.reader-edition.library-index .library-heading h1 {
  margin: 0;
  font-size: clamp(38px, 4.5vw, 54px);
  letter-spacing: -0.045em;
}
.reader-edition.library-index .library-heading > span {
  margin-right: auto;
  font-size: 12px;
}

.reader-edition.library-index .library-tools {
  margin: 22px 0 0;
}
.reader-edition.library-index .library-find {
  border-radius: 8px;
}
.reader-edition.library-index #chapter-filter {
  min-height: 52px;
  padding-inline: 17px;
  border-radius: 8px;
  font-size: 14px;
}
.reader-edition.library-index .library-find button {
  border-radius: 7px;
  min-width: 57px;
}
.reader-edition.library-index .library-filter-bar {
  margin: 16px 0 22px;
  gap: 12px;
}
.reader-edition.library-index .library-filters {
  gap: 5px;
}
.reader-edition.library-index .library-filter {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 22px;
  padding: 9px 16px;
  font-size: 12px;
  min-height: 44px;
  color: var(--secondary);
}
.reader-edition.library-index .library-filter[aria-pressed='true'] {
  background: var(--accent-soft);
  border-color: var(--line);
  color: var(--accent);
}
.reader-edition.library-index .library-more-controls > summary {
  background: transparent;
  border-color: transparent;
  font-weight: 500;
}
.reader-edition.library-index .library-results:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin: -12px 0 14px;
}
.reader-edition.library-index .library-results .library-count {
  flex: 1 1 180px;
  margin: 0;
}
.reader-edition.library-index .library-results button {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent);
  background: transparent;
  font: 550 11px/1.5 var(--ui-font);
}
.reader-edition.library-index .library-results button:hover {
  background: var(--accent-soft);
}
.reader-edition.library-index #library-clear {
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.reader-edition.library-index .library-groups {
  column-gap: 24px;
  row-gap: 12px;
  border-top: 0;
}
.reader-edition.library-index .library-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  overflow: clip;
}
.reader-edition.library-index .library-group > summary {
  position: relative;
  min-height: 63px;
  padding: 14px 19px;
  gap: 14px;
  border-radius: 7px;
  font-weight: 550;
}
.reader-edition.library-index .library-group > summary > span:first-child {
  font: 400 18px/1.4 var(--chapter-font);
}
.reader-edition.library-index .library-group > summary:hover {
  background: var(--accent-soft);
}
.reader-edition.library-index .library-group-count {
  font-size: 10px;
  letter-spacing: 0.02em;
}
.reader-edition.library-index .library-group[data-reading='partial'] > summary::before,
.reader-edition.library-index .library-group[data-reading='complete'] > summary::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--range-progress);
  height: 2px;
  background: var(--accent);
  pointer-events: none;
}
.reader-edition.library-index .library-group[data-reading='complete'] .library-group-count {
  color: var(--accent);
}
.reader-edition.library-index .library-group[open] {
  border-color: var(--accent);
}
.reader-edition.library-index .library-group[open] > summary {
  background: var(--accent-soft);
  border-bottom: 1px solid var(--line);
}
.reader-edition.library-index .library-group-entries {
  border-top: 0;
  padding: 0 8px;
}
.reader-edition.library-index .library-group-entries .library-entry > a {
  padding-block: 16px;
  padding-left: 11px;
}
.reader-edition.library-index .library-entry-title {
  font-size: 18px;
  line-height: 1.4;
}
.reader-edition.library-index .library-entry-number {
  font-size: 10px;
  letter-spacing: 0.04em;
}
.reader-edition.library-index .library-bulk {
  margin-top: 32px;
  border-top: 1px solid var(--line);
  padding-top: 15px;
}

/* Chapters keep the existing Aa measures, native controls and reflow handling. */
.reader-edition[data-chapter] .site-header {
  border-bottom-color: var(--line);
}
.reader-edition[data-chapter] .reading-shell {
  border-radius: 0;
  box-shadow: none;
}
.reader-edition[data-chapter] .chapter-header {
  margin-bottom: 32px;
}
.reader-edition[data-chapter] .chapter-context {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom-color: var(--line);
}
.reader-edition[data-chapter] .chapter-context .series-name {
  font-size: 9px;
  letter-spacing: 0.15em;
}
.reader-edition[data-chapter] .chapter-header h1 {
  font-size: clamp(30px, 3.1vw, 36px);
  line-height: 1.16;
  letter-spacing: -0.035em;
  font-weight: 400;
}
.reader-edition[data-chapter] .chapter-header h1.chapter-title-medium {
  font-size: clamp(30px, 2.6vw, 34px);
}
.reader-edition[data-chapter] .chapter-header h1.chapter-title-long {
  font-size: clamp(28px, 2.5vw, 32px);
}
.reader-edition[data-chapter] .chapter-prose p {
  margin-bottom: 1.15em;
}
.reader-edition[data-chapter] .chapter-prose .verified-prestory-note {
  margin-bottom: 0.48em;
}
.reader-edition[data-chapter] .chapter-prose .verified-prestory-note-end {
  margin-bottom: 1.15em;
}
.reader-edition[data-chapter] .chapter-footer {
  margin-top: 56px;
  padding-top: 26px;
}
.reader-edition[data-chapter] .chapter-footer > .chapter-eyebrow {
  margin: 0 0 19px;
  color: var(--secondary);
  font: 650 9px/1.5 var(--ui-font);
  letter-spacing: 0.17em;
}
.reader-edition[data-chapter] .chapter-navigation > a {
  padding: 20px;
  border-radius: 8px;
  gap: 12px;
  min-height: 112px;
}
.reader-edition[data-chapter] .chapter-navigation .chapter-link-label {
  font-size: 10px;
  letter-spacing: 0.035em;
}
.reader-edition[data-chapter] .chapter-navigation .chapter-link-title {
  font: 400 20px/1.35 var(--chapter-font);
}
.reader-edition[data-chapter] .chapter-navigation .next-chapter {
  background: var(--accent-soft);
}
.chapter-footer-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 22px;
}
.chapter-footer-links > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
  font: 500 11px/1.5 var(--ui-font);
  color: var(--secondary);
}
.chapter-footer-links > a:hover {
  color: var(--accent);
}

@media (max-width: 800px) {
  .reader-edition.reader-home .home-intro {
    column-gap: 3%;
    padding-top: 44px;
  }
  .reader-edition.reader-home .home-copy h1 {
    font-size: clamp(45px, 7vw, 58px);
  }
  .reader-edition.reader-home .home-description-column .home-series-lede {
    font-size: 19px;
  }
  .frontier-scene {
    align-self: center;
  }
}
@media (max-width: 640px) {
  .reader-edition .home-topline {
    min-height: 72px;
    padding-block: 9px;
  }
  .reader-edition .home-topline nav {
    gap: 5px;
  }
  .reader-edition .home-topline nav > a {
    font-size: 12px;
  }
  .reader-edition.reader-home .home-intro {
    grid-template-columns: minmax(0, 1fr);
    padding: 36px 0 28px;
    gap: 0;
  }
  .reader-edition.reader-home .home-copy {
    padding-top: 0;
  }
  .reader-edition.reader-home .home-copy .chapter-eyebrow {
    margin-bottom: 19px;
  }
  .reader-edition.reader-home .home-copy h1 {
    max-width: 9em;
    font-size: clamp(44px, 12vw, 68px);
  }
  .reader-edition.reader-home .home-description-column .home-series-lede {
    margin-top: 0;
    max-width: 33ch;
    font-size: 20px;
  }
  .reader-edition.reader-home .home-reading-column {
    grid-column: 1;
    grid-row: 2;
    padding-top: 24px;
  }
  .reader-edition.reader-home .home-description-column {
    grid-column: 1;
    grid-row: 3;
    margin-top: 22px;
  }
  .reader-edition.reader-home .home-intro .home-description {
    max-width: 49ch;
    font-size: 12px;
    line-height: 1.8;
  }
  .reader-edition.reader-home .home-history-notice {
    grid-column: 1;
    grid-row: 4;
  }
  .frontier-scene {
    display: none;
    grid-column: 1;
    grid-row: 5;
    max-width: 280px;
    justify-self: center;
    margin-top: 25px;
  }

  .reader-edition.library-index .home-library {
    padding-top: 29px;
  }
  .reader-edition.library-index .library-heading {
    gap: 6px 12px;
  }
  .reader-edition.library-index .library-heading > span {
    font-size: 10px;
  }

  .reader-edition.library-index .library-filter-bar {
    margin: 12px 0 18px;
  }
  .reader-edition.library-index .library-filter {
    padding-inline: 12px;
    font-size: 11px;
  }
  .reader-edition.library-index .library-group > summary {
    min-height: 62px;
    padding-inline: 16px;
  }
  .reader-edition.library-index .library-group > summary > span:first-child {
    font-size: 17px;
  }
  .reader-edition[data-chapter] .chapter-context {
    margin-bottom: 18px;
    padding-bottom: 10px;
  }
  .reader-edition[data-chapter] .chapter-header {
    margin-bottom: 25px;
  }
  .reader-edition[data-chapter] .chapter-header h1 {
    font-size: max(calc(var(--prose-size) + 5px), 32px);
    line-height: 1.2;
  }
  .reader-edition[data-chapter] .chapter-header h1.chapter-title-medium {
    font-size: max(calc(var(--prose-size) + 2px), 28px);
  }
  .reader-edition[data-chapter] .chapter-header h1.chapter-title-long {
    font-size: max(var(--prose-size), 25px);
  }
  .reader-edition[data-chapter] .chapter-footer {
    margin-top: 40px;
  }
  .reader-edition[data-chapter] .chapter-navigation > a {
    min-height: 94px;
    padding: 17px;
  }
  .reader-edition[data-chapter] .chapter-navigation .chapter-link-title {
    font-size: 19px;
  }
}
@media (max-width: 360px) {
  .reader-edition .home-topline nav {
    gap: 3px;
  }
  .reader-edition.reader-home .home-copy h1 {
    font-size: clamp(31px, 12vw, 44px);
    overflow-wrap: anywhere;
  }
  .reader-edition.reader-home .home-description-column .home-series-lede {
    font-size: 18px;
  }
  .reader-edition.reader-home .home-actions {
    column-gap: 14px;
  }
  .reader-edition.reader-home .home-actions a {
    font-size: 12px;
  }
  .reader-edition.reader-home .home-actions .home-primary {
    padding-inline: 18px;
  }
  .reader-edition.library-index .library-filter {
    padding-inline: 9px;
  }
  .reader-edition.library-index .library-group > summary {
    gap: 8px;
  }
  .reader-edition.library-index .library-group-count {
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .reader-edition :is(a, button, summary) {
    transition:
      background-color 0.15s ease,
      border-color 0.15s ease,
      color 0.15s ease;
  }
}

/* Tablet Home remains one readable column; never squeeze the reading action
   against a decorative scene. At desktop the scene occupies the second column. */
@media (min-width: 641px) and (max-width: 800px) {
  .reader-edition.reader-home .home-intro {
    grid-template-columns: minmax(0, 1fr);
  }
  .reader-edition.reader-home .home-history-notice {
    grid-column: 1;
    grid-row: 4;
  }
  .frontier-scene {
    display: none;
    grid-column: 1;
    grid-row: 5;
    max-width: 340px;
    justify-self: center;
    margin-top: 30px;
  }
}
.reader-edition[data-chapter] .chapter-prose .intro-author-note p {
  margin: 0 0 0.65em;
}
.reader-edition[data-chapter] .chapter-prose .intro-author-note p:last-child {
  margin-bottom: 0;
}

/* Reading comes first: four direct actions; one shared secondary menu. */
.reader-edition[data-chapter] .site-header nav {
  gap: clamp(5px, 1.5vw, 18px);
}
.reader-edition[data-chapter] .reader-tools {
  display: block;
}
.reader-edition .reader-tools > summary {
  min-width: 44px;
  padding-inline: 10px;
  font: 600 13px/1.3 var(--ui-font);
  color: var(--secondary);
  background: transparent;
}
.reader-edition .reader-tools[open] > summary {
  background: var(--accent-soft);
  color: var(--accent);
}
.reader-edition .reader-tools > .reader-more-panel {
  width: 300px;
  max-width: calc(100vw - 24px);
  padding: 18px;
  border-radius: 10px;
  gap: 10px;
  max-height: calc(100dvh - var(--reader-menu-top, 88px) - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.reader-edition .reader-tools[open] > .reader-more-panel {
  display: grid;
}
.reader-edition .reader-tools:not([open]) > .reader-more-panel,
.reader-edition .appearance:not([open]) > .appearance-panel,
.reader-edition .appearance-advanced:not([open]) > .appearance-advanced-controls {
  display: none;
}
.reader-theme-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font: 500 12px/1.4 var(--ui-font);
  color: var(--secondary);
}
.reader-edition .reader-tools #theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
}
.reader-edition .reader-tools > form > label {
  margin: 0;
  font-size: 12px;
}
.reader-current-chapter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  font: 650 12px/1.4 var(--ui-font);
}
.reader-edition #reader-tools-bookmark {
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--secondary);
  font: 550 12px/1.4 var(--ui-font);
}
.reader-edition #reader-tools-bookmark[aria-pressed='true'] {
  color: var(--accent);
  background: var(--accent-soft);
}
.reader-adjacent-chapters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.reader-adjacent-chapters:has(> a:only-child) {
  grid-template-columns: minmax(0, 1fr);
}
.reader-edition .reader-adjacent-chapters a {
  min-width: 0;
  min-height: 44px;
  padding: 9px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  justify-content: center;
  font: 550 12px/1.4 var(--ui-font);
}
.reader-edition .reader-tools .reader-tool-links {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.reader-edition .reader-tools .reader-tool-links a {
  flex: 1;
  justify-content: center;
  padding: 9px;
  font-weight: 550;
  border: 1px solid var(--line);
  border-radius: 6px;
}

/* Aa opens to size, font and theme. All prior choices remain available. */
.reader-edition .appearance-panel {
  width: 300px;
  gap: 13px;
}
.reader-edition .appearance[open] > .appearance-panel {
  display: block;
}
.appearance-advanced {
  margin-top: 13px;
}
.appearance-basics,
.appearance-advanced[open] > .appearance-advanced-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 12px;
}
.appearance-choice {
  min-width: 0;
}
.appearance-choice-wide {
  grid-column: 1/-1;
}
.reader-edition .appearance-choice label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
}
.reader-edition .appearance-choice select {
  margin: 0;
  min-height: 44px;
}
.reader-edition .appearance-advanced > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 10px 0 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--secondary);
  list-style: none;
  font: 500 12px/1.4 var(--ui-font);
}
.reader-edition .appearance-advanced > summary::after {
  content: '+';
  font-size: 18px;
}
.reader-edition .appearance-advanced[open] > summary::after {
  content: '−';
}
.appearance-advanced-controls {
  padding-top: 12px;
}

/* Returning Home is a reading place, with the introduction kept for first visits.
   Match the existing prepaint hint so restoration does not flash a marketing page. */
:is(
    .reader-home:has(#reading-card:not([hidden])),
    html[data-reader-loading='returning'] .reader-home
  )
  .home-intro {
  grid-template-columns: minmax(0, 1fr);
  max-width: 760px;
  margin-inline: auto;
  padding-top: clamp(32px, 5vw, 60px);
  padding-bottom: 40px;
}
:is(
    .reader-home:has(#reading-card:not([hidden])),
    html[data-reader-loading='returning'] .reader-home
  )
  .home-copy
  .chapter-eyebrow,
:is(
    .reader-home:has(#reading-card:not([hidden])),
    html[data-reader-loading='returning'] .reader-home
  )
  .home-description-column,
:is(
    .reader-home:has(#reading-card:not([hidden])),
    html[data-reader-loading='returning'] .reader-home
  )
  .frontier-scene {
  display: none;
}
:is(
    .reader-home:has(#reading-card:not([hidden])),
    html[data-reader-loading='returning'] .reader-home
  )
  .home-copy
  h1 {
  max-width: none;
  font-size: clamp(26px, 3.5vw, 38px);
  line-height: 1.25;
  letter-spacing: -0.035em;
}
:is(
    .reader-home:has(#reading-card:not([hidden])),
    html[data-reader-loading='returning'] .reader-home
  )
  .home-copy
  h1
  em {
  display: inline;
  font-style: normal;
  color: inherit;
}
:is(
    .reader-home:has(#reading-card:not([hidden])),
    html[data-reader-loading='returning'] .reader-home
  )
  .home-reading-column {
  padding-top: 28px;
}
.reader-edition.reader-home .home-reading-card {
  border: 0;
  padding: 0;
}
.reader-edition.reader-home .home-reading-card h2 {
  max-width: 34ch;
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.3;
}
.reader-edition.reader-home .home-reading-card:not([hidden]) + .home-actions {
  padding-left: 0;
  margin-top: 12px;
}
.reader-edition.reader-home .home-history-notice {
  padding: 0;
  border: 0;
  background: transparent;
}
.reader-edition.reader-home .home-history-notice > summary {
  min-height: 44px;
  padding: 12px 0;
  color: var(--secondary);
  font-size: 12px;
  list-style: revert;
}
.reader-edition.reader-home .home-history-notice:not([open]) > a {
  display: none;
}

/* Less-used catalogue and file tools belong inside their explicit disclosures. */
.reader-edition.library-index .library-filter-bar {
  flex-wrap: wrap;
}
.reader-edition.library-index .library-more-controls[open] {
  flex-basis: 100%;
  width: 100%;
  margin-left: 0;
}
.reader-edition.library-index .library-more-inner {
  gap: 12px;
  padding: 16px;
  background: var(--paper);
}
.reader-edition.library-index .library-more-inner .library-bulk {
  flex-basis: 100%;
  margin: 0;
  padding-top: 12px;
}
.reader-edition .backup-restore > summary {
  min-height: 44px;
  padding: 12px 0;
  font: 550 13px/1.5 var(--ui-font);
  color: var(--accent);
}
.reader-edition .backup-restore > summary::after {
  content: '▸';
}
.reader-edition .backup-restore[open] > summary::after {
  content: '▾';
}
.reader-edition .backup-restore[open] > div {
  display: grid;
  gap: 9px;
  padding-bottom: 12px;
}
.reader-edition .recovery-original:has(#backup-original:disabled) {
  display: none;
}
.reader-edition #saved-clear-progress {
  justify-self: start;
  border: 0;
  background: transparent;
  font-size: 12px;
  color: var(--secondary);
  padding-inline: 0;
}
@media (max-width: 640px) {
  .reader-edition[data-chapter] .reader-tools > .reader-more-panel,
  .reader-edition[data-chapter] .appearance-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    top: var(--reader-menu-top, 64px);
  }
  .reader-edition[data-chapter] .site-header {
    column-gap: 12px;
  }
  .reader-edition[data-chapter] .site-header nav {
    justify-content: flex-end;
    gap: 4px;
  }
}
@media (max-width: 300px) {
  .appearance-basics,
  .appearance-advanced[open] > .appearance-advanced-controls {
    grid-template-columns: minmax(0, 1fr);
  }
  .appearance-choice-wide {
    grid-column: auto;
  }
  .reader-edition[data-chapter] .site-header nav {
    flex-wrap: wrap;
  }
}

/* One reading destination: a quiet book-like Home card, a direct Library action. */
.reader-edition.reader-home .home-reading-card {
  width: 100%;
  padding: clamp(22px, 3.5vw, 36px);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--paper);
}
.reader-edition.reader-home .home-reading-card .chapter-eyebrow {
  margin-bottom: 12px;
  font-size: 10px;
}
.reader-edition.reader-home .home-reading-card .home-reading-progress {
  margin-bottom: 10px;
  font-size: 12px;
}
.reader-edition.reader-home .home-reading-card h2 {
  max-width: 38ch;
  margin: 22px 0 0;
  font-size: clamp(22px, 2.2vw, 25px);
  line-height: 1.35;
}
.reader-edition.reader-home .home-reading-card:not([hidden]) + .home-actions {
  margin-top: 16px;
}
.reader-edition.library-index .library-reading-actions {
  display: flex;
  flex-basis: 100%;
  width: 100%;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 16px;
  grid-column: 1/-1;
  grid-row: 2;
}
html:not([data-reader-loading='returning'])
  .reader-edition.library-index
  .library-reading-actions:has(#reading-card[hidden]):has(#library-locate-current[hidden]) {
  display: none;
}
html[data-reader-loading='returning'] .reader-edition.library-index .library-reading-actions {
  display: flex;
  min-height: 44px;
}
.reader-edition .library-reading-card[hidden],
.reader-edition .library-reading-card .home-primary[hidden] {
  display: none;
}
.reader-edition .library-reading-card {
  margin: 0;
  min-width: 0;
  max-width: 100%;
}
.reader-edition .reading-destination .home-primary {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.reader-edition .library-reading-card .home-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--accent);
  color: var(--paper);
  font: 700 12px/1.4 var(--ui-font);
  text-decoration: none;
}
.reader-edition.library-index .library-entry-current .library-entry-number {
  color: var(--accent);
  font-weight: 750;
}
.reader-edition.library-index .library-entry-current .library-entry-status {
  color: var(--accent);
  font-weight: 650;
}

/* Keep Previous/Next in their familiar order, with a clear forward action. */
.reader-edition[data-chapter] .chapter-navigation .next-chapter {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--paper);
}
.reader-edition[data-chapter] .chapter-navigation .next-chapter .chapter-link-label {
  color: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}
.reader-edition[data-chapter] .chapter-navigation .next-chapter .chapter-link-title {
  color: inherit;
  font-size: clamp(21px, 2.5vw, 25px);
}
.reader-edition[data-chapter] .chapter-navigation .previous-chapter {
  width: 100%;
  min-height: 0;
  padding: 16px 2px;
  border-color: transparent;
  background: transparent;
  align-self: center;
  gap: 8px;
}
.reader-edition[data-chapter] .chapter-navigation .previous-chapter .chapter-link-title {
  color: var(--secondary);
  font-size: 16px;
  line-height: 1.45;
}
@media (max-width: 640px) {
  .reader-edition.reader-home .home-reading-card {
    padding: 18px 20px;
  }
  .reader-edition.reader-home .home-reading-card h2 {
    margin-top: 16px;
  }
  .reader-edition[data-chapter] .chapter-navigation .previous-chapter {
    padding-block: 6px 10px;
  }
}
/* Reserve the framed card's extra padding during read-only Home restoration.
   Keep a balanced footprint for both short titles and the long chapter229 title. */
@media (max-width: 520px) {
  html[data-reader-loading='returning'] .reader-edition.reader-home .home-reading-column::before {
    min-height: clamp(234px, calc(469px - 55vw), 364px);
  }
}
@media (max-width: 259px) {
  .reader-edition.library-index .library-reading-actions {
    grid-row: 3;
  }
}

/* The same masthead frame and logo on every page; prose keeps its own measure. */
.reader-edition .home-topline,
.reader-edition[data-chapter] .site-header {
  width: min(100%, var(--site-frame));
  max-width: none;
  min-height: 72px;
  padding: 13.5px clamp(20px, 4vw, 44px);
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.reader-edition .home-topline {
  width: min(calc(100% + 2 * var(--edition-gutter)), var(--site-frame));
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
}
.reader-edition[data-chapter] .site-header {
  margin-inline: auto;
}
.reader-edition .home-topline .site-logo,
.reader-edition[data-chapter] .site-header .site-logo {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 15px;
  line-height: 1.3;
}
.reader-edition .home-topline nav,
.reader-edition[data-chapter] .site-header nav {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  max-width: 100%;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: clamp(4px, 1.6vw, 24px);
}
@media (min-width: 361px) {
  .reader-edition .home-topline .site-logo span,
  .reader-edition[data-chapter] .site-header .site-logo span {
    display: inline;
  }
}
@media (max-width: 640px) {
  .reader-edition .home-topline,
  .reader-edition[data-chapter] .site-header {
    min-height: 56px;
    padding-block: 5.5px;
  }
  .reader-edition .home-topline nav,
  .reader-edition[data-chapter] .site-header nav {
    gap: 4px;
  }
}
@media (max-width: 360px) {
  .reader-edition .home-topline .site-logo span,
  .reader-edition[data-chapter] .site-header .site-logo span {
    display: none;
  }
}
@media (max-width: 300px) {
  .reader-edition .home-topline,
  .reader-edition[data-chapter] .site-header {
    flex-wrap: wrap;
    row-gap: 4px;
  }
  .reader-edition .home-topline nav,
  .reader-edition[data-chapter] .site-header nav {
    flex-basis: 100%;
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 3px;
  }
}

/* Editorial edition. Shared visual ownership lives here; presentation.css
   retains the existing menu, Focus, zoom and restoration compatibility rules. */
:root {
  --page: #f3f3ec;
  --paper: #fffef9;
  --ink: #183731;
  --secondary: #556c64;
  --line: #d4ded3;
  --accent: #20634f;
  --accent-soft: #e2eddf;
  --warm-light: #b28b4e;
  --surface-shadow: 0 20px 70px #143d2910;
  --ui-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --edition-gutter: clamp(20px, 5vw, 72px);
  --site-frame: 1400px;
  --folio-display: Georgia, 'Times New Roman', serif;
  --site-nav-height: 88px;
}
.reader-offline-option {
  padding-block: 12px;
  border-top: 1px solid var(--line);
}
.reader-offline-option button {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--ink);
}
:is(#offline-status, #offline-feedback):empty {
  display: none;
}
:is(#offline-status, #offline-feedback) {
  margin: 10px 0 0;
  font: 500 12px/1.5 var(--ui-font);
  color: var(--secondary);
}
#offline-chapters {
  list-style: none;
  padding: 0;
  margin: 0;
}
#offline-chapters li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-block: 12px;
  border-bottom: 1px solid var(--line);
}
#offline-chapters a {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
#offline-chapters button {
  flex: 0 0 auto;
  min-height: 44px;
}
#offline-range {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin-block: 16px;
}
#offline-range label {
  display: grid;
  gap: 6px;
  flex: 1 1 120px;
  min-width: 0;
  font: 500 12px/1.5 var(--ui-font);
}
#offline-range input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  box-sizing: border-box;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--page);
  color: var(--ink);
}
#offline-range button {
  min-height: 44px;
}
#offline-progress {
  display: block;
  width: min(100%, 640px);
  height: 10px;
  margin: 0 0 18px;
  accent-color: var(--accent);
}
#offline-reading [hidden] {
  display: none;
}
.reader-edition.saved-index .offline-reading {
  margin: 30px 0 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  font: 14px/1.5 var(--ui-font);
}
.offline-reading > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-weight: 650;
  color: var(--secondary);
}
.offline-reading > summary::after {
  content: '▸';
  margin-left: auto;
  padding: 0 7px;
  color: var(--accent);
  font-size: 17px;
}
.offline-reading[open] > summary::after {
  content: '▾';
}
:root[data-look='editorial'] {
  color-scheme: light;
  --page: #f7f6f2;
  --paper: #fffefb;
  --ink: #202d27;
  --secondary: #626c66;
  --line: #d9ddd5;
  --accent: #285b49;
  --accent-soft: #e9eee6;
}
:root[data-look='nightfall'] {
  --page: #0c1419;
  --paper: #142329;
  --ink: #edf4e9;
  --secondary: #a5bbb5;
  --line: #2b4447;
  --accent: #b1efbf;
  --accent-soft: #203d37;
  --warm-light: #dbbf8d;
  --surface-shadow: 0 24px 80px #00000038;
}
:root[data-look='black'] {
  color-scheme: dark;
  --page: #000;
  --paper: #0d0d0d;
  --ink: #e5e5e5;
  --secondary: #aaa;
  --line: #303030;
  --accent: #cad9f2;
  --accent-soft: #1b1b1b;
  --warm-light: #aebbd4;
  --surface-shadow: 0 24px 80px #0008;
}
:root[data-look='black'] .reader-edition[data-chapter],
:root[data-look='black'] .reader-edition[data-chapter] .reading-shell {
  background: var(--page);
}
:root[data-look='black'] .reader-home .home-intro::before {
  background: none;
}
.reader-edition {
  text-rendering: optimizeLegibility;
}
.reader-edition.preview-index .preview-list {
  max-width: 1400px;
  padding-inline: var(--edition-gutter);
}
.reader-edition :is(.home-topline, .site-header) .site-logo {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}
.reader-edition .site-logo::before {
  content: none;
}
.reader-edition :is(.home-topline, .site-header) {
  background: var(--page);
}
.reader-edition :is(.home-topline, .site-header) .site-logo .site-wordmark {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
}
.site-emblem {
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
  mix-blend-mode: multiply;
}
:root:is([data-look='nightfall'], [data-look='black']) .site-emblem {
  filter: invert(1) hue-rotate(180deg) brightness(0.86);
  mix-blend-mode: screen;
}
.reader-edition .site-logo b {
  font: 600 28px/1.1 var(--folio-display);
  letter-spacing: -0.045em;
}
.reader-edition .site-logo small {
  color: var(--accent);
  font: 400 28px/1.1 var(--folio-display);
  letter-spacing: -0.045em;
}
.reader-edition .home-topline nav > a {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.reader-edition .chapter-eyebrow {
  font: 650 10px/1.5 var(--ui-font);
  letter-spacing: 0.14em;
}
.reader-edition :is(button, select, input) {
  font-family: var(--ui-font);
}
.reader-edition :is(button, a, summary):focus-visible {
  outline-offset: 4px;
}
.reader-edition input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Missing links keep a quiet route back to the actual catalogue. Rooted
   assets also work when this page is served for a deeply nested old link. */
.reader-not-found .not-found-panel {
  max-width: 640px;
  margin: clamp(52px, 10vh, 112px) auto;
  padding-block: 28px;
}
.not-found-panel .not-found-code {
  margin: 0 0 20px;
  color: var(--accent);
  font: 650 13px/1.4 var(--ui-font);
  letter-spacing: 0.14em;
}
.reader-not-found .not-found-panel h1 {
  margin: 0 0 20px;
  color: var(--ink);
  font: 650 clamp(32px, 6vw, 64px)/1.08 var(--ui-font);
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}
.not-found-panel > p:not(.not-found-code) {
  color: var(--secondary);
  font: 400 17px/1.65 var(--ui-font);
}
.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
.not-found-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: 600 14px/1.4 var(--ui-font);
  text-decoration: none;
}
.not-found-actions a:first-child {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--page);
}
.not-found-actions a:hover {
  box-shadow: inset 0 0 0 1px currentColor;
}

/* The title, reading action and real opening text make the Home composition. */
.reader-edition.reader-home .home-intro,
.reader-home:has(#reading-card:not([hidden])) .home-intro,
html[data-reader-loading='returning'] .reader-home .home-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  grid-template-rows: auto auto auto;
  gap: 0 clamp(36px, 7vw, 100px);
  max-width: none;
  margin: 0;
  padding: clamp(44px, 6vw, 80px) 0 72px;
  align-items: start;
}
.reader-edition.reader-home .home-copy {
  grid-area: 1 / 1;
  padding: 8px 0 0;
}
.home-heading {
  position: relative;
}
.home-emul {
  position: absolute;
  right: -20px;
  bottom: -64px;
  width: clamp(120px, 13vw, 180px);
  height: auto;
  pointer-events: none;
}
.reader-home:has(#reading-card:not([hidden])) .home-heading,
html[data-reader-loading='returning'] .reader-home .home-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 74px;
}
.reader-home:has(#reading-card:not([hidden])) .home-emul,
html[data-reader-loading='returning'] .reader-home .home-emul {
  position: static;
  flex: 0 0 140px;
  width: 140px;
  margin-block: -60px;
}
.reader-edition.reader-home .home-copy .chapter-eyebrow,
.reader-home:has(#reading-card:not([hidden])) .home-copy .chapter-eyebrow {
  display: block;
  margin-bottom: 28px;
  color: var(--accent);
}
.reader-edition.reader-home .home-copy h1,
.reader-home:has(#reading-card:not([hidden])) .home-copy h1,
html[data-reader-loading='returning'] .reader-home .home-copy h1 {
  max-width: none;
  margin: 0;
  font: 400 clamp(66px, 6.8vw, 96px)/0.98 var(--folio-display);
  letter-spacing: -0.065em;
  text-wrap: initial;
}
.home-title-line {
  display: block;
}
.reader-edition .translation-credit {
  color: var(--secondary);
  font: 500 12px/1.6 var(--ui-font);
  letter-spacing: 0.015em;
}
.reader-edition.reader-home .translation-credit {
  margin: 22px 0 0;
}
.reader-edition[data-chapter] .translation-credit {
  margin: 16px 0 0;
}
.reader-edition.library-index .translation-credit {
  margin: 0;
  font-size: inherit;
}
.reader-edition.reader-home .home-copy h1 em,
.reader-home:has(#reading-card:not([hidden])) .home-copy h1 em {
  display: block;
  margin-top: 3px;
  color: var(--accent);
  font-weight: 400;
  font-style: italic;
}
.reader-edition.reader-home .home-description-column {
  grid-area: 2 / 1;
  margin-top: 30px;
}
.reader-edition.reader-home .home-description-column .home-series-lede {
  max-width: 32ch;
  font: 400 clamp(18px, 1.7vw, 22px)/1.5 var(--folio-display);
  letter-spacing: -0.015em;
  margin: 0;
}
.reader-edition.reader-home .home-description {
  max-width: 49ch;
  margin-top: 16px;
  font: 400 13px/1.8 var(--ui-font);
}
.reader-edition.reader-home .home-reading-column,
.reader-home:has(#reading-card:not([hidden])) .home-reading-column {
  grid-area: 3 / 1;
  padding-top: 30px;
}
.reader-edition.reader-home .home-actions {
  gap: 10px 22px;
}
.reader-edition.reader-home .home-actions a,
.reader-edition.reader-home #continue-reading {
  min-height: 52px;
  padding: 14px 23px;
  border-radius: 4px;
  font: 650 13px/1.4 var(--ui-font);
  letter-spacing: 0;
  text-decoration: none;
}
.reader-edition.reader-home .home-actions .home-primary {
  color: var(--page);
  background: var(--accent);
}
.reader-edition.reader-home .home-actions .home-secondary {
  padding-inline: 0;
  background: transparent;
  border: 0;
  color: var(--ink);
}
.reader-edition.reader-home .home-actions .home-secondary:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.reader-home:has(#reading-card:not([hidden])) .home-description-column,
html[data-reader-loading='returning'] .reader-home .home-description-column {
  display: none;
}
.reader-home:has(#reading-card:not([hidden])) .home-copy .chapter-eyebrow,
html[data-reader-loading='returning'] .reader-home .home-copy .chapter-eyebrow {
  display: none;
}
.reader-home:has(#reading-card:not([hidden])) .home-copy h1,
html[data-reader-loading='returning'] .reader-home .home-copy h1 {
  font-size: clamp(30px, 4.5vw, 64px);
  line-height: 1.08;
}
.reader-home:has(#reading-card:not([hidden])) .home-reading-column,
html[data-reader-loading='returning'] .reader-home .home-reading-column {
  grid-area: 1 / 2 / span 3;
  padding-top: 8px;
}
.reader-edition.reader-home .home-reading-card {
  display: flex;
  width: 100%;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--paper);
  align-items: flex-start;
  gap: 0;
}
.reader-edition.reader-home .home-reading-card[hidden] {
  display: none;
}
.reader-edition.reader-home .home-reading-card .chapter-eyebrow {
  order: 0;
  margin: 0 0 10px;
}
.reader-edition.reader-home .home-reading-card .home-reading-progress {
  order: 1;
  margin: 0;
  font: 500 11px/1.5 var(--ui-font);
}
.reader-edition.reader-home .home-reading-card h2 {
  order: 3;
  max-width: 33ch;
  margin: 20px 0 0;
  font: 400 clamp(20px, 2vw, 25px)/1.3 var(--folio-display);
  letter-spacing: -0.025em;
}
.reader-edition.reader-home .home-reading-card #continue-reading {
  order: 2;
  margin-top: 16px;
  background: var(--accent);
  color: var(--page);
}
.reader-edition.reader-home .home-reading-card:not([hidden]) + .home-actions {
  margin-top: 8px;
  padding-left: 0;
}
.reader-edition.reader-home .home-history-notice {
  grid-area: 4 / 1;
}
.home-opening {
  grid-area: 1 / 2 / span 3;
  min-width: 0;
  margin: 8px 0 0;
  padding: 30px clamp(24px, 3vw, 42px);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  background: var(--paper);
}
.home-opening > .chapter-eyebrow {
  margin: 0 0 24px;
  color: var(--accent);
}
.home-opening h2 {
  margin: 0 0 24px;
  font: 400 clamp(26px, 2.8vw, 34px)/1.2 var(--folio-display);
  letter-spacing: -0.035em;
}
.reader-edition .home-opening-text p {
  color: var(--ink);
  font: 400 18px/1.75 var(--chapter-font);
  margin: 0 0 18px;
}
.home-opening a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  margin-top: 6px;
  color: var(--accent);
  font: 650 12px/1.4 var(--ui-font);
}
.reader-home:has(#reading-card:not([hidden])) .home-opening,
html[data-reader-loading='returning'] .reader-home .home-opening {
  display: none;
}

/* A browsing rail and one readable contents column, rather than a card grid. */
.reader-edition.library-index .home-library {
  padding: 20px 0 40px;
  border-top: 0;
}
.reader-edition.library-index .library-colophon {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  align-items: center;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--secondary);
  font: 400 12px/1.6 var(--ui-font);
}
.library-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: clamp(28px, 3vw, 44px);
  align-items: start;
}
.library-sidebar,
.library-catalogue {
  min-width: 0;
}
.library-sidebar {
  position: sticky;
  top: 24px;
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  scrollbar-width: thin;
  padding: 0 4px 4px;
}
.reader-edition.library-index .library-reading-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}
.reader-edition.library-index .library-reading-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.reader-edition.library-index .library-reading-progress {
  margin: 0 0 14px;
  color: var(--secondary);
  font: 600 11px/1.5 var(--ui-font);
  order: 0;
}
.reader-edition.library-index .library-reading-card #continue-reading {
  order: 2;
  border-radius: 4px;
  font-size: 12px;
}
.reader-edition.library-index #library-locate-current {
  /* Match the hydrated 44px touch target during read-only first paint.
     Otherwise the chapter finder shifts down after reader.js loads. */
  min-height: 44px;
  align-self: flex-start;
  padding: 8px 0;
  font-size: 11px;
  color: var(--secondary);
}
.reader-edition.library-index .library-tools {
  display: block;
  margin: 0;
}
.reader-edition.library-index .library-find {
  gap: 6px;
}
.reader-edition.library-index #chapter-filter {
  min-width: 0;
  min-height: 52px;
  padding: 12px;
  background: var(--paper);
  border-radius: 5px;
  font-size: 12px;
}
.reader-edition.library-index .library-find button {
  min-width: 46px;
  border-radius: 5px;
  font-size: 12px;
}
.reader-edition.library-index .library-filter-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  margin: 16px 0 0;
}
.reader-edition.library-index .library-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}
.reader-edition.library-index .library-filter {
  padding: 12px;
  min-height: 44px;
  border-radius: 5px;
  text-align: left;
}
.reader-edition.library-index #library-offline-filter[hidden] {
  display: none;
}
.reader-edition.library-index #library-offline-filter:not([hidden]) {
  grid-column: 1 / -1;
  text-align: center;
}
.reader-edition.library-index .library-filter[aria-pressed='true'] {
  border-color: var(--line);
  background: var(--accent-soft);
}
.reader-edition.library-index .library-more-controls {
  margin: 0;
}
.reader-edition.library-index .library-more-controls > summary {
  justify-content: space-between;
  padding-inline: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  font-size: 12px;
}
.reader-edition.library-index .library-more-inner {
  flex-direction: column;
  align-items: stretch;
  padding: 12px;
  border-radius: 5px;
}
.reader-edition.library-index .library-bulk-controls {
  flex-wrap: wrap;
}
.reader-edition.library-index {
  --library-range-columns: 2;
}
.reader-edition.library-index #chapter-list.library-groups {
  display: grid;
  grid-template-columns: repeat(var(--library-range-columns), minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}
.reader-edition.library-index .library-range-item:has(> .library-group[open]),
.reader-edition.library-index .library-earlier-row {
  grid-column: 1 / -1;
}
@media (min-width: 720px) {
  .reader-edition.library-index {
    --library-range-columns: 3;
  }
}
@media (min-width: 1100px) {
  .reader-edition.library-index {
    --library-range-columns: 4;
  }
}
@media (max-width: 339px) {
  .reader-edition.library-index {
    --library-range-columns: 1;
  }
}
.reader-edition.library-index .library-group {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.reader-edition.library-index .library-group > summary {
  min-height: 90px;
  padding: 20px 16px;
  border-radius: 0;
  gap: 18px;
}
.reader-edition.library-index .library-group > summary > span:first-child {
  font: 400 clamp(22px, 2.4vw, 30px)/1.25 var(--folio-display);
  letter-spacing: -0.035em;
}
.reader-edition.library-index .library-group-count {
  font: 500 11px/1.5 var(--ui-font);
}
.reader-edition.library-index .library-group-current:not([open]) > summary {
  background: var(--accent-soft);
}
.reader-edition.library-index .library-group[open] {
  background: var(--paper);
}
.reader-edition.library-index .library-group[open] > summary {
  background: var(--accent-soft);
  border-bottom: 1px solid var(--line);
}
.reader-edition.library-index .library-group-entries {
  padding: 0 16px;
}
.reader-edition.library-index .library-group[open] > .library-group-entries {
  display: block;
}
.reader-edition.library-index .library-group-entries .library-entry > a {
  min-height: 64px;
  padding: 10px;
}
.reader-edition.library-index .library-entry-title {
  font: 400 clamp(19px, 1.8vw, 24px)/1.4 var(--folio-display);
  letter-spacing: -0.015em;
}
.reader-edition.library-index .library-entry-number {
  font: 600 10px/1.5 var(--ui-font);
  letter-spacing: 0.05em;
}
.reader-edition.library-index .library-results:not([hidden]) {
  margin: -12px 0 16px;
}

/* A quiet page, deliberate chapter entrance, and a clear place to go next. */
.reader-edition[data-chapter] .reading-shell {
  margin-top: 28px;
  margin-bottom: 48px;
  padding-top: 42px;
  padding-bottom: 60px;
  border-color: var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 12px 48px #071f1505;
}
.reader-edition[data-chapter] .chapter-header {
  margin-bottom: 32px;
}
.reader-edition[data-chapter] .chapter-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 0;
  border-bottom: 0;
}
.reader-edition[data-chapter] .chapter-context > .chapter-identity {
  display: flex;
  min-width: 0;
}
.reader-edition[data-chapter] .chapter-context .chapter-number {
  color: var(--secondary);
  font: 600 11px/1.4 var(--ui-font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.reader-edition[data-chapter] .chapter-header > .chapter-top-nav {
  margin-top: 20px;
}
.reader-edition[data-chapter] .chapter-header h1 {
  font-family: var(--folio-display);
  font-size: clamp(34px, 4vw, 50px);
  line-height: 1.12;
  letter-spacing: -0.045em;
  font-weight: 400;
}
.reader-edition[data-chapter] .chapter-header h1.chapter-title-medium {
  font-size: clamp(31px, 3.4vw, 42px);
}
.reader-edition[data-chapter] .chapter-header h1.chapter-title-long {
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.2;
}
.reader-edition[data-chapter] .chapter-prose {
  color: var(--ink);
}
.reader-edition[data-chapter] .chapter-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.reader-edition[data-chapter]
  :is(.chapter-navigation, .chapter-top-nav).chapter-navigation-compact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.reader-edition[data-chapter]
  :is(.chapter-navigation, .chapter-top-nav).chapter-navigation-compact
  > :is(a, span) {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: auto;
  min-width: 0;
  min-height: 44px;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: none;
  font: 550 13px/1.4 var(--ui-font);
  white-space: nowrap;
  text-decoration: none;
}
.reader-edition[data-chapter]
  :is(.chapter-navigation, .chapter-top-nav).chapter-navigation-compact
  > :is(.next-chapter, .chapter-top-next) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.reader-edition[data-chapter]
  :is(.chapter-navigation, .chapter-top-nav).chapter-navigation-compact
  > .chapter-edge {
  border-color: transparent;
  background: transparent;
  color: var(--secondary);
  opacity: 0.45;
}
.reader-edition[data-chapter] .chapter-footer-links {
  justify-content: center;
  margin-top: 8px;
  padding-top: 0;
  border-top: 0;
}

/* The supporting pages belong to the same edition, with a bounded work area. */
.reader-edition .passage-form,
.reader-edition .saved-section {
  max-width: 900px;
  margin-inline: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}
.reader-edition :is(#passage-results, #passage-status, .passage-coverage) {
  max-width: 900px;
  margin-inline: auto;
}
.reader-edition .saved-section-heading h2 {
  font: 400 26px/1.3 var(--folio-display);
  letter-spacing: -0.025em;
}

@media (max-width: 999px) {
  .library-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }
  .library-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0;
  }
  .reader-edition.library-index .library-filters {
    display: flex;
    flex-wrap: wrap;
  }
  .reader-edition.library-index .library-filter-bar {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  .reader-edition.library-index .library-more-controls {
    margin-left: auto;
  }
  .reader-edition.library-index .library-more-controls:not([open]) {
    flex: 0 0 auto;
  }
  .reader-edition.library-index .library-more-controls > summary {
    border-top: 0;
    padding-inline: 10px;
  }
  .reader-edition.library-index .library-reading-actions {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
  }
  .reader-edition.library-index .library-reading-progress {
    display: none;
  }
}
@media (max-width: 800px) {
  .reader-edition.reader-home .home-intro,
  .reader-home:has(#reading-card:not([hidden])) .home-intro,
  html[data-reader-loading='returning'] .reader-home .home-intro {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 42px;
  }
  .reader-edition.reader-home .home-opening {
    grid-area: 4 / 1;
    margin-top: 36px;
  }
  .reader-home:has(#reading-card:not([hidden])) .home-reading-column,
  html[data-reader-loading='returning'] .reader-home .home-reading-column {
    grid-area: 2 / 1;
    padding-top: 28px;
  }

  .reader-edition.reader-home .home-copy h1 {
    font-size: clamp(64px, 10vw, 90px);
  }
}
@media (min-width: 641px) and (max-width: 800px) {
  .reader-edition.reader-home .home-copy {
    grid-column: 1;
  }
  .reader-edition.reader-home .home-description-column {
    margin-top: 28px;
  }

  .reader-edition.reader-home .home-actions {
    gap: 4px;
  }
  .reader-edition.reader-home .home-actions a {
    padding-inline: 16px;
  }
  .reader-edition.reader-home .home-actions .home-secondary {
    padding-inline: 0;
  }
}
@media (max-width: 640px) {
  .reader-edition.reader-home .home-intro,
  .reader-home:has(#reading-card:not([hidden])) .home-intro {
    padding: 35px 0 40px;
  }
  .reader-edition.reader-home .home-copy .chapter-eyebrow {
    margin-bottom: 22px;
    font-size: 9px;
  }
  .reader-edition.reader-home .home-copy h1 {
    font-size: clamp(48px, 13vw, 76px);
  }
  .reader-edition.reader-home .home-description-column {
    margin-top: 25px;
  }
  .reader-edition.reader-home .home-description-column .home-series-lede {
    font-size: 20px;
  }

  .home-opening {
    padding: 26px 22px;
  }
  .reader-edition .home-opening-text p {
    font-size: 18px;
  }

  .reader-edition.reader-home .home-reading-card {
    padding: 22px;
  }
  .reader-edition.reader-home .home-reading-card h2 {
    font-size: 21px;
  }
  .reader-edition.library-index .library-reading-actions {
    margin-bottom: 18px;
    padding: 15px;
  }
  .reader-edition.library-index .library-filter {
    padding-inline: 10px;
    font-size: 11px;
  }
  .reader-edition.library-index .library-group > summary {
    min-height: 78px;
    padding: 18px 8px;
    gap: 12px;
  }
  .reader-edition.library-index .library-group > summary > span:first-child {
    font-size: 23px;
  }
  .reader-edition.library-index .library-group-count {
    font-size: 10px;
  }
  .reader-edition.library-index .library-group-entries {
    padding-inline: 12px;
  }
  .reader-edition[data-chapter] .reading-shell {
    margin: 0;
    padding-top: 26px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .reader-edition[data-chapter] .chapter-context {
    margin-bottom: 10px;
    padding-bottom: 0;
  }
  .reader-edition[data-chapter] .chapter-header h1 {
    font-size: max(34px, calc(var(--prose-size) + 9px));
  }
  .reader-edition[data-chapter] .chapter-header h1.chapter-title-medium {
    font-size: max(29px, calc(var(--prose-size) + 4px));
  }
  .reader-edition[data-chapter] .chapter-header h1.chapter-title-long {
    font-size: max(25px, var(--prose-size));
  }
  .reader-edition[data-chapter] .chapter-navigation .next-chapter {
    min-height: 120px;
    padding: 22px;
  }
  .reader-edition .passage-form,
  .reader-edition .saved-section {
    padding: 18px;
  }
}

/* A clear action icon, independent of the platform's symbol font. */
.reader-edition .home-topline nav #theme-toggle,
.reader-edition .reader-tools #theme-toggle {
  flex: 0 0 auto;
  width: 84px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
}
.theme-action {
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.theme-action-light,
:root:is([data-look='nightfall'], [data-look='black']) .theme-action-dark {
  display: none;
}
.theme-action-dark,
:root:is([data-look='nightfall'], [data-look='black']) .theme-action-light {
  display: inline-flex;
}
.theme-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}
.theme-action-label {
  font: 600 11px/1 var(--ui-font);
}

/* SLF context stays useful on fresh and returning Home. */
.reader-edition.reader-home .home-slf {
  grid-area: 4 / 1 / auto / -1;
  min-width: 0;
  padding-top: 24px;
}
.reader-edition.reader-home .home-slf > .chapter-eyebrow {
  margin: 0 0 10px;
  color: var(--warm-light);
  font-size: 9px;
}
.reader-edition.reader-home .home-slf h2 {
  margin: 0 0 22px;
  font: 500 25px/1.25 var(--folio-display);
  letter-spacing: -0.035em;
}
.home-resources {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.reader-edition.reader-home .home-resource {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 14px;
  min-width: 0;
  min-height: 130px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--paper) 90%, var(--accent-soft)),
    var(--paper)
  );
  text-decoration: none;
}
.resource-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 44px;
  border-radius: 10px;
  color: var(--accent);
  background: var(--accent-soft);
}
.resource-icon svg {
  width: 24px;
  height: 24px;
}
.resource-novel .resource-icon {
  color: var(--warm-light);
  background: color-mix(in srgb, var(--warm-light) 12%, transparent);
}
.resource-copy {
  display: grid;
  gap: 7px;
  min-width: 0;
}
.resource-copy strong {
  color: var(--ink);
  font: 650 16px/1.35 var(--ui-font);
  letter-spacing: -0.025em;
}
.resource-copy > span {
  color: var(--secondary);
  font: 400 12px/1.5 var(--ui-font);
}
.resource-copy small {
  color: var(--secondary);
  font: 500 10px/1.5 var(--ui-font);
}
.resource-arrow {
  align-self: start;
  color: var(--accent);
  font: 500 18px/1 var(--ui-font);
}

.reader-edition.reader-home:has(#reading-card:not([hidden])) .home-slf,
html[data-reader-loading='returning'] .reader-edition.reader-home .home-slf {
  grid-area: 2 / 2;
  padding: 4px 0 0;
}
.reader-edition.reader-home:has(#reading-card:not([hidden])) .home-resources,
html[data-reader-loading='returning'] .reader-edition.reader-home .home-resources {
  grid-template-columns: minmax(0, 1fr);
}

@media (hover: hover) and (pointer: fine) {
  .reader-edition.reader-home .home-resource:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 8px 32px color-mix(in srgb, var(--accent) 8%, transparent);
  }
}
@media (max-width: 800px) {
  .reader-edition.reader-home .home-slf {
    grid-area: 5 / 1;
  }
  .home-resources {
    grid-template-columns: minmax(0, 1fr);
  }
  .reader-edition.reader-home:has(#reading-card:not([hidden])) .home-slf,
  html[data-reader-loading='returning'] .reader-edition.reader-home .home-slf {
    grid-area: 3 / 1;
  }
}
@media (max-width: 640px) {
  .reader-edition .home-topline nav #theme-toggle,
  .reader-edition .reader-tools #theme-toggle {
    width: 44px;
    padding: 0;
  }
  .theme-action-label {
    display: none;
  }
  .reader-edition.reader-home .home-resource {
    padding: 20px 16px;
    gap: 12px;
  }
}
@media (max-width: 640px) {
  .reader-edition .home-topline,
  .reader-edition[data-chapter] .site-header {
    column-gap: 8px;
  }
  .reader-edition :is(.home-topline, .site-header) .site-logo {
    gap: 8px;
  }
  .reader-edition .site-emblem {
    width: 36px;
    height: 36px;
  }
  .reader-edition :is(.home-topline, .site-header) .site-logo .site-wordmark {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }
  .reader-edition .site-logo :is(b, small) {
    font-size: 20px;
    line-height: 1.05;
  }
}
@media (max-width: 360px) {
  .reader-edition .home-topline,
  .reader-edition[data-chapter] .site-header {
    padding-inline: 10px;
    column-gap: 4px;
  }
  .reader-edition .site-logo :is(b, small) {
    font-size: 18px;
  }
  .reader-edition .home-topline nav > a {
    font-size: 11px;
  }
  .reader-edition.reader-home .home-copy h1 {
    font-size: clamp(32px, 12.5vw, 48px);
  }
  .reader-edition.reader-home .home-reading-card {
    padding: 18px;
  }
  .reader-edition.reader-home .home-reading-card h2 {
    font-size: 20px;
  }
  .reader-edition.library-index .library-group > summary > span:first-child {
    font-size: 20px;
  }
}

/* Atmosphere is made from light and type, with no illustrative asset. */
.reader-edition.preview-index {
  background-image: radial-gradient(
    ellipse at 76% 0,
    color-mix(in srgb, var(--accent) 9%, transparent),
    transparent 64%
  );
  background-size: 100% 850px;
  background-repeat: no-repeat;
}
.reader-edition .home-topline,
.reader-edition[data-chapter] .site-header {
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
}
.reader-edition .home-topline nav > a {
  color: var(--secondary);
  border-radius: 999px;
}
.reader-edition .home-topline nav > a[aria-current='page'] {
  color: var(--ink);
  border-bottom-color: transparent;
  background: var(--accent-soft);
}
.reader-edition.reader-home .home-intro {
  position: relative;
  isolation: isolate;
  padding-top: clamp(54px, 7vw, 96px);
  padding-bottom: clamp(56px, 7vw, 100px);
}
.reader-edition.reader-home .home-intro::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.65;
  background:
    radial-gradient(
      ellipse at 40% 40%,
      color-mix(in srgb, var(--accent) 13%, transparent),
      transparent 68%
    ),
    radial-gradient(
      ellipse at 65% 65%,
      color-mix(in srgb, var(--warm-light) 8%, transparent),
      transparent 56%
    );
}
.reader-edition.reader-home .home-copy > .chapter-eyebrow {
  width: fit-content;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 65%, transparent);
  font-size: 9px;
  letter-spacing: 0.1em;
}
.reader-edition.reader-home .home-copy h1 {
  font-family: var(--ui-font);
  font-weight: 740;
  font-size: clamp(66px, 6.9vw, 110px);
  line-height: 0.99;
  letter-spacing: -0.075em;
}
.reader-edition.reader-home .home-copy h1 em {
  width: fit-content;
  font-family: var(--folio-display);
  font-size: 1.22em;
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: -0.065em;
  color: var(--accent);
}
.reader-edition.reader-home .home-copy .translation-credit {
  font-size: 11px;
  letter-spacing: 0.025em;
  margin-top: 28px;
}
.reader-edition.reader-home .home-description-column .home-series-lede {
  font-family: var(--ui-font);
  font-size: clamp(17px, 1.6vw, 21px);
  font-weight: 400;
  line-height: 1.65;
  color: var(--secondary);
}
.reader-edition.reader-home .home-actions a,
.reader-edition.reader-home #continue-reading {
  border-radius: 999px;
  min-height: 54px;
}
.reader-edition.reader-home .home-actions .home-primary,
.reader-edition.reader-home #continue-reading {
  box-shadow: 0 5px 24px color-mix(in srgb, var(--accent) 16%, transparent);
}
.reader-edition.reader-home .home-actions .home-secondary {
  padding-inline: 12px;
}
.reader-edition.reader-home .home-opening {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(28px, 3.2vw, 46px);
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--paper) 94%, var(--accent-soft)),
    var(--paper)
  );
  box-shadow:
    var(--surface-shadow),
    8px 10px 0 -3px var(--page),
    8px 10px 0 -2px var(--line);
}
.reader-edition.reader-home .home-opening > .chapter-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 650 9px/1.5 var(--ui-font);
  letter-spacing: 0.12em;
  color: var(--secondary);
}
.reader-edition.reader-home .home-opening > .chapter-eyebrow::before {
  content: '';
  width: 20px;
  height: 2px;
  background: var(--warm-light);
}
.reader-edition.reader-home .home-opening h2 {
  font-size: clamp(28px, 2.75vw, 36px);
  margin-bottom: 26px;
}
.reader-edition.reader-home .home-opening-text p {
  font-size: 17px;
  line-height: 1.8;
}
.reader-edition.reader-home .home-opening > a {
  margin-top: 8px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.reader-edition.reader-home .home-reading-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent-soft), var(--paper) 65%);
  box-shadow: var(--surface-shadow);
  padding: 30px;
}
.reader-edition.reader-home .home-reading-card > .chapter-eyebrow {
  color: var(--accent);
}
.reader-edition.reader-home:has(#reading-card:not([hidden])) .home-copy h1,
html[data-reader-loading='returning'] .reader-edition.reader-home .home-copy h1 {
  font-size: clamp(30px, 4.5vw, 64px);
  line-height: 1.06;
}
.reader-edition.reader-home:has(#reading-card:not([hidden])) .home-copy h1 em,
html[data-reader-loading='returning'] .reader-edition.reader-home .home-copy h1 em {
  font-size: 1.14em;
}
.reader-edition.library-index #chapter-list.library-groups {
  border: 0;
  gap: 10px;
}
.reader-edition.library-index .library-earlier-row {
  min-width: 0;
  list-style: none;
}
.reader-edition.library-index .library-earlier-row[hidden] {
  display: none;
}
.reader-edition.library-index .library-earlier > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 14px;
  box-sizing: border-box;
  border-block: 1px solid var(--line);
  color: var(--secondary);
  font: 550 12px/1.4 var(--ui-font);
  list-style: none;
  cursor: pointer;
}
.reader-edition.library-index .library-earlier > summary::-webkit-details-marker {
  display: none;
}
.reader-edition.library-index .library-earlier-range {
  margin-left: auto;
  font: 500 11px/1.4 var(--ui-font);
  font-variant-numeric: tabular-nums;
}
.reader-edition.library-index .library-earlier > summary::after {
  content: '';
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}
.reader-edition.library-index .library-earlier[open] > summary::after {
  transform: rotate(225deg) translate(-2px, -2px);
}
.reader-edition.library-index .library-earlier-groups {
  display: grid;
  grid-template-columns: repeat(var(--library-range-columns), minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.reader-edition.library-index .library-earlier:not([open]) > .library-earlier-groups {
  display: none;
}
.reader-edition.library-index .library-earlier-groups > .library-range-item {
  min-width: 0;
  list-style: none;
}
.reader-edition.library-index .library-earlier-groups > .library-range-item[hidden] {
  display: none;
}
@media (max-width: 280px) {
  .reader-edition.library-index .library-earlier > summary {
    flex-wrap: wrap;
    gap: 6px;
  }
  .reader-edition.library-index .library-earlier-range {
    margin-left: 0;
  }
  .reader-edition.library-index .library-earlier > summary::after {
    margin-left: auto;
  }
}
.reader-edition.library-index .library-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.reader-edition.library-index .library-group > summary {
  min-height: 56px;
  padding: 10px 14px;
  border-radius: 10px;
  gap: 12px;
}
.reader-edition.library-index .library-group > summary > span:first-child {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
  letter-spacing: 0;
}
.library-range-label small {
  color: var(--secondary);
  font: 500 9px/1.3 var(--ui-font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.library-range-label strong {
  font: 650 18px/1.25 var(--ui-font);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
}
.library-range-status {
  display: grid;
  gap: 2px;
  min-width: 0;
  text-align: right;
}
.library-group-place {
  color: var(--accent);
  font: 600 11px/1.4 var(--ui-font);
}
.reader-edition.library-index .library-group-count[hidden],
.reader-edition.library-index .library-group-place[hidden] {
  display: none;
}
.reader-edition.library-index .library-group[open] > summary {
  position: sticky;
  top: var(--site-nav-height);
  z-index: 2;
  border-radius: 9px 9px 0 0;
  background: var(--accent-soft);
}
@media (max-width: 280px) {
  .reader-edition.library-index .library-group > summary {
    flex-wrap: wrap;
    gap: 6px;
  }
  .reader-edition.library-index .library-range-label {
    flex-basis: calc(100% - 24px);
  }
  .library-range-status {
    order: 1;
    flex-basis: 100%;
    text-align: left;
  }
}
.reader-edition.library-index .library-group-entries {
  padding: 4px 8px;
}
.reader-edition.library-index .library-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 4px;
  align-items: center;
  padding: 0;
  border-radius: 0;
}
.reader-edition.library-index .library-entry :is(a, button) {
  scroll-margin-block: calc(var(--site-nav-height) + 76px);
}
.reader-edition.library-index .library-entry[hidden] {
  display: none;
}
.reader-edition.library-index .library-group-entries .library-entry > a {
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: auto;
  gap: 12px;
}
.reader-edition.library-index .library-entry[data-reading='read']:not(.library-entry-current) > a {
  padding-block: 10px;
}
.reader-edition.library-index
  .library-entry[data-reading='read']:not(.library-entry-current)
  .library-entry-number::after {
  content: '✓';
  display: block;
  color: var(--accent);
  font: 650 11px/1.4 var(--ui-font);
}
.reader-edition.library-index .library-group-entries .library-entry-number {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  padding-top: 2px;
  color: var(--secondary);
  font: 550 12px/1.5 var(--ui-font);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.reader-edition.library-index .library-group-entries .library-entry-identity {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  gap: 4px;
}
.reader-edition.library-index .library-group-entries .library-entry-status {
  grid-column: auto;
  grid-row: auto;
  width: fit-content;
  font: 500 11px/1.4 var(--ui-font);
}
.reader-edition.library-index .library-entry[data-reading='read'] .library-entry-title {
  color: var(--secondary);
}
.reader-edition.library-index .library-entry-current {
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-soft) 55%, transparent);
  box-shadow: inset 2px 0 0 var(--accent);
}
.reader-edition.library-index .library-entry-current .library-entry-title {
  color: var(--ink);
}
.reader-edition.library-index .library-entry-current .library-entry-status {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
}
.reader-edition.library-index .library-entry-bookmark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--secondary);
  font-size: 20px;
}
.reader-edition.library-index .library-entry-bookmark[aria-pressed='true'] {
  background: var(--accent-soft);
  color: var(--accent);
}
.reader-edition.library-index .library-entry-title {
  font: 500 15px/1.5 var(--ui-font);
  letter-spacing: -0.025em;
}
.reader-edition.library-index .library-reading-actions {
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-soft), var(--paper));
  box-shadow: var(--surface-shadow);
}
.reader-edition.library-index :is(#chapter-filter, .library-find button, .library-filter),
.reader-edition :is(.passage-form input, .passage-form select) {
  border-radius: 10px;
}
.reader-edition.library-index .library-filter[aria-pressed='true'] {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}
.reader-edition.library-index #continue-reading {
  border-radius: 999px;
}
.reader-edition :is(.appearance-panel, .reader-more-panel) {
  border-color: var(--line);
  background: var(--paper);
  box-shadow: 0 20px 70px #00000030;
  border-radius: 16px;
}
.reader-edition .site-header :is(button, summary),
.reader-edition :is(.reader-tools-bookmark, .reader-adjacent-chapters a) {
  border-radius: 10px;
}
.reader-edition[data-chapter] .reading-shell {
  border-radius: 20px;
  box-shadow: var(--surface-shadow);
}
.reader-edition[data-chapter] .chapter-navigation .next-chapter {
  border-radius: 16px;
  background: linear-gradient(
    125deg,
    var(--paper),
    color-mix(in srgb, var(--paper) 88%, var(--accent-soft))
  );
  box-shadow: 0 8px 28px color-mix(in srgb, var(--ink) 5%, transparent);
}
.reader-edition :is(.passage-form, .saved-section) {
  border-radius: 18px;
  box-shadow: var(--surface-shadow);
}
.reader-edition :is(button, a, summary, select) {
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 641px) {
  .reader-edition .home-topline nav {
    padding: 4px;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--paper) 75%, transparent);
  }
  .reader-edition .home-topline nav > a {
    padding-inline: 20px;
  }
}
@media (max-width: 800px) {
  .reader-edition.reader-home .home-copy h1 {
    font-size: clamp(58px, 10vw, 80px);
  }
}
@media (max-width: 640px) {
  .reader-edition.reader-home .home-intro {
    padding-top: 38px;
    padding-bottom: 46px;
  }
  .reader-edition.reader-home .home-copy h1 {
    font-size: clamp(42px, 12vw, 74px);
  }
  .reader-edition.reader-home .home-opening {
    margin-top: 38px;
    padding: 28px 24px;
    border-radius: 16px;
    box-shadow: var(--surface-shadow);
  }
  .reader-edition.reader-home .home-reading-card {
    padding: 22px;
  }
  .reader-edition[data-chapter] .reading-shell {
    border-radius: 0;
    box-shadow: none;
  }
}
@media (max-width: 360px) {
  .reader-edition.reader-home .home-copy h1 {
    font-size: clamp(29px, 11.5vw, 42px);
  }
  .reader-edition.reader-home .home-opening {
    padding: 24px 18px;
  }
  .reader-edition.reader-home .home-reading-card {
    padding: 18px;
  }
}

/* Animation changes composited pixels, never story layout or reading scroll. */
/* Reader settings: choices preview their real paper/ink, without extra prose. */
.reader-edition[data-chapter] .appearance-panel {
  box-sizing: border-box;
  width: min(360px, calc(100vw - 24px));
  padding: 18px;
}
.reader-edition .appearance-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -6px -6px 14px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.reader-edition .appearance-heading strong {
  color: var(--ink);
  font: 650 14px/1.4 var(--ui-font);
}
.reader-edition .appearance-panel button {
  cursor: pointer;
}
.reader-edition .appearance-close {
  width: 44px;
  min-height: 44px;
  flex: 0 0 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--secondary);
  font: 400 26px/1 var(--ui-font);
}
.reader-edition .appearance-basics {
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}
.reader-edition .appearance-basics > .appearance-choice:not(.appearance-theme-choice) {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.reader-edition .appearance-basics > .appearance-choice:not(.appearance-theme-choice) > label {
  margin: 0;
}
.reader-edition .appearance-theme-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 4px;
}
.reader-edition .appearance-theme-grid > button {
  --swatch-paper: #fffefb;
  --swatch-ink: #202d27;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 0;
  min-height: 84px;
  padding: 12px 3px 10px;
  border: 1px solid color-mix(in srgb, var(--swatch-ink) 20%, var(--swatch-paper));
  border-radius: 10px;
  background: var(--swatch-paper);
  color: var(--swatch-ink);
}
.reader-edition .appearance-theme-grid > [data-appearance-look='warm'] {
  --swatch-paper: #fff8ec;
  --swatch-ink: #40352c;
}
.reader-edition .appearance-theme-grid > [data-appearance-look='nightfall'] {
  --swatch-paper: #142329;
  --swatch-ink: #edf4e9;
}
.reader-edition .appearance-theme-grid > [data-appearance-look='black'] {
  --swatch-paper: #000;
  --swatch-ink: #e5e5e5;
}
.reader-edition .appearance-theme-grid > [aria-pressed='true'] {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.reader-edition .appearance-theme-sample {
  font:
    500 24px/1 Georgia,
    serif;
}
.reader-edition .appearance-theme-name {
  font: 550 10px/1.2 var(--ui-font);
  white-space: nowrap;
}
.reader-edition .appearance-theme-check {
  position: absolute;
  top: 4px;
  right: 5px;
  opacity: 0;
  font: 700 11px/1 var(--ui-font);
}
.reader-edition [aria-pressed='true'] > .appearance-theme-check {
  opacity: 1;
}
.reader-edition .appearance-size-control:has(> button:not([hidden])) {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 4px;
}
.reader-edition .appearance-size-control > button {
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--ink);
  font:
    550 16px/1 Georgia,
    serif;
}
.reader-edition .appearance-size-control > button:disabled {
  opacity: 0.35;
  cursor: default;
}
.reader-edition .appearance-size-control select {
  padding-inline: 5px;
  font-size: 13px;
}
.reader-edition .appearance-panel [hidden] {
  display: none !important;
}

/* One compact header control, with the existing four reading appearances. */
.reader-edition .home-topline {
  position: sticky;
  top: 0;
  left: auto;
  transform: none;
  margin-inline: calc(-1 * var(--edition-gutter));
  z-index: 20;
}
.reader-edition .theme-picker {
  position: relative;
  flex: 0 0 auto;
}
.reader-edition .theme-picker > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 84px;
  min-height: 44px;
  padding: 0 10px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--accent-soft);
  font: 600 11px/1 var(--ui-font);
  list-style: none;
  cursor: pointer;
}
.reader-edition .theme-picker > summary::-webkit-details-marker {
  display: none;
}
.reader-edition .theme-picker[open] > summary {
  border-color: var(--accent);
}
.reader-edition .theme-picker-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 10px);
  right: 0;
  width: min(296px, calc(100vw - 24px));
  max-height: calc(100dvh - var(--site-nav-height) - 24px);
  overflow-y: auto;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 12px 40px #0003;
}
.reader-edition .theme-picker:not([open]) > .theme-picker-panel {
  display: none;
}
.reader-edition .theme-picker-panel .appearance-theme-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.reader-edition .theme-picker-panel .appearance-theme-grid > button {
  min-height: 68px;
}
.reader-edition .home-topline .theme-picker-panel #theme-toggle {
  width: 100%;
  margin-top: 10px;
  border: 1px solid var(--line);
  background: transparent;
}
.reader-edition .theme-picker-panel .theme-action-label {
  display: inline;
}
@media (max-width: 640px) {
  :root {
    --site-nav-height: 56px;
  }
  .reader-edition .theme-picker > summary {
    width: 44px;
    padding: 0;
  }
  .theme-picker-label {
    display: inline;
  }
  .reader-edition .theme-picker > summary .theme-icon {
    display: none;
  }
}
@media (min-width: 1000px) {
  .library-sidebar {
    top: calc(var(--site-nav-height) + 20px);
    max-height: calc(100dvh - var(--site-nav-height) - 40px);
  }
}
.reader-edition :is(.library-group, .library-earlier) > summary,
.reader-edition.saved-index :is(.saved-chapter-link, .saved-bookmark-remove) {
  scroll-margin-top: calc(var(--site-nav-height) + 12px);
}
@media (max-width: 640px) {
  .reader-edition[data-chapter] .appearance-panel {
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    padding: 16px;
  }
}
@media (max-width: 300px) {
  .reader-edition .appearance-theme-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .reader-edition .appearance-basics > .appearance-choice:not(.appearance-theme-choice) {
    grid-template-columns: minmax(0, 1fr);
  }
}

@keyframes ui-arrive {
  from {
    transform: translateY(6px);
  }
  to {
    transform: none;
  }
}
@keyframes ui-reveal {
  from {
    opacity: 0.7;
    transform: translateY(-4px);
    transform-origin: top;
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion='reduced'])
    .reader-home
    :is(.home-copy, .home-description-column, .home-reading-column, .home-opening) {
    animation: ui-arrive 260ms var(--ui-ease) backwards;
  }
  :root:not([data-motion='reduced'])
    .reader-edition
    :is(.appearance[open] > .appearance-panel, .reader-more[open] > .reader-more-panel) {
    animation: ui-reveal 140ms var(--ui-ease) backwards;
  }
  :root:not([data-motion='reduced']) .reader-edition .library-group[open] .library-group-entries {
    animation: ui-arrive 180ms var(--ui-ease) backwards;
  }
  :root:not([data-motion='reduced']) .reader-edition :is(button, a, summary, select, input) {
    transition:
      color 140ms ease,
      background-color 140ms ease,
      border-color 140ms ease,
      box-shadow 160ms ease,
      scale 120ms var(--ui-ease);
  }
  :root:not([data-motion='reduced'])
    .reader-edition
    :is(.home-opening, .home-reading-card, .library-entry, .passage-hit, .next-chapter) {
    transition:
      border-color 200ms ease,
      box-shadow 300ms ease,
      background-color 200ms ease;
  }
  :root:not([data-motion='reduced']) .reader-edition .library-group > summary::after {
    transition: transform 250ms var(--ui-ease);
  }
  :root:not([data-motion='reduced'])
    .reader-edition
    :is(
      button,
      summary,
      .home-primary,
      .chapter-navigation-compact a,
      .home-topline nav > a
    ):active {
    scale: 0.98;
  }
  :root:not([data-motion='reduced']) .reader-edition :is(.passage-group, .saved-note) {
    animation: ui-arrive 180ms var(--ui-ease) backwards;
  }
}
/* The reader's own Reduced setting has the same scope as the OS preference. */
:root[data-motion='reduced'] .reader-edition *,
:root[data-motion='reduced'] .reader-edition *::before,
:root[data-motion='reduced'] .reader-edition *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
@media (hover: hover) and (pointer: fine) {
  .reader-edition .home-topline nav > a:hover,
  .reader-edition .site-header nav > a:hover {
    color: var(--accent);
    background: var(--accent-soft);
    text-decoration: none;
  }
  .reader-edition.library-index .library-entry:hover {
    background: var(--accent-soft);
  }
  .reader-edition.library-index .library-group > summary:hover {
    background: var(--accent-soft);
  }
  .reader-edition :is(.home-primary, .next-chapter):hover {
    text-decoration: none;
    box-shadow: 0 10px 36px color-mix(in srgb, var(--accent) 25%, transparent);
  }
}
@media (prefers-reduced-motion: reduce) {
  .reader-edition *,
  .reader-edition::before,
  .reader-edition *::before,
  .reader-edition *::after {
    animation: none !important;
  }
}

/* Home has two compositions: an introduction, and a compact reading place. */
.reader-edition.reader-home .home-intro {
  max-width: 1120px;
  margin-inline: auto;
  padding-block: 52px 64px;
  column-gap: clamp(32px, 5vw, 64px);
}
.reader-edition.reader-home .home-copy h1 {
  font-size: clamp(54px, 6.3vw, 88px);
}
.reader-edition.reader-home .home-copy .translation-credit {
  margin-top: 18px;
}
.reader-edition.reader-home .home-description-column {
  margin-top: 22px;
}
.reader-edition.reader-home .home-description-column .home-series-lede {
  font-size: 17px;
  line-height: 1.65;
}
.reader-edition.reader-home .home-reading-column {
  padding-top: 24px;
}
.reader-edition.reader-home .home-opening {
  padding: 32px;
}
.reader-edition.reader-home:has(#reading-card:not([hidden])) .home-intro,
html[data-reader-loading='returning'] .reader-edition.reader-home .home-intro {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  grid-template-rows: auto auto;
  gap: 30px 48px;
  padding-block: 32px 48px;
}
.reader-edition.reader-home:has(#reading-card:not([hidden])) .home-copy,
html[data-reader-loading='returning'] .reader-edition.reader-home .home-copy {
  grid-area: 1 / 1 / auto / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 0 0 24px;
  border-bottom: 1px solid var(--line);
}
.reader-edition.reader-home:has(#reading-card:not([hidden])) .home-copy h1,
html[data-reader-loading='returning'] .reader-edition.reader-home .home-copy h1 {
  font-family: var(--ui-font);
  font-weight: 700;
  font-size: 36px;
  line-height: 1.15;
  letter-spacing: -0.055em;
}
.reader-edition.reader-home:has(#reading-card:not([hidden]))
  .home-copy
  :is(.home-title-line, h1 em),
html[data-reader-loading='returning']
  .reader-edition.reader-home
  .home-copy
  :is(.home-title-line, h1 em) {
  display: inline;
}
.reader-edition.reader-home:has(#reading-card:not([hidden])) .home-copy .translation-credit,
html[data-reader-loading='returning'] .reader-edition.reader-home .home-copy .translation-credit {
  margin: 0;
}
.reader-edition.reader-home:has(#reading-card:not([hidden])) .home-reading-column,
html[data-reader-loading='returning'] .reader-edition.reader-home .home-reading-column {
  grid-area: 2 / 1;
  padding: 0;
  min-width: 0;
}

.reader-edition.reader-home .home-bookmarks {
  min-width: 0;
  margin-top: 24px;
}
.reader-edition.reader-home .home-history-notice {
  grid-area: 6 / 1 / auto / -1;
}
.home-bookmarks[hidden] {
  display: none;
}
.home-shelf-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.reader-edition .home-shelf-heading h2 {
  margin: 0;
  font: 600 13px/1.5 var(--ui-font);
  letter-spacing: -0.01em;
  color: var(--secondary);
}
.home-shelf-heading > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent);
  font: 600 11px/1.5 var(--ui-font);
}
.home-chapter-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}
.reader-edition.reader-home .home-chapter-list li {
  display: block;
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.reader-edition.reader-home .home-chapter-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  gap: 4px 18px;
  min-height: 72px;
  padding: 15px 12px;
  border-radius: 8px;
  border-bottom: 0;
}
.home-chapter-number {
  color: var(--secondary);
  font: 500 10px/1.5 var(--ui-font);
}
.home-chapter-title {
  grid-column: 1;
  overflow-wrap: anywhere;
  color: var(--ink);
  font: 500 15px/1.5 var(--ui-font);
  letter-spacing: -0.02em;
}
.home-chapter-arrow {
  grid-area: 1 / 2 / span 2;
  align-self: center;
  justify-self: end;
  color: var(--accent);
}
.reader-edition.reader-home .home-bookmarks .home-chapter-list a {
  min-height: 72px;
  height: 100%;
  padding: 12px;
}
.reader-edition.reader-home #home-bookmark-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  border-top: 0;
}
.reader-edition.reader-home #home-bookmark-list li {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}
.reader-edition.reader-home:has(#reading-card:not([hidden])) .home-history-notice {
  grid-area: 4 / 1 / auto / -1;
}
@media (hover: hover) and (pointer: fine) {
  .home-chapter-list a:hover {
    background: var(--accent-soft);
    text-decoration: none;
  }
}

@media (max-width: 800px) {
  .reader-edition.reader-home .home-intro {
    padding-top: 36px;
  }
  .reader-edition.reader-home .home-copy h1 {
    font-size: clamp(44px, 8vw, 68px);
  }
  .reader-edition.reader-home:has(#reading-card:not([hidden])) .home-intro,
  html[data-reader-loading='returning'] .reader-edition.reader-home .home-intro {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding-top: 26px;
  }
  .reader-edition.reader-home:has(#reading-card:not([hidden])) .home-copy,
  html[data-reader-loading='returning'] .reader-edition.reader-home .home-copy {
    gap: 8px;
    padding-bottom: 20px;
  }
  .reader-edition.reader-home:has(#reading-card:not([hidden])) .home-copy h1,
  html[data-reader-loading='returning'] .reader-edition.reader-home .home-copy h1 {
    font-size: 29px;
  }
  .reader-home:has(#reading-card:not([hidden])) .home-heading,
  html[data-reader-loading='returning'] .reader-home .home-heading {
    width: 100%;
    min-height: 80px;
    gap: 0;
  }
  .reader-home:has(#reading-card:not([hidden])) .home-heading h1 {
    flex: 1;
    min-width: 0;
  }
  .reader-home:has(#reading-card:not([hidden])) .home-emul,
  html[data-reader-loading='returning'] .reader-home .home-emul {
    flex-basis: 100px;
    width: 100px;
    margin-block: -25px;
  }

  .reader-edition.reader-home .home-history-notice {
    grid-area: 7 / 1;
  }
  .reader-edition.reader-home:has(#reading-card:not([hidden])) .home-history-notice {
    grid-area: 5 / 1;
  }
}
@media (max-width: 640px) {
  .reader-edition.reader-home .home-intro {
    padding-top: 28px;
  }
  .reader-edition.reader-home .home-copy > .chapter-eyebrow {
    margin-bottom: 18px;
  }
  .reader-edition.reader-home .home-copy h1 {
    font-size: clamp(36px, 10.5vw, 56px);
  }
  .reader-edition.reader-home .home-opening {
    margin-top: 28px;
    padding: 26px 22px;
  }
}

/* Saved: a compact chapter shelf, with passages beside it when present. */
.reader-edition.saved-index .saved-shelf {
  display: grid;
  gap: 24px;
  max-width: 1120px;
  margin: 20px auto 0;
  align-items: start;
}
.reader-edition.saved-index .saved-section {
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 20px;
  box-shadow: none;
  border-radius: 16px;
}
.reader-edition.saved-index .saved-section[hidden],
.reader-edition.saved-index .saved-empty[hidden],
.reader-edition.saved-index .saved-bookmark-status[hidden] {
  display: none;
}
.reader-edition.saved-index .saved-section-heading {
  align-items: center;
  padding-bottom: 14px;
}
.reader-edition.saved-index .saved-section-heading h2 {
  font: 650 18px/1.4 var(--ui-font);
  letter-spacing: -0.025em;
}
.reader-edition.saved-index #bookmarks-count:not(:empty) {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.reader-edition.saved-index .saved-bookmark {
  padding: 0;
}
.reader-edition.saved-index .saved-bookmark:last-child {
  border-bottom: 0;
}
.reader-edition.saved-index #saved-bookmarks {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.reader-edition.saved-index #saved-bookmarks:not(:empty) {
  margin-top: 12px;
}
.reader-edition.saved-index #saved-bookmarks > .saved-bookmark {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.reader-edition.saved-index #saved-bookmarks .saved-chapter-link {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  min-height: 0;
  padding: 16px;
}
.reader-edition.saved-index #saved-bookmarks .saved-chapter-number {
  display: flex;
  align-items: center;
  min-height: 28px;
  padding-right: 44px;
  color: var(--secondary);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.reader-edition.saved-index .saved-bookmark-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  font: 22px/1 var(--ui-font);
  cursor: pointer;
}
.reader-edition.saved-index .saved-bookmark-remove:hover {
  border-color: var(--line);
  background: var(--accent-soft);
}
.reader-edition.saved-index #saved-bookmarks > .saved-bookmark:focus-within {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
.reader-edition.saved-index #saved-bookmarks .saved-bookmark-status {
  margin: 0 16px 16px;
}
.reader-edition.saved-index #saved-bookmarks .saved-unavailable {
  grid-column: 1 / -1;
}
.reader-edition.saved-index .saved-bookmark-feedback {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin: 0 0 12px;
  color: var(--secondary);
  font: 500 12px/1.5 var(--ui-font);
}
.reader-edition.saved-index .saved-bookmark-feedback[hidden] {
  display: none;
}
.reader-edition.saved-index #saved-bookmark-message {
  margin: 0;
}
.reader-edition.saved-index #saved-bookmark-undo {
  min-height: 44px;
  margin-left: auto;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
}
@media (min-width: 1000px) {
  .reader-edition.saved-index
    .saved-shelf:not(:has(#saved-notes-section:not([hidden])))
    #saved-bookmarks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.reader-edition.saved-index .saved-chapter-link {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
  min-height: 64px;
  padding: 18px 0;
  color: var(--ink);
  font: 600 15px/1.5 var(--ui-font);
  text-decoration: none;
}
.reader-edition.saved-index .saved-chapter-link:hover .saved-chapter-title {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.reader-edition.saved-index .saved-chapter-number {
  color: var(--secondary);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.reader-edition.saved-index
  .saved-bookmark:has(.saved-bookmark-status:not([hidden]))
  .saved-chapter-link {
  min-height: 0;
  padding-bottom: 3px;
}
.reader-edition.saved-index .saved-bookmark .saved-bookmark-status {
  margin: 0 0 14px 64px;
  color: var(--secondary);
  font: 500 11px/1.5 var(--ui-font);
}
.reader-edition.saved-index .saved-empty {
  margin: 0;
  padding: 16px 0;
}
.reader-edition.saved-index #bookmarks-empty {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 22px 4px;
}
.reader-edition.saved-index #bookmarks-empty[hidden] {
  display: none;
}
.reader-edition.saved-index .saved-empty-star {
  display: block;
  color: var(--accent);
  font: 36px/1 var(--ui-font);
}
.reader-edition.saved-index .saved-empty h3 {
  margin: 0;
  font: 600 18px/1.4 var(--ui-font);
}
.reader-edition.saved-index .saved-empty p {
  margin: 4px 0 0;
  color: var(--secondary);
  font-size: 13px;
}
.reader-edition.saved-index .saved-empty a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-align: center;
  text-decoration: none;
  font-weight: 650;
}
.reader-edition.saved-index .saved-empty a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.reader-edition.saved-index #saved-note-search {
  margin: 16px 0 0;
  border-radius: 10px;
}
.reader-edition.saved-index .saved-note {
  padding: 22px 0 16px;
}
.reader-edition.saved-index .saved-note:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.reader-edition.saved-index .saved-note h3 {
  color: var(--secondary);
  font: 600 12px/1.5 var(--ui-font);
}
.reader-edition.saved-index .saved-note blockquote {
  margin: 14px 0;
  padding: 4px 0 4px 16px;
  font: 400 17px/1.65 var(--chapter-font);
}
.reader-edition.saved-index .saved-note .saved-note-comment {
  margin: 14px 0;
  font: 400 14px/1.6 var(--ui-font);
}
.reader-edition.saved-index .saved-note-actions {
  gap: 8px;
  margin-top: 6px;
}
.reader-edition.saved-index .saved-note-actions button {
  min-height: 44px;
  padding: 8px 10px;
  background: transparent;
  border-color: transparent;
  color: var(--secondary);
}
.reader-edition.saved-index .saved-note-actions button:hover {
  border-color: var(--line);
  color: var(--ink);
}
.reader-edition.saved-index .saved-note-feedback:has(p:empty):not(:has(button:not([hidden]))) {
  display: none;
}
.reader-edition.saved-index
  :is(.saved-legacy, .reading-recovery, .offline-reading, #saved-warning) {
  max-width: 1120px;
  margin-inline: auto;
}
.reader-edition.saved-index .saved-legacy {
  margin-top: 24px;
}
.reader-edition.saved-index .reading-recovery {
  margin-top: 24px;
}
#account-sync .account-sync-row:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
#account-sign-out {
  background: transparent;
}
.reader-edition.saved-index #saved-warning:empty {
  display: none;
}
@media (min-width: 1000px) {
  .reader-edition.saved-index .saved-shelf:has(#saved-notes-section:not([hidden])) {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  }
}
@media (max-width: 640px) {
  .reader-edition.saved-index #bookmarks-empty {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 12px;
    padding: 16px 0;
  }
  .reader-edition.saved-index .saved-empty-star {
    align-self: start;
    font-size: 30px;
  }
  .reader-edition.saved-index .saved-empty a {
    grid-column: 2;
    justify-self: start;
  }
  .reader-edition.saved-index .saved-section {
    padding: 16px;
  }
  .reader-edition.saved-index .saved-chapter-link {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
    font-size: 14px;
  }
  .reader-edition.saved-index .saved-bookmark .saved-bookmark-status {
    margin-left: 54px;
  }
}
@media (max-width: 280px) {
  .reader-edition.saved-index #bookmarks-empty {
    grid-template-columns: minmax(0, 1fr);
  }
  .reader-edition.saved-index .saved-empty-star {
    display: none;
  }
  .reader-edition.saved-index .saved-empty a {
    grid-column: 1;
  }
}

/* Search shares the compact shelf layout; matched passages stay primary. */
.reader-edition.search-index
  :is(.passage-form, #passage-results, #passage-status, .passage-coverage) {
  max-width: 1120px;
  margin-inline: auto;
}
.reader-edition.search-index .passage-form {
  margin-top: 20px;
  padding: 20px;
  box-shadow: none;
  border-radius: 16px;
}
.reader-edition.search-index .passage-query-row {
  gap: 10px;
}
.reader-edition.search-index .passage-query-row :is(input, button) {
  min-height: 48px;
  border-radius: 10px;
  font-family: var(--ui-font);
}
.reader-edition.search-index .passage-filters {
  gap: 10px;
  margin-top: 14px;
  font-size: 12px;
}
.reader-edition.search-index .passage-filters #passage-through {
  width: 70px;
  min-height: 44px;
  font-variant-numeric: tabular-nums;
}
.reader-edition.search-index .passage-filters label:last-child {
  min-height: 44px;
}
.reader-edition.search-index .passage-coverage {
  padding: 0 2px;
  margin-top: 10px;
  font: 400 12px/1.6 var(--ui-font);
}
.reader-edition.search-index #passage-status {
  min-height: 0;
  margin-top: 24px;
  margin-bottom: 14px;
  font: 500 13px/1.6 var(--ui-font);
  color: var(--secondary);
}
.reader-edition.search-index .passage-group {
  padding: 18px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}
.reader-edition.search-index .passage-group-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.reader-edition.search-index .passage-group h2 {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  margin: 0;
  color: var(--ink);
  font: 600 14px/1.5 var(--ui-font);
  overflow-wrap: anywhere;
}
.reader-edition.search-index .passage-chapter-label {
  color: var(--secondary);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.reader-edition.search-index .passage-match-count {
  color: var(--secondary);
  font: 500 11px/1.6 var(--ui-font);
  white-space: nowrap;
}
.reader-edition.search-index .passage-hit {
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 0;
  border-left: 2px solid var(--line);
  border-radius: 0 8px 8px 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.7;
}
.reader-edition.search-index .passage-hit:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.reader-edition.search-index .passage-hit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.reader-edition.search-index .passage-hit mark {
  padding: 1px 2px;
  border-radius: 3px;
}
.reader-edition.search-index .passage-chapter-actions {
  margin: 12px 0 0;
}
.reader-edition.search-index .passage-chapter-actions button {
  background: transparent;
  font-size: 12px;
}
@media (max-width: 640px) {
  .reader-edition.search-index :is(.passage-form, .passage-group) {
    padding: 16px;
  }
  .reader-edition.search-index .passage-group-heading {
    gap: 10px;
  }
  .reader-edition.search-index .passage-group h2 {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
  .reader-edition.search-index .passage-hit {
    padding: 10px 12px;
    font-size: 15px;
  }
}
@media (max-width: 280px) {
  .reader-edition.search-index .passage-group-heading {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Reading-led Home: a chapter opening, a quiet shelf, a secondary source rail. */
.reader-edition.reader-home:has(#reading-card:not([hidden])) .home-intro,
html[data-reader-loading='returning'] .reader-edition.reader-home .home-intro {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.43fr);
  column-gap: clamp(40px, 6vw, 88px);
}
.reader-edition.reader-home .home-reading-card {
  padding: 28px 0 24px;
  border: 0;
  border-top: 2px solid var(--accent);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.reader-edition.reader-home .home-reading-card h2 {
  order: 0;
  max-width: 32ch;
  margin: 0;
  color: var(--ink);
  font: 400 clamp(24px, 2.6vw, 34px)/1.25 var(--folio-display);
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}
.reader-edition.reader-home .home-reading-card .home-reading-progress {
  order: -1;
  margin: 0 0 12px;
  color: var(--accent);
  font: 600 12px/1.5 var(--ui-font);
}
.reader-edition.reader-home .home-reading-card #continue-reading {
  order: 2;
  min-height: 48px;
  margin-top: 24px;
  border-radius: 5px;
  box-shadow: none;
}
.reader-edition.reader-home .home-actions .home-primary {
  border-radius: 5px;
  box-shadow: none;
}
.reader-edition.reader-home .home-bookmarks {
  margin-top: 30px;
}
.reader-edition.reader-home #home-bookmark-list {
  display: block;
  border-top: 1px solid var(--line);
}
.reader-edition.reader-home #home-bookmark-list li {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.reader-edition.reader-home .home-bookmarks .home-chapter-list a {
  grid-template-columns: 72px minmax(0, 1fr) 20px;
  gap: 12px;
  align-items: baseline;
  min-height: 64px;
  padding: 18px 0;
  border-radius: 0;
}
.reader-edition.reader-home .home-bookmarks .home-chapter-title {
  grid-column: 2;
  font-size: 14px;
  font-weight: 500;
}
.reader-edition.reader-home .home-bookmarks .home-chapter-number {
  font-size: 11px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.reader-edition.reader-home .home-bookmarks .home-chapter-arrow {
  grid-area: 1 / 3;
}
.reader-edition.reader-home .home-slf {
  padding-top: 28px;
}
.reader-edition.reader-home .home-slf h2 {
  margin-bottom: 18px;
  color: var(--secondary);
  font: 600 13px/1.5 var(--ui-font);
  letter-spacing: 0;
}
.reader-edition.reader-home .home-resources {
  gap: 0;
  border-top: 1px solid var(--line);
}
.reader-edition.reader-home .home-resource {
  grid-template-columns: 24px minmax(0, 1fr) 16px;
  min-height: 92px;
  padding: 20px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.reader-edition.reader-home .resource-icon {
  width: 24px;
  height: 28px;
  border-radius: 0;
  color: var(--secondary);
  background: transparent;
}
.reader-edition.reader-home .resource-icon svg {
  width: 20px;
  height: 20px;
}
.reader-edition.reader-home .resource-copy {
  gap: 5px;
}
.reader-edition.reader-home .resource-copy strong {
  font-size: 14px;
  font-weight: 550;
}
.reader-edition.reader-home .resource-copy small {
  font-size: 11px;
}
.reader-edition.reader-home .resource-arrow {
  align-self: center;
  color: var(--secondary);
  font-size: 15px;
}
.reader-edition.reader-home:has(#reading-card:not([hidden])) .home-slf,
html[data-reader-loading='returning'] .reader-edition.reader-home .home-slf {
  padding: 4px 0 0;
}
.reader-edition.reader-home:has(#reading-card:not([hidden])) .home-resource,
html[data-reader-loading='returning'] .reader-edition.reader-home .home-resource {
  padding-inline: 0;
}
.reader-edition.reader-home .home-opening {
  border-radius: 2px;
  border: 0;
  border-top: 2px solid var(--accent);
  background: var(--paper);
  box-shadow: 0 12px 36px color-mix(in srgb, var(--ink) 5%, transparent);
}
:root[data-look='editorial'] .reader-edition.preview-index {
  background-color: var(--page);
  background-image: none;
}
:root:is([data-look='editorial'], [data-look='warm']) .reader-home .home-intro::before {
  background: none;
}
:root:is([data-look='editorial'], [data-look='warm'])
  .reader-edition.preview-index
  :is(.saved-section, .passage-form, .passage-group, .library-group) {
  border-radius: 5px;
  box-shadow: 0 4px 18px color-mix(in srgb, var(--ink) 3%, transparent);
}
:root[data-look='black'] .reader-edition.preview-index {
  background-color: #000;
  background-image: none;
}
:root[data-look='black']
  .reader-edition.preview-index
  :is(.saved-section, .passage-form, .passage-group, .library-group) {
  border-radius: 5px;
  box-shadow: none;
}
:root[data-look='black'] .reader-edition.reader-home .home-opening {
  background: transparent;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}
:root[data-look='black'] .reader-edition.reader-home :is(.home-primary, #continue-reading) {
  box-shadow: none;
}
@media (hover: hover) and (pointer: fine) {
  .reader-edition.reader-home .home-resource:hover {
    background: transparent;
    box-shadow: none;
  }
  .reader-edition.reader-home .home-resource:hover :is(strong, .resource-arrow) {
    color: var(--accent);
  }
  .reader-edition.reader-home .home-resource:hover strong {
    text-decoration: underline;
    text-underline-offset: 4px;
  }
}
@media (max-width: 800px) {
  .reader-edition.reader-home:has(#reading-card:not([hidden])) .home-intro,
  html[data-reader-loading='returning'] .reader-edition.reader-home .home-intro {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .reader-edition.reader-home .home-reading-card h2 {
    font-size: clamp(24px, 4vw, 30px);
  }
  .reader-edition.reader-home .home-resource {
    min-height: 80px;
    padding-inline: 0;
  }
}
@media (max-width: 420px) {
  .reader-edition.reader-home .home-bookmarks .home-chapter-list a {
    grid-template-columns: 58px minmax(0, 1fr) 16px;
    gap: 8px;
  }
  .reader-edition.reader-home .home-bookmarks .home-chapter-title {
    font-size: 13px;
  }
}
@media (max-width: 280px) {
  .reader-edition.reader-home .home-reading-card h2 {
    font-size: 24px;
  }
}

/* Keep the novel's cover title distinct from the site's serif wordmark. */
.reader-edition.reader-home #site-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font: 750 clamp(42px, 5vw, 68px)/0.98 var(--ui-font);
  letter-spacing: 0.015em;
  text-transform: uppercase;
  color: var(--ink);
}
.reader-edition.reader-home .home-copy #site-title :is(.home-title-line, em) {
  display: block;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
}
.reader-edition.reader-home:has(#reading-card:not([hidden])) #site-title,
html[data-reader-loading='returning'] .reader-edition.reader-home #site-title {
  font-size: 32px;
  letter-spacing: 0.025em;
}
.reader-edition.reader-home .home-reading-card {
  /* The accessible H2 precedes the controls in DOM order, but the real
     Continue action belongs above a potentially very long chapter title. */
  flex-direction: column;
  align-items: stretch;
}
.reader-edition.reader-home .home-reading-card .home-reading-progress {
  order: 0;
}
.reader-edition.reader-home .home-reading-card h2 {
  order: 2;
  margin: 16px 0 0;
}
.reader-edition.reader-home .home-reading-actions {
  order: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 14px;
}
.reader-edition.reader-home .home-reading-actions #continue-reading {
  order: 0;
  margin: 0;
  padding-inline: 18px;
}
.reader-edition.reader-home :is(.home-reading-actions, .home-actions) .home-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 100px;
  margin: 0;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  font: 650 13px/1.4 var(--ui-font);
  text-decoration: none;
}
.reader-edition.reader-home .home-reading-actions .home-secondary {
  order: 1;
}
.reader-edition.reader-home :is(.home-reading-actions, .home-actions) .home-secondary[hidden] {
  display: none;
}
.reader-edition.reader-home .home-reading-card:not([hidden]) + .home-actions {
  display: none;
}
@media (hover: hover) and (pointer: fine) {
  .reader-edition.reader-home :is(.home-reading-actions, .home-actions) .home-secondary:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    text-decoration: none;
  }
}
@media (max-width: 640px) {
  .reader-edition.reader-home #site-title {
    font-size: 42px;
  }
  .reader-edition.reader-home:has(#reading-card:not([hidden])) #site-title,
  html[data-reader-loading='returning'] .reader-edition.reader-home #site-title {
    font-size: clamp(22px, 6vw, 28px);
  }
}
@media (max-width: 280px) {
  .reader-edition.reader-home .home-heading,
  .reader-edition.reader-home:has(#reading-card:not([hidden])) .home-heading,
  html[data-reader-loading='returning'] .reader-edition.reader-home .home-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 80px;
  }
  .reader-edition.reader-home .home-heading h1 {
    flex: 1;
    min-width: 0;
  }
  .reader-edition.reader-home #site-title {
    font-size: 22px;
  }
  .reader-edition.reader-home .home-emul,
  .reader-edition.reader-home:has(#reading-card:not([hidden])) .home-emul,
  html[data-reader-loading='returning'] .reader-edition.reader-home .home-emul {
    position: static;
    flex: 0 0 56px;
    width: 56px;
    margin: 0;
  }
  .reader-edition.reader-home .home-reading-actions > a {
    flex: 1 1 100%;
    justify-content: center;
  }
}

/* Reserve the desktop Library saved-place card before deferred reader.js
   hydrates it. A hidden, 44px locator by itself cannot reserve the additional
   progress/Continue row: the chapter finder jumped ~60px at 1200px. Keep the
   same minimum height after hydration so the visual position does not change.
   Only returning sessions gain this reservation; fresh Library stays compact. */
@media (min-width: 1000px) {
  html[data-reader-loading='returning'] .reader-edition.library-index .library-reading-actions,
  .reader-edition.library-index .library-reading-actions:has(#reading-card:not([hidden])) {
    /* Reserve the full hydrated reading card, not just the 44px locator.
       Chromium's saved-place card measured 164.5px at 1200px; leave room
       for fractional rounding with identical prepaint/hydrated layout. */
    min-height: 176px;
  }
}

/* After the chapter entrance leaves view, the toolbar identifies the story. */
.reader-edition[data-chapter] .reader-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
}
.reader-edition[data-chapter] .reader-location {
  display: none;
  min-width: 0;
}
.reader-edition[data-chapter] .site-header[data-reading-context='chapter'] .site-wordmark {
  display: none;
}
.reader-edition[data-chapter] .site-header[data-reading-context='chapter'] .reader-location {
  display: grid;
  gap: 4px;
}
.reader-edition[data-chapter] .reader-location-number {
  color: var(--secondary);
  font: 500 11px/1.3 var(--ui-font);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.reader-edition[data-chapter] .reader-location-short {
  display: none;
}
.reader-edition[data-chapter] .reader-location-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font: 600 14px/1.4 var(--ui-font);
}
@media (max-width: 800px) {
  .reader-edition[data-chapter] .reader-identity {
    gap: 6px;
  }
  .reader-edition[data-chapter] .reader-location-title {
    display: none;
  }
  .reader-edition[data-chapter] .reader-location-number {
    font-size: 12px;
  }
}
@media (max-width: 360px) {
  .reader-edition[data-chapter] .reader-location-full {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .reader-edition[data-chapter] .reader-location-short {
    display: inline;
  }
}

/* Chapter progress is a paint-only strip: its animated transform never
   resizes a fixed bar or the book layout on mobile scroll frames. The
   accessible integer and reading-state calculations stay in reader.js. */
html[data-reader-focus-transfer='1'] body[data-chapter] .site-header {
  display: none;
}
html[data-reader-focus-transfer='1'] body[data-chapter] .reading-shell,
.reader-edition[data-chapter].focus-mode .reading-shell {
  padding-top: 30px;
}
.reader-edition.search-index .passage-group h2 {
  display: block;
  font: 500 20px/1.4 var(--folio-display);
}
.reader-edition.saved-index #saved-bookmarks .saved-chapter-link {
  display: block;
  padding: 16px 56px 16px 16px;
  min-height: 68px;
}
.reader-edition.saved-index #saved-bookmarks .saved-chapter-number {
  padding: 0;
  min-height: 0;
  color: var(--ink);
  font: 400 24px/1.4 var(--folio-display);
  letter-spacing: -0.025em;
}
.reader-edition.saved-index #saved-bookmarks .saved-bookmark-status {
  margin: 0 16px 16px;
}
.reader-edition[data-chapter] .latest-chapter-notice {
  margin: 0 0 18px;
  font: 400 14px/1.6 var(--ui-font);
  color: var(--secondary);
}
.reader-edition .reading-progress span {
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(var(--reading-progress-fill, 0));
  transition: transform 0.09s linear;
  will-change: transform;
}
.reader-edition[data-progress='left'] .reading-progress span,
.reader-edition[data-progress='right'] .reading-progress span {
  width: 100%;
  height: 100%;
  transform-origin: center top;
  transform: scaleY(var(--reading-progress-fill, 0));
}

/* Home puts the title and reading actions in the same panel. */
.reader-edition.reader-home .home-intro,
.reader-edition.reader-home:has(#reading-card:not([hidden])) .home-intro,
html[data-reader-loading='returning'] .reader-edition.reader-home .home-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: none;
  gap: clamp(18px, 3vw, 32px);
  align-items: start;
  padding-block: clamp(14px, 3.5vw, 42px) 26px;
  width: 100%;
  max-width: 1060px;
  margin-inline: auto;
}
.reader-edition.reader-home .home-intro::before {
  display: none;
}
.reader-edition.reader-home .home-feature {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  gap: clamp(14px, 2vw, 22px) clamp(24px, 4vw, 52px);
  padding: clamp(22px, 4vw, 44px);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 4px 4px 14px 14px;
  background: var(--paper);
  box-shadow: var(--surface-shadow);
}
.reader-edition.reader-home .home-feature .home-copy,
.reader-edition.reader-home:has(#reading-card:not([hidden])) .home-feature .home-copy,
html[data-reader-loading='returning'] .reader-edition.reader-home .home-feature .home-copy {
  grid-area: 1 / 1;
  display: block;
  min-width: 0;
  padding: 0;
  border: 0;
}
.reader-edition.reader-home .home-feature-kicker {
  margin: 0 0 20px;
  color: var(--secondary);
  font: 600 10px/1.35 var(--ui-font);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.reader-edition.reader-home .home-feature .home-heading,
.reader-edition.reader-home:has(#reading-card:not([hidden])) .home-feature .home-heading,
html[data-reader-loading='returning'] .reader-edition.reader-home .home-feature .home-heading {
  display: block;
  min-height: 0;
  width: auto;
}
.reader-edition.reader-home .home-feature .home-copy #site-title,
.reader-edition.reader-home:has(#reading-card:not([hidden])) .home-feature .home-copy #site-title,
html[data-reader-loading='returning']
  .reader-edition.reader-home
  .home-feature
  .home-copy
  #site-title {
  display: block;
  margin: 0;
  color: var(--ink);
  font: 750 clamp(45px, 7.5vw, 76px)/1.02 var(--ui-font);
  letter-spacing: -0.055em;
  text-transform: none;
  text-wrap: pretty;
}
.reader-edition.reader-home .home-feature #site-title span {
  display: block;
  margin-bottom: 9px;
  color: var(--accent);
  font-size: 0.48em;
  font-weight: 550;
  letter-spacing: -0.025em;
  white-space: nowrap;
}
.reader-edition.reader-home .home-resources,
.reader-edition.reader-home:has(#reading-card:not([hidden])) .home-resources,
html[data-reader-loading='returning'] .reader-edition.reader-home .home-resources {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  border: 0;
}
.reader-edition.reader-home .home-resource {
  min-height: 84px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.reader-edition.reader-home .home-feature .home-reading-column,
.reader-edition.reader-home:has(#reading-card:not([hidden])) .home-feature .home-reading-column,
html[data-reader-loading='returning']
  .reader-edition.reader-home
  .home-feature
  .home-reading-column {
  grid-area: 2 / 1;
  min-width: 0;
  padding: 0;
}
.reader-edition.reader-home .home-feature .home-reading-card {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}
.reader-edition.reader-home .home-feature .home-reading-progress {
  margin: 0;
  font: 600 13px/1.4 var(--ui-font);
  color: var(--secondary);
}
.reader-edition.reader-home .home-reading-card #reading-card-title,
.reader-edition.reader-home .home-bookmarks .home-chapter-title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.reader-edition.reader-home .home-reading-actions,
.reader-edition.reader-home .home-reading-column .home-actions {
  gap: 10px;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
}
.reader-edition.reader-home:has(#reading-card:not([hidden])) .home-reading-column .home-actions {
  display: none;
}
.reader-edition.reader-home .home-reading-actions > a,
.reader-edition.reader-home .home-actions > a {
  flex: 0 1 auto;
  min-width: 0;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: none;
  white-space: normal;
}
.reader-edition.reader-home .home-feature .home-actions {
  margin: 0;
}
.reader-edition.reader-home .home-feature .home-reading-actions #continue-reading {
  margin: 0;
  padding: 12px 16px;
}
.reader-edition.reader-home :is(.home-reading-actions, .home-actions) .home-secondary {
  min-width: 96px;
  padding-inline: 14px;
}
.reader-edition.reader-home
  .home-intro
  > :is(.home-bookmarks, .home-slf, .home-disclosure, .home-history-notice),
.reader-edition.reader-home:has(#reading-card:not([hidden]))
  .home-intro
  > :is(.home-bookmarks, .home-slf, .home-disclosure, .home-history-notice),
html[data-reader-loading='returning']
  .reader-edition.reader-home
  .home-intro
  > :is(.home-bookmarks, .home-slf, .home-disclosure, .home-history-notice) {
  grid-area: auto / 1 / auto / -1;
  width: 100%;
  max-width: none;
  margin: 0;
}
.reader-edition.reader-home .home-bookmarks,
.reader-edition.reader-home .home-slf {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 22px 0 0;
  background: transparent;
  box-shadow: none;
}
.reader-edition.reader-home #home-bookmark-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  border: 0;
}
.reader-edition.reader-home .home-bookmarks .home-chapter-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 10px 0;
}
.reader-edition.reader-home .home-bookmarks .home-chapter-number {
  font: 500 14px/1.5 var(--ui-font);
  color: var(--ink);
}
.reader-edition.reader-home .home-disclosure {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  font: 400 13px/1.6 var(--ui-font);
  color: var(--secondary);
}
html[data-reader-loading='returning'] .reader-edition.reader-home .home-reading-column::before {
  min-height: 74px;
}

/* Numbered catalogue; the titles remain in data-title for existing search. */
.reader-edition.library-index .library-layout {
  display: block;
}
.reader-edition.library-index .library-sidebar {
  position: static;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 280px);
  gap: 16px 24px;
  max-height: none;
  overflow: visible;
  padding: 0;
  margin-bottom: 20px;
}
.reader-edition.library-index .library-reading-actions,
.reader-edition.library-index .library-reading-actions:has(#reading-card:not([hidden])),
html[data-reader-loading='returning'] .reader-edition.library-index .library-reading-actions {
  grid-area: 1 / 1 / auto / -1;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 0 16px;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
@media (min-width: 801px) {
  .reader-edition.library-index .library-reading-card:not([hidden]) {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }
  .reader-edition.library-index .library-reading-card .library-reading-progress {
    margin: 0;
  }
}
.reader-edition.library-index .library-tools {
  grid-area: 2 / 2;
  margin: 0;
}
.reader-edition.library-index .library-filter-bar {
  grid-area: 2 / 1;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.reader-edition.library-index .library-filters {
  display: flex;
  flex-wrap: wrap;
}
.reader-edition.library-index .library-more-controls {
  margin: 0;
  flex: 0 0 auto;
  min-width: 0;
}
.reader-edition.library-index .library-group-entries,
.reader-edition.library-index .library-group[open] > .library-group-entries {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
}
.reader-edition.library-index .library-entry {
  grid-template-columns: minmax(44px, 1fr) 44px;
  gap: 0;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
}
.reader-edition.library-index .library-entry > a,
.reader-edition.library-index .library-group-entries .library-entry > a,
.reader-edition.library-index .library-entry[data-reading='read']:not(.library-entry-current) > a {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 74px;
  padding: 8px 0 8px 8px;
  gap: 0;
}
.reader-edition.library-index .library-group-entries .library-entry-number {
  padding: 0;
  font: 400 27px/1.2 var(--folio-display);
  color: var(--ink);
  align-self: center;
}
.reader-edition.library-index .library-group-entries .library-entry-identity {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.reader-edition.library-index .library-entry-bookmark {
  border-radius: 3px;
  font-size: 18px;
}
.reader-edition.library-index .library-entry-current {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: none;
}
.reader-edition.library-index .library-entry-current .library-entry-number {
  color: var(--accent);
}

/* A quiet reading surface: exact source markup, no game-message boxes. */
.reader-edition[data-chapter] .reading-shell {
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.reader-edition[data-chapter] .chapter-context {
  border: 0;
  padding-bottom: 0;
  margin-bottom: 12px;
}
.reader-edition[data-chapter] .chapter-header h1 {
  font: 400 clamp(32px, 3.8vw, 43px)/1.2 var(--folio-display);
  letter-spacing: -0.035em;
  margin-block: 12px 26px;
  text-wrap: pretty;
}
.reader-edition[data-chapter] .chapter-header h1.chapter-title-long {
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.25;
}
.reader-edition[data-chapter] .chapter-header {
  margin-bottom: 30px;
}
.reader-edition[data-chapter] .chapter-prose p {
  margin-bottom: 1.15em;
}
@media (max-width: 800px) {
  .reader-edition.library-index .library-sidebar {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .reader-edition.library-index .library-tools {
    grid-area: 3 / 1;
  }
  .reader-edition.library-index .library-filter-bar {
    grid-area: 2 / 1;
  }
  .reader-edition.library-index .library-group-entries,
  .reader-edition.library-index .library-group[open] > .library-group-entries {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (min-width: 920px) {
  .reader-edition.reader-home .home-feature {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .reader-edition.reader-home .home-feature .home-reading-column,
  .reader-edition.reader-home:has(#reading-card:not([hidden])) .home-feature .home-reading-column,
  html[data-reader-loading='returning']
    .reader-edition.reader-home
    .home-feature
    .home-reading-column {
    grid-area: 1 / 2;
    min-width: 270px;
  }
}
@media (max-width: 520px) {
  .reader-edition.reader-home
    .home-feature
    :is(.home-reading-actions, .home-actions)
    .home-secondary {
    min-width: 74px;
  }
  .reader-edition.reader-home .home-resources,
  .reader-edition.reader-home:has(#reading-card:not([hidden])) .home-resources,
  html[data-reader-loading='returning'] .reader-edition.reader-home .home-resources {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .reader-edition.library-index .library-group-entries,
  .reader-edition.library-index .library-group[open] > .library-group-entries {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
  }
  .reader-edition.library-index .library-entry {
    min-height: 64px;
  }
  .reader-edition.library-index .library-group-entries .library-entry > a,
  .reader-edition.library-index
    .library-entry[data-reading='read']:not(.library-entry-current)
    > a {
    min-height: 62px;
    padding-left: 2px;
  }
  .reader-edition.library-index .library-group-entries .library-entry-number {
    font-size: 23px;
  }
  .reader-edition.reader-home #home-bookmark-list {
    gap: 12px;
  }
  .reader-edition.reader-home .home-bookmarks .home-chapter-number {
    font-size: 12px;
  }
  .reader-edition[data-chapter] .chapter-header h1 {
    font-size: max(calc(var(--prose-size) + 5px), 31px);
  }
  .reader-edition[data-chapter] .chapter-header h1.chapter-title-long {
    font-size: max(var(--prose-size), 25px);
  }
}
@media (max-width: 360px) {
  .reader-edition.library-index .library-group-entries,
  .reader-edition.library-index .library-group[open] > .library-group-entries {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .reader-edition.reader-home #home-bookmark-list {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 280px) {
  .reader-edition.reader-home .home-feature {
    padding: 14px;
  }
  .reader-edition.reader-home .home-feature .home-copy #site-title span {
    white-space: normal;
  }
  .reader-edition.library-index .library-group-entries,
  .reader-edition.library-index .library-group[open] > .library-group-entries {
    grid-template-columns: minmax(0, 1fr);
  }
}

.reader-edition.search-index #passage-status:empty {
  margin-block: 0;
  padding-block: 0;
}

/* Shared browsing surfaces and controls. Chapter prose keeps its own typography. */
.reader-edition :is(.home-topline, .site-header) {
  border-bottom-color: var(--line);
}
.reader-edition .home-topline nav {
  border: 0;
  background: transparent;
  border-radius: 0;
}
.reader-edition .home-topline nav > a {
  border-radius: 7px;
}
.reader-edition .home-topline nav > a[aria-current='page'] {
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 -2px var(--accent);
}
.reader-edition
  :is(.theme-picker > summary, .site-header nav > button, .site-header nav > details > summary) {
  border-radius: 8px;
}
.reader-edition.reader-home .home-feature::after {
  content: '';
  position: absolute;
  top: 20px;
  right: 20px;
  width: 20px;
  height: 20px;
  border-top: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
  opacity: 0.5;
  pointer-events: none;
}
.reader-edition.reader-home .resource-icon {
  color: var(--accent);
}
.reader-edition.reader-home .resource-copy strong {
  font-size: 13px;
}
.reader-edition.reader-home .resource-copy small {
  font-size: 11px;
}
.reader-edition.reader-home .home-resource:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.reader-edition.reader-home .home-bookmarks .home-chapter-list li {
  border-bottom: 1px solid var(--line);
}
.reader-edition.library-index .library-group {
  border-radius: 10px;
  box-shadow: none;
  background: var(--paper);
}
.reader-edition.library-index .library-group > summary {
  padding: 18px 20px;
}
.reader-edition.library-index .library-group:not([open]) > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 8px;
  min-height: 64px;
  padding: 10px 14px;
}
.reader-edition.library-index .library-group:not([open]) .library-range-label {
  grid-column: 1;
}
.reader-edition.library-index .library-group:not([open]) .library-range-label strong {
  font-size: 19px;
  line-height: 1.3;
}
.reader-edition.library-index .library-group:not([open]) .library-range-status {
  grid-column: 1;
  text-align: left;
}
.reader-edition.library-index .library-group:not([open]) > summary::after {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
}
.reader-edition.library-index .library-group[open] > summary {
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--paper));
  border-bottom: 1px solid var(--line);
}
.reader-edition.library-index .library-range-label small {
  color: var(--secondary);
  font: 600 9px/1.5 var(--ui-font);
  letter-spacing: 0.14em;
}
.reader-edition.library-index .library-range-label strong {
  color: var(--ink);
  font: 600 21px/1.4 var(--ui-font);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.reader-edition.library-index .library-entry {
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 8px;
}
.reader-edition.library-index .library-group-entries .library-entry-number {
  font-family: var(--ui-font);
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
}
.reader-edition.library-index
  .library-entry[data-reading='read']:not(.library-entry-current)
  .library-entry-number {
  color: var(--secondary);
}
.reader-edition.library-index .library-entry-current {
  border-color: var(--accent);
  box-shadow: inset 3px 0 var(--accent);
}
.reader-edition.library-index .library-filter[aria-pressed='true'] {
  border-color: var(--accent);
  box-shadow: none;
}
.reader-edition.saved-index .saved-bookmarks-section {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.reader-edition.saved-index .saved-section-heading {
  padding-bottom: 18px;
}
.reader-edition.saved-index .saved-section-heading h2 {
  font-size: 23px;
}
.reader-edition.saved-index #saved-bookmarks > .saved-bookmark {
  border-left: 3px solid var(--accent);
  border-radius: 4px 10px 10px 4px;
}
.reader-edition.saved-index #saved-bookmarks .saved-chapter-number {
  font: 600 21px/1.4 var(--ui-font);
  letter-spacing: -0.035em;
}
.reader-edition.saved-index :is(.offline-reading, #reading-recovery) {
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.reader-edition.saved-index :is(.offline-reading, #reading-recovery)[open] {
  padding-bottom: 20px;
}
.reader-edition.saved-index :is(.offline-reading, #reading-recovery) > summary {
  color: var(--ink);
}
.reader-edition.saved-index #offline-range {
  gap: 10px;
}
.reader-edition.saved-index #offline-chapters li:last-child {
  border-bottom: 0;
}
.reader-edition.saved-index #offline-remove-all {
  margin-top: 16px;
}
.reader-edition.saved-index .account-card {
  margin-block: 26px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 4px 12px 12px 4px;
  background: var(--paper);
  font: 400 14px/1.6 var(--ui-font);
}
.reader-edition.saved-index .account-card > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 18px;
  color: var(--ink);
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}
.account-card > summary::-webkit-details-marker {
  display: none;
}
.account-card > summary::after {
  content: '+';
  margin-left: auto;
  color: var(--accent);
  font-size: 19px;
}
.account-card[open] > summary::after {
  content: '−';
}
.account-sync-badge {
  color: var(--secondary);
  font: 500 11px/1.5 var(--ui-font);
}
.account-card[open] .account-sync-badge {
  display: none;
}
.account-card[data-sync-state='ready'] .account-sync-badge {
  color: var(--accent);
}
.account-card-content {
  padding: 0 18px 18px;
}
.account-card-content > [role='status'] {
  margin: 0 0 16px;
  color: var(--secondary);
}
.account-sync-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.reader-edition .account-sync-row :is(a, button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  font: 600 13px/1.4 var(--ui-font);
  text-decoration: none;
}
.reader-edition .account-card-content > .account-sync-row :is(a, button) {
  border-color: var(--accent);
  color: var(--page);
  background: var(--accent);
}
.account-management {
  margin-top: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.account-management > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--secondary);
  cursor: pointer;
}
.account-card [hidden] {
  display: none !important;
}
.reader-edition.search-index .passage-form {
  border-top: 3px solid var(--accent);
  border-radius: 4px 4px 12px 12px;
  box-shadow: none;
}
.reader-edition.search-index .passage-group {
  border-radius: 10px;
  box-shadow: none;
}
.reader-edition.search-index .passage-group h2 {
  font: 600 18px/1.5 var(--ui-font);
  letter-spacing: -0.025em;
}
.reader-edition :is(.appearance-panel, .reader-more-panel, .theme-picker-panel) {
  border-top: 2px solid var(--accent);
  border-radius: 4px 4px 12px 12px;
}
.reader-edition .reader-tools > .reader-more-panel {
  gap: 0;
  width: 260px;
  padding: 8px;
  max-height: calc(100dvh - var(--reader-menu-top, 88px) - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.reader-edition .reader-tools .reader-tool-links {
  display: grid;
  gap: 0;
  padding: 0;
  margin: 0;
  border: 0;
}
.reader-edition .reader-tools .reader-tool-links :is(a, button),
.reader-edition .reader-offline-option button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 44px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: 550 13px/1.45 var(--ui-font);
  text-align: left;
  white-space: normal;
  cursor: pointer;
}
.reader-edition
  .reader-tools
  :is(.reader-tool-links a, .reader-tool-links button, .reader-offline-option button):hover {
  background: var(--accent-soft);
}
.reader-edition .reader-offline-option {
  border: 0;
  border-top: 1px solid var(--line);
  margin-top: 6px;
  padding: 6px 0 0;
}
.reader-edition .site-header .appearance:not([open]) > summary {
  background: transparent;
  color: var(--secondary);
}
.reader-edition .site-header .appearance[open] > summary {
  background: var(--accent-soft);
  color: var(--accent);
}
@media (max-width: 640px) {
  .reader-edition[data-chapter] .reader-tools > .reader-more-panel {
    left: auto;
    right: 12px;
    width: 260px;
    max-width: calc(100vw - 24px);
  }
}
.reader-edition[data-chapter] .chapter-number {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* Clear hit areas and feedback for the first reading journey. */
.reader-edition :is(a, button, summary, input, select):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.reader-edition .site-header nav :is(a, button, summary) {
  min-width: 44px;
  min-height: 44px;
}
.reader-edition.library-index .library-entry-bookmark {
  margin-right: 4px;
  border: 1px solid transparent;
}
.reader-edition.library-index .library-entry-bookmark:hover,
.reader-edition.library-index .library-entry-bookmark:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.reader-edition.library-index .library-more-controls > summary {
  min-height: 44px;
  padding-inline: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--secondary);
  background: var(--paper);
}
.reader-edition.library-index .library-more-controls[open] > summary {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.reader-edition.library-index #chapter-empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--secondary);
  font: 400 14px/1.7 var(--ui-font);
  text-align: center;
}
@media (max-width: 360px) {
  .reader-edition .home-topline nav > a {
    font-size: 12px;
  }
}
@media (min-width: 920px) {
  .reader-edition.reader-home .home-intro,
  .reader-edition.reader-home:has(#reading-card:not([hidden])) .home-intro,
  html[data-reader-loading='returning'] .reader-edition.reader-home .home-intro {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 28px 32px;
  }
  .reader-edition.reader-home .home-feature {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    align-self: stretch;
    align-content: center;
  }
  .reader-edition.reader-home .home-feature .home-reading-column,
  .reader-edition.reader-home:has(#reading-card:not([hidden])) .home-feature .home-reading-column,
  html[data-reader-loading='returning']
    .reader-edition.reader-home
    .home-feature
    .home-reading-column {
    grid-area: 2 / 1;
    min-width: 0;
  }
  .reader-edition.reader-home .home-intro > .home-slf,
  .reader-edition.reader-home:has(#reading-card:not([hidden])) .home-intro > .home-slf,
  html[data-reader-loading='returning'] .reader-edition.reader-home .home-intro > .home-slf {
    grid-area: 1 / 2;
    padding: 8px 0;
    border: 0;
  }
  .reader-edition.reader-home .home-resources,
  .reader-edition.reader-home:has(#reading-card:not([hidden])) .home-resources,
  html[data-reader-loading='returning'] .reader-edition.reader-home .home-resources {
    grid-template-columns: minmax(0, 1fr);
  }
  .reader-edition.reader-home .home-resource {
    min-height: 78px;
  }
}
@media (max-width: 520px) {
  .reader-edition.reader-home .home-resources,
  .reader-edition.reader-home:has(#reading-card:not([hidden])) .home-resources,
  html[data-reader-loading='returning'] .reader-edition.reader-home .home-resources {
    gap: 8px;
  }
  .reader-edition.reader-home .home-resource {
    min-height: 70px;
    padding: 12px 14px;
  }
  .reader-edition.library-index .library-group > summary {
    padding: 13px 16px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion='reduced']) .reader-edition.reader-home .home-feature {
    animation: ui-arrive 400ms var(--ui-ease) backwards;
  }
  :root:not([data-motion='reduced']) .reader-edition.reader-home .resource-arrow {
    transition: transform 180ms var(--ui-ease);
  }
  :root:not([data-motion='reduced'])
    .reader-edition.reader-home
    .home-resource:hover
    .resource-arrow {
    transform: translate(2px, -2px);
  }
}

/* Direct chapter actions: Search and Saved belong beside Library. Focus and
   Download are compact icon buttons; Tools appears only for optional reports. */
.reader-edition[data-chapter] .site-header nav > .reader-nav-destination,
.reader-edition[data-chapter] .site-header nav > .reader-icon-button,
.reader-edition[data-chapter] .site-header nav > .reader-chapter-download > button,
.reader-edition[data-chapter] .site-header nav > .appearance > summary,
.reader-edition[data-chapter] .site-header nav > .reader-tools > summary {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  font: 600 13px/1.2 var(--ui-font);
  text-decoration: none;
}
.reader-edition[data-chapter] .site-header nav > .reader-nav-destination:hover,
.reader-edition[data-chapter] .site-header nav > .reader-icon-button:hover,
.reader-edition[data-chapter] .site-header nav > .reader-chapter-download > button:hover,
.reader-edition[data-chapter] .site-header nav > .appearance > summary:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.reader-edition[data-chapter] .site-header nav > .appearance[open] > summary,
.reader-edition[data-chapter] .site-header nav > .reader-tools[open] > summary,
.reader-edition[data-chapter] .site-header nav > #focus-toggle[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.reader-edition[data-chapter] .reader-tools[hidden] {
  display: none !important;
}
.reader-edition[data-chapter] .reader-nav-icon,
.reader-edition[data-chapter] .reader-action-icon {
  display: block;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
}
.reader-edition[data-chapter] .reader-nav-icon {
  display: none;
}
.reader-edition[data-chapter] #focus-toggle,
.reader-edition[data-chapter] #offline-download {
  width: 44px;
  padding: 0;
  cursor: pointer;
}
.reader-edition[data-chapter] .reader-focus-exit,
.reader-edition[data-chapter] .reader-action-label {
  display: none;
}
.reader-edition[data-chapter] #focus-toggle[aria-pressed='true'] .reader-focus-enter {
  display: none;
}
.reader-edition[data-chapter] #focus-toggle[aria-pressed='true'] .reader-focus-exit {
  display: block;
}
.reader-edition[data-chapter] .reader-chapter-download {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  min-height: 44px;
}
.reader-edition[data-chapter] #offline-download:disabled {
  opacity: 0.5;
  cursor: progress;
}
.reader-edition[data-chapter] .reader-chapter-download #offline-status:not(:empty) {
  position: absolute;
  z-index: 40;
  top: calc(100% + 10px);
  right: 0;
  box-sizing: border-box;
  width: min(265px, calc(100vw - 24px));
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--surface-shadow);
  overflow-wrap: anywhere;
}
.reader-edition[data-chapter] .site-header nav > .appearance > summary {
  font-size: 15px;
  letter-spacing: -0.02em;
}
/* Always honor the selected size at the prose nodes, including on mobile
   where the browser or theme can otherwise keep a fixed paragraph size. */
.reader-edition[data-chapter] .chapter-prose .prose > p,
.reader-edition[data-chapter] .chapter-prose .prose > blockquote {
  font-size: var(--prose-size);
}
@media (max-width: 640px) {
  .reader-edition[data-chapter] .site-header .site-logo .site-wordmark {
    display: none;
  }
  .reader-edition[data-chapter] .site-header nav {
    gap: 5px;
  }
  .reader-edition[data-chapter] .site-header nav > .reader-nav-destination {
    width: 44px;
    padding: 0;
  }
  .reader-edition[data-chapter] .site-header nav > .reader-nav-destination .reader-nav-icon {
    display: block;
  }
  .reader-edition[data-chapter] .site-header nav > .reader-nav-destination .reader-nav-label {
    display: none;
  }
}
@media (max-width: 520px) {
  /* A stable two-tier phone header avoids a height jump when the identity
     changes from wordmark to chapter number as the reader scrolls. */
  .reader-edition[data-chapter] .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
    padding-block: 4px;
  }
  .reader-edition[data-chapter] .site-header .reader-identity {
    min-height: 36px;
  }
  .reader-edition[data-chapter] .site-header nav {
    display: flex;
    justify-content: space-between;
    flex-wrap: nowrap;
    min-width: 0;
    width: 100%;
    gap: 3px;
  }
  .reader-edition[data-chapter] .site-header nav > .reader-nav-library {
    padding-inline: 5px;
    font-size: 12px;
  }
}

/* Keep the temporary Focus reminder above the sticky reader toolbar. */
.reader-edition[data-chapter] .focus-first-tip:not([hidden]) {
  z-index: 100;
}

/* Focus hides navigation completely, including its pointer hit areas. */
.reader-edition[data-chapter].focus-mode .site-header {
  display: none;
}
