/* The Royal Codes — Kindle-style reading room correction, 2026-11-20.
   Presentation layer only. Source text remains in the existing protected catalog. */
[hidden]{display:none!important}

/* A complete chapter must never be constrained to the old 535px scrolling box. */
#panel-read .book-page.mode-continuous {
  max-height:none!important;
  min-height:28rem;
  height:auto!important;
  overflow:visible!important;
  overflow-wrap:break-word;
}
#panel-read .book-frame:has(.book-page.mode-continuous){
  overflow:visible!important;
}
#panel-read .reader-book-column{min-width:0}
#panel-read .book-page p,
#panel-read .book-page aside,
#panel-read .book-page h2,
#panel-read .book-page h3,
#panel-read .book-page h4{
  overflow-wrap:break-word;
}
#panel-read .reader-layout[hidden],
#panel-read .reader-access-note[hidden]{display:none!important}
#panel-read .reader-access-note{max-width:850px;margin:27px auto 40px}
#panel-read .reader-access-note [role=status]{
  margin:10px auto 0;max-width:40rem;font-size:.78rem;line-height:1.75;
  color:#202020
}
#panel-read .reader-access-note .access-action{
  background:#fff;color:#202020;min-height:42px;
}
#panel-read .book-top,#panel-read .book-bottom{position:relative;z-index:1}
#panel-read .book-page .reader-illustration{
  display:block;max-width:min(100%,450px);height:auto;object-fit:contain;
  margin:0 auto 35px
}
#panel-read .book-page{color:inherit}
#panel-read .book-frame.theme-paper .book-page{color:#202020}
#panel-read .book-frame.theme-sepia .book-page{color:#453729}
#panel-read .book-frame.theme-dark .book-page{color:#e9f1fd}
#panel-read .book-page.mode-continuous>.codex-paragraph:last-child{margin-bottom:.5em}

/* Reader expands into an independent, edge-to-edge viewport.  All tools stay
   inside this surface; no native fullscreen API required for Android/iOS. */
body.royal-reader-open{overflow:hidden!important;overscroll-behavior:none}
.site-shell.reader-immersive #panel-read{
  display:block!important;
  position:fixed!important;
  inset:0!important;
  width:100vw!important;
  max-width:none!important;
  height:100vh!important;
  height:100dvh!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior:contain;
  scroll-behavior:smooth;
  scroll-padding-top:130px;
  z-index:2147480000!important;
  isolation:isolate;
  background:radial-gradient(ellipse 85% 65% at 70% -9%,rgba(0,0,0,0.021),transparent 80%),
    #fdfdfd;
  padding:0 0 max(75px,env(safe-area-inset-bottom))!important;
  margin:0!important;
}
.reader-fullscreen-bar{display:none}
.site-shell.reader-immersive #panel-read .reader-fullscreen-bar{
  display:flex;
  position:sticky;
  top:0;
  z-index:40;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  min-height:54px;
  padding:8px max(13px,env(safe-area-inset-right)) 8px max(13px,env(safe-area-inset-left));
  background:rgba(255,255,255,0.97);
  border-bottom:1px solid rgba(0,0,0,0.192);
  box-shadow:0 6px 23px rgba(0,0,0,0.075);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
}
#panel-read .reader-fullscreen-bar button{
  border:1px solid rgba(0,0,0,0.288);
  border-radius:10px;
  background:rgba(0,0,0,0.014);
  color:#202020;
  padding:11px 15px;
  min-height:42px;
  cursor:pointer;
  font:700 .73rem/1.15 'IM Fell French Canon',Arial,sans-serif;
  white-space:nowrap
}
#panel-read .reader-fullscreen-bar button:hover{background:rgba(0,0,0,0.045)}
#panel-read .reader-fullscreen-title{
  font:700 .67rem/1.35 'IM Fell French Canon',Arial,sans-serif;
  letter-spacing:.18em;
  color:#202020;
  text-align:center
}
#panel-read .reader-fullscreen-title span{color:#202020;font-weight:400}
.site-shell.reader-immersive #panel-read .reader-heading{
  display:block;
  position:sticky;
  top:54px;
  z-index:30;
  width:100%;
  max-width:none;
  margin:0!important;
  padding:8px clamp(12px,2vw,30px)!important;
  border:0!important;
  border-bottom:1px solid rgba(0,0,0,0.150)!important;
  border-radius:0!important;
  background:rgba(255,255,255,0.97)!important;
  box-shadow:none!important;
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px)
}
.site-shell.reader-immersive #panel-read .reader-heading:after,
.site-shell.reader-immersive #panel-read .reader-heading>div:first-child{display:none!important}
.site-shell.reader-immersive #panel-read .reader-tools{
  display:flex;
  align-items:center;
  justify-content:center;
  flex-wrap:nowrap!important;
  gap:8px;
  overflow-x:auto;
  overflow-y:hidden;
  padding:3px 2px 7px;
  width:100%;
  max-width:none;
  scrollbar-width:thin
}
.site-shell.reader-immersive #panel-read .reader-tools>*{
  flex:0 0 auto!important;
  min-width:0;
  white-space:nowrap
}
.site-shell.reader-immersive #panel-read #bookSelect{
  max-width:min(33vw,340px);
  min-width:155px;
  flex-basis:auto!important
}
.site-shell.reader-immersive #panel-read .codex-experience{
  position:relative;
  z-index:2;
  max-width:1000px;
  margin:22px auto 14px;
  width:calc(100% - 36px);
  padding:12px 16px
}
.site-shell.reader-immersive #panel-read .codex-jurisdictions{display:none!important}
.site-shell.reader-immersive #panel-read .reader-layout{
  display:block!important;
  width:min(100% - 36px,1000px)!important;
  max-width:1000px!important;
  margin:0 auto!important;
}
.site-shell.reader-immersive #panel-read .reader-book-column{
  width:100%!important;
  max-width:100%!important
}
.site-shell.reader-immersive #panel-read .book-frame{
  max-width:100%!important;
  overflow:visible!important;
  border-radius:4px 13px 13px 4px;
  box-shadow:0 35px 100px rgba(0,0,0,0.130),inset 7px 0 18px rgba(0,0,0,0.037)
}
.site-shell.reader-immersive #panel-read .book-page{
  max-height:none!important;
  overflow:visible!important;
  min-height:calc(100dvh - 240px)!important;
  height:auto!important;
  padding:clamp(46px,6vw,92px) clamp(24px,8vw,118px) clamp(55px,7vw,100px)!important;
}
.site-shell.reader-immersive #panel-read .book-page>*{max-width:34em}
.site-shell.reader-immersive #panel-read .reader-chapter-nav{margin:23px 0 45px}
.site-shell.reader-immersive #panel-read .edition-downloads{max-width:1000px;margin:25px auto}
.site-shell.reader-immersive #panel-read .reader-access-note{margin-top:35px}

