/* The Invisible Civilization — FINAL literary chapter edition.
   Scoped to novel chapters; never changes the home page, volume pages or atlas. */
body:has(.novel-chapter){
  --read-bg:#f0eee8;
  --read-paper:#fffefa;
  --read-text:#2d332e;
  --read-muted:#717b73;
  --read-rule:#dddcd2;
  --read-accent:#61766a;
  --ic-leaf-width:1020px;
  --ic-leaf-ink:#2d332e;
  background:var(--read-bg)!important;
}
body:has(.novel-chapter) #quarto-content.page-columns{
  display:block!important;grid-template-columns:none!important;
  width:100%!important;max-width:none!important;min-width:0!important;
  margin:0!important;padding:clamp(22px,3.4vw,56px) 24px 90px!important;
  background:transparent!important;
}
body:has(.novel-chapter) #quarto-content>main#quarto-document-content{
  box-sizing:border-box!important;
  display:block!important;grid-column:auto!important;float:none!important;
  width:min(var(--ic-leaf-width),100%)!important;max-width:var(--ic-leaf-width)!important;
  margin:0 auto!important;
  padding:clamp(52px,5.1vw,82px) clamp(42px,7.3vw,112px) 92px!important;
  background:var(--read-paper)!important;
  border:1px solid #dfddd5!important;border-radius:1px!important;
  box-shadow:0 18px 65px rgba(38,49,40,.065)!important;
}
body:has(.novel-chapter) #quarto-header .quarto-secondary-nav,
body:has(.novel-chapter) #title-block-header nav.quarto-title-breadcrumbs{
  display:none!important;
}
body:has(.novel-chapter) #quarto-document-content>header#title-block-header{
  max-width:var(--ic-reader-width,750px)!important;width:100%!important;
  margin:0 auto!important;padding:0!important;border:0!important;
}
body:has(.novel-chapter) .chapter-preface{
  max-width:var(--ic-reader-width,750px)!important;width:100%!important;
  margin:0 auto 28px!important;padding:0 0 17px!important;
  border-bottom:1px solid var(--read-rule)!important;
  color:var(--read-accent)!important;
  display:flex!important;align-items:center!important;gap:12px!important;
  font:.78rem/1.7 var(--font-interface)!important;letter-spacing:.07em!important;
}
body:has(.novel-chapter) .chapter-preface a{font-weight:600!important;text-decoration:none!important;color:var(--read-accent)!important}
body:has(.novel-chapter) .ic-chapter-supertitle{
  font:500 .73rem/1.6 var(--font-interface)!important;
  letter-spacing:.18em!important;text-transform:uppercase!important;
  color:var(--read-accent)!important;margin:0 0 10px!important;
}
body:has(.novel-chapter) #title-block-header h1.title{
  font-family:var(--font-literary)!important;
  font-weight:600!important;letter-spacing:.085em!important;
  font-size:clamp(2.65rem,4.25vw,3.35rem)!important;
  line-height:1.46!important;color:var(--read-text)!important;
  text-align:left!important;margin:0 0 14px!important;
}
body:has(.novel-chapter) .chapter-dateline{
  width:100%!important;max-width:var(--ic-reader-width,750px)!important;
  margin:0 auto 20px!important;
  color:var(--read-muted)!important;
  font:400 .98rem/1.7 var(--font-literary)!important;letter-spacing:.12em!important;
}
body:has(.novel-chapter) .chapter-reading-meta{
  width:100%!important;max-width:var(--ic-reader-width,750px)!important;
  margin:0 auto 45px!important;
  padding:12px 0!important;min-height:52px!important;
  border-top:1px solid var(--read-rule)!important;border-bottom:1px solid var(--read-rule)!important;
  display:flex!important;align-items:center!important;gap:12px!important;
  color:var(--read-muted)!important;font:.79rem/1.65 var(--font-interface)!important;
}
body:has(.novel-chapter) .ic-reading-percent{white-space:nowrap!important;font-variant-numeric:tabular-nums;color:var(--read-accent)!important}
body:has(.novel-chapter) .ic-chapter-settings-trigger,
body:has(.novel-chapter) .ic-chapter-toc{
  padding:8px 11px!important;background:transparent!important;color:var(--read-accent)!important;
  border:1px solid transparent!important;border-radius:3px!important;
  letter-spacing:.045em!important;cursor:pointer!important;font-size:.8rem!important;
}
body:has(.novel-chapter) .ic-chapter-settings-trigger{margin-left:auto!important}
body:has(.novel-chapter) .ic-chapter-settings-trigger:hover,
body:has(.novel-chapter) .ic-chapter-toc:hover{
  border-color:var(--read-rule)!important;background:rgba(110,132,115,.085)!important;
}
body:has(.novel-chapter) .novel-chapter,
body:has(.novel-chapter) .history-note,
body:has(.novel-chapter) .chapter-turn,
body:has(.novel-chapter) .volume-bridge{
  max-width:var(--ic-reader-width,750px)!important;width:100%!important;margin-left:auto!important;margin-right:auto!important;
}
body:has(.novel-chapter) .novel-chapter>p{
  font-family:var(--font-literary)!important;
  font-size:calc(1.19rem * var(--reader-scale))!important;
  line-height:var(--ic-reader-leading,2.13)!important;
  letter-spacing:.014em!important;
  text-align:justify!important;text-indent:2em!important;
  margin:0 0 1.07em!important;
  overflow-wrap:anywhere!important;
  hanging-punctuation:first allow-end;
  color:var(--read-text)!important;
}
body:has(.novel-chapter) .novel-chapter>.book-plate{
  max-width:100%!important;
  padding:17px 0 0!important;margin:3.4rem auto 3.8rem!important;
  background:transparent!important;border:0!important;
  border-top:1px solid var(--read-rule)!important;border-bottom:1px solid var(--read-rule)!important;
  box-shadow:none!important;
}
body:has(.novel-chapter) .book-plate__media{
  background:#f2f0e9!important;
  padding:clamp(15px,3vw,29px)!important;
  min-height:150px!important;
}
body:has(.novel-chapter) .book-plate img{max-width:100%!important;max-height:600px!important;object-fit:contain!important;margin:auto!important}
body:has(.novel-chapter) .book-plate figcaption{padding:17px 0 22px!important;font:.8rem/1.85 var(--font-interface)!important;gap:.58rem!important}
body:has(.novel-chapter) .book-plate .plate-category{color:var(--read-accent)!important;font-size:.72rem!important;letter-spacing:.12em!important}
body:has(.novel-chapter) .book-plate .plate-description{color:var(--read-text)!important;font:.89rem/1.9 var(--font-literary)!important}
body:has(.novel-chapter) .history-note{
  background:#f4f2ec!important;border:0!important;border-top:2px solid var(--read-accent)!important;
  margin-top:5.1rem!important;padding:27px 30px 28px!important;box-shadow:none!important;
}
body:has(.novel-chapter) .history-note h2{font:600 1.13rem/1.6 var(--font-literary)!important;letter-spacing:.04em!important;color:var(--read-accent)!important;margin-bottom:1rem!important}
body:has(.novel-chapter) .history-note p{color:var(--read-text)!important;font:.92rem/1.96 var(--font-literary)!important}
body:has(.novel-chapter) .chapter-turn{padding-top:26px!important;margin-top:3.1rem!important;border-top:1px solid var(--read-rule)!important;gap:14px!important}
body:has(.novel-chapter) .chapter-turn>a{background:var(--read-paper)!important;border:1px solid var(--read-rule)!important;padding:20px 22px!important;min-height:110px!important;text-decoration:none!important}
body:has(.novel-chapter) .chapter-turn>a:hover{background:rgba(110,132,115,.055)!important;border-color:var(--read-accent)!important}
body:has(.novel-chapter) .chapter-turn__title{font-family:var(--font-literary)!important;color:var(--read-text)!important}
body:has(.novel-chapter) #quarto-sidebar .sidebar-menu-container>ul>li:first-child{display:none!important}
body:has(.novel-chapter) #quarto-sidebar{background:var(--read-paper)!important;border-right:1px solid var(--read-rule)!important}
body:has(.novel-chapter) #quarto-sidebar .sidebar-link.active{background:rgba(110,132,115,.12)!important;color:var(--read-accent)!important}
body:has(.novel-chapter) .ic-settings-popover{background:var(--read-paper)!important;border-color:var(--read-rule)!important;max-width:calc(100vw - 24px)!important}
body:has(.novel-chapter) .reader-controls{background:var(--read-paper)!important;border:1px solid var(--read-rule)!important;box-shadow:0 8px 28px #27372b1d!important}
body:has(.novel-chapter) .reader-controls button{color:var(--read-accent)!important}
body:has(.novel-chapter) .page-navigation{display:none!important}
html[data-reader-theme="night"] body:has(.novel-chapter){
  --read-bg:#151d18;--read-paper:#222c25;--read-text:#e9e8de;--read-muted:#b4bdb3;--read-rule:#48594d;--read-accent:#bdcdbd;
}
html[data-reader-theme="night"] body:has(.novel-chapter) #quarto-content>main#quarto-document-content{
  background:var(--read-paper)!important;border-color:var(--read-rule)!important;box-shadow:0 18px 60px #0003!important
}
html[data-reader-theme="night"] body:has(.novel-chapter) .history-note{background:#2b372e!important}
html[data-reader-theme="night"] body:has(.novel-chapter) .book-plate__media{background:#303a32!important}
html[data-reader-theme="night"] body:has(.novel-chapter) .chapter-turn>a,
html[data-reader-theme="night"] body:has(.novel-chapter) .ic-settings-popover{background:var(--read-paper)!important}
@media(min-width:1500px){
  body:has(.novel-chapter){--ic-leaf-width:1040px}
}
@media(max-width:900px){
  body:has(.novel-chapter) #quarto-content.page-columns{padding:0 0 48px!important}
  body:has(.novel-chapter) #quarto-content>main#quarto-document-content{
    width:100%!important;max-width:none!important;
    padding:45px clamp(22px,5.6vw,55px) 74px!important;
    border-left:0!important;border-right:0!important;box-shadow:none!important
  }
  body:has(.novel-chapter) #title-block-header h1.title{font-size:clamp(2.35rem,6vw,3.1rem)!important}
  body:has(.novel-chapter) .chapter-reading-meta{flex-wrap:wrap!important}
}
@media(max-width:540px){
  body:has(.novel-chapter) #quarto-content>main#quarto-document-content{padding:31px 21px 96px!important}
  body:has(.novel-chapter) .chapter-preface{margin-bottom:25px!important;padding-bottom:13px!important}
  body:has(.novel-chapter) #title-block-header h1.title{font-size:clamp(2.1rem,9.2vw,2.65rem)!important;letter-spacing:.05em!important}
  body:has(.novel-chapter) .chapter-dateline{font-size:.89rem!important;margin-bottom:15px!important}
  body:has(.novel-chapter) .chapter-reading-meta{flex-wrap:nowrap!important;gap:5px!important;margin-bottom:36px!important;padding:8px 0!important}
  body:has(.novel-chapter) .chapter-reading-meta>span:nth-child(2){display:none!important}
  body:has(.novel-chapter) .ic-reading-percent{display:none!important}
  body:has(.novel-chapter) .ic-chapter-settings-trigger{margin-left:auto!important}
  body:has(.novel-chapter) .ic-chapter-settings-trigger,body:has(.novel-chapter) .ic-chapter-toc{padding:7px!important}
  body:has(.novel-chapter) .novel-chapter>p{
    font-size:calc(1.075rem * var(--reader-scale))!important;
    line-height:var(--ic-reader-leading,2.06)!important;
    letter-spacing:.006em!important
  }
  body:has(.novel-chapter) .book-plate__media{padding:12px!important}
  body:has(.novel-chapter) .history-note{margin-top:3.5rem!important;padding:24px 19px!important}
  body:has(.novel-chapter) .chapter-turn{grid-template-columns:1fr!important}
  body:has(.novel-chapter) .reader-controls{bottom:max(12px,env(safe-area-inset-bottom))!important}
}
@media print{
 body:has(.novel-chapter) #quarto-content.page-columns{padding:0!important;background:white!important}
 body:has(.novel-chapter) #quarto-content>main#quarto-document-content{border:0!important;box-shadow:none!important;max-width:100%!important;padding:0!important;background:#fff!important}
 body:has(.novel-chapter) .novel-chapter>p{color:#161616!important;font-size:11pt!important;line-height:1.85!important}
 body:has(.novel-chapter) .chapter-turn,body:has(.novel-chapter) .reader-controls{display:none!important}
 body:has(.novel-chapter) .book-plate{break-inside:avoid}
}