/* A Kindle-like contents/study drawer, keeping notes/highlights/search accessible. */
#panel-read .reader-drawer-scrim{display:none}
.site-shell.reader-immersive #panel-read .reader-drawer-scrim:not([hidden]){
  display:block!important;position:fixed;inset:54px 0 0;
  width:100%;height:calc(100dvh - 54px);
  background:rgba(255,255,255,0.93);
  border:0;padding:0;z-index:48;
  cursor:default
}
.site-shell.reader-immersive #panel-read .reader-side{
  display:block!important;
  position:fixed!important;
  top:54px!important;
  right:0!important;
  bottom:0!important;
  left:auto!important;
  z-index:50!important;
  width:min(400px,94vw)!important;
  max-width:94vw!important;
  max-height:none!important;
  margin:0!important;
  border-radius:0!important;
  padding:25px 23px max(70px,env(safe-area-inset-bottom));
  overflow-y:auto!important;
  overflow-x:hidden;
  background:#fdfdfd;
  border-left:1px solid rgba(0,0,0,0.264);
  box-shadow:-20px 0 50px rgba(0,0,0,0.122);
  transform:translateX(102%);
  visibility:hidden;
  pointer-events:none;
  transition:transform .24s ease,visibility .24s
}
.site-shell.reader-immersive.reader-tools-open #panel-read .reader-side{
  transform:translateX(0);
  visibility:visible;
  pointer-events:auto
}
.site-shell.reader-immersive.reader-tools-open #panel-read #readerFullscreenContents{
  color:#202020;background:#fff
}
#panel-read .reader-side .reader-chapter-outline{max-height:40dvh!important}
@media(max-width:720px){
  .site-shell.reader-immersive #panel-read{scroll-padding-top:125px}
  #panel-read .reader-fullscreen-title{font-size:.57rem;letter-spacing:.08em}
  #panel-read .reader-fullscreen-title span{display:none}
  #panel-read .reader-fullscreen-bar button{padding:10px 11px!important;font-size:.66rem!important}
  .site-shell.reader-immersive #panel-read .reader-heading{padding:6px 8px!important}
  .site-shell.reader-immersive #panel-read .reader-tools{justify-content:flex-start}
  .site-shell.reader-immersive #panel-read .reader-tools button,
  .site-shell.reader-immersive #panel-read .reader-tools select{font-size:.69rem;min-height:38px}
  .site-shell.reader-immersive #panel-read .codex-experience{
    width:calc(100% - 20px);margin:12px auto;padding:10px
  }
  .site-shell.reader-immersive #panel-read .reader-layout{width:calc(100% - 12px)!important}
  .site-shell.reader-immersive #panel-read .book-frame{
    border-radius:3px;box-shadow:0 12px 36px rgba(0,0,0,0.109)
  }
  .site-shell.reader-immersive #panel-read .book-page{
    min-height:calc(100dvh - 235px)!important;
    padding:39px clamp(18px,5.2vw,36px) 55px!important;
  }
  .site-shell.reader-immersive #panel-read .reader-chapter-nav{padding:0 12px}
  .site-shell.reader-immersive #panel-read .reader-access-note{margin:25px 14px}
  .site-shell.reader-immersive #panel-read .reader-chapter-nav button{min-width:0}
}
@media(max-width:370px){
  #panel-read .reader-fullscreen-title{display:none}
}
@media(prefers-reduced-motion:reduce){
  .site-shell.reader-immersive #panel-read{scroll-behavior:auto}
  .site-shell.reader-immersive #panel-read .reader-side{transition:none}
}

/* Explicit class fallback for devices where :has() is unavailable. */
#panel-read .book-frame.reading-continuous{overflow:visible!important}
