:root { --forest:#062b1b; --gold:#dfbc82; --glass:#ffffff8c; --serif: "Baskervville", Georgia, serif }
[hidden] { display:none!important }
#book-home { background:#03140c; color:white }
.book-nav,.book-hero { display:flex; align-items:center; justify-content:space-between; gap:1.5rem }
.book-nav { padding:.85rem 4%; flex-wrap:wrap }
.book-nav a { color:inherit; text-decoration:none }
.wordmark { font:2rem/1 var(--serif); letter-spacing:-.06em }
.wordmark span { color:#6caf81 }
.book-links { display:flex; gap:2rem; flex-wrap:wrap }
.book-hero { min-height:clamp(390px,34vw,630px); padding:2.5rem 6%; background:linear-gradient(90deg,#03140c 35%,transparent 58%),url('./assets/hero.webp') right center/58% 100% no-repeat; }
.hero-copy { max-width:50%; }
.hero-copy h1 { color:white; font:clamp(3rem,6.1vw,7rem)/1 var(--serif); margin:.25em 0 .38em; letter-spacing:-.065em }
.hero-copy h1 span { color:#73ad82 }
.hero-copy p { font:italic clamp(1rem,1.8vw,1.7rem)/1.25 var(--serif) }
.hero-copy .kicker { letter-spacing:.25em; font-size:clamp(.75rem,1.35vw,1.2rem) }
.memory-types { display:flex; gap:clamp(.7rem,3vw,3.5rem); margin-top:1.7rem; flex-wrap:wrap; font-size:.77rem; text-align:center }
.memory-types span { display:grid; gap:.25rem }
.memory-types b { font-size:1.4rem }
.book-btn,.glass-btn { border:1px solid #ffffff96; border-radius:14px; cursor:pointer; font:inherit; font-weight:650; padding:.72rem 1rem; transition:transform .18s,box-shadow .18s; }
.book-btn { background:var(--forest); color:white; box-shadow:inset 0 2px 8px #ffffff2b; }
.glass-btn { color:#102018; background:var(--glass); box-shadow:inset 0 1px 5px white,0 5px 18px #18201810 }
.book-btn:hover,.glass-btn:hover { box-shadow:0 4px 18px #143b2840; transform:translateY(-2px) }
.book-btn:active,.glass-btn:active { transform:scale(.98) }
.book-btn:disabled,.glass-btn:disabled { opacity:.55; cursor:default; transform:none }
#book-app { min-height:100vh; color:#151a16; background:linear-gradient(#ffffff55,#ffffff55),url('./assets/marble.webp') center/cover fixed; }
.studio-top { background:#041d12; color:white; padding:.8rem 4%; display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.studio-layout { display:grid; grid-template-columns:minmax(180px,23%) minmax(0,1fr); min-height:calc(100vh - 60px); }
.studio-nav { background:#ffffff4d; padding:2rem .85rem; display:flex; align-items:stretch; flex-direction:column; gap:.65rem; text-align:center; }
.studio-nav .wordmark { margin:0 0 1rem }
.studio-nav button[aria-current=step] { background:white; color:#073723; outline:1px solid #1c694b }
.studio-panel { width:min(100%,960px); margin-inline:auto; padding:2.2rem clamp(1rem,4vw,4rem); text-align:center; }
.studio-panel h1 { font:clamp(2.3rem,4.5vw,4rem)/1.05 var(--serif); margin:0 0 .5rem; letter-spacing:-.055em }
.studio-panel h2 { font:1.7rem var(--serif); margin:.5rem 0 }
.studio-panel p { margin:.6rem 0 1rem }
.import-options,.covers,.book-fields,.studio-actions { display:flex; justify-content:center; flex-wrap:wrap; gap:.75rem; margin:1rem 0; }
.import-options button { flex:1 1 135px; min-height:140px; display:grid; place-content:center; gap:.45rem; }
.import-options b { font-size:1.8rem; color:var(--forest) }
.studio-actions .book-btn { min-width:min(240px,100%) }
.studio-panel details,.chapter-row,.source-row { background:var(--glass); border:1px solid #fff; border-radius:14px; margin:.6rem 0; padding:.7rem; box-shadow:inset 0 1px 5px #fff; }
.studio-panel summary { cursor:pointer }
.studio-panel label { display:grid; gap:.35rem; text-align:start; }
.studio-panel input:not([type=file]),.studio-panel textarea,.studio-panel select { font:inherit; padding:.65rem; border:1px solid #8f9e93; border-radius:9px; background:#fffc; width:100%; color:#13231b; }
.studio-panel textarea { min-height:120px; resize:vertical }
.chapter-head { display:flex; align-items:center; gap:.65rem; text-align:start }
.chapter-head img { width:65px; height:46px; object-fit:cover; border-radius:6px }
.chapter-head strong { flex:1; font:italic 1.2rem var(--serif); overflow-wrap:anywhere }
.chapter-head button { padding:.4rem .55rem }
.chapter-editor { display:grid; gap:.7rem; margin-top:.65rem; }
.source-row { overflow-wrap:anywhere }
.source-row pre { text-align:start; white-space:pre-wrap; max-height:15rem; overflow:auto }
.source-row img,.source-row video { max-width:100%; max-height:15rem }
.book-spread { display:grid; grid-template-columns:1fr 1fr; background:#103322; padding:8px; border-radius:6px; box-shadow:0 12px 28px #17261c59; text-align:start; min-height:320px; }
.book-page { padding:clamp(1rem,5vw,3rem); background:#fffefa url('./assets/marble.webp') center/cover; min-width:0; overflow-wrap:anywhere; box-shadow:inset -8px 0 15px #0002 }
.book-page h2 { font-size:clamp(1.7rem,5vw,4rem); line-height:.95; font-style:italic; }
.book-page p { white-space:pre-wrap; }
.book-spread img { width:100%; height:100%; max-height:530px; object-fit:cover; }
.cover { width:clamp(66px,13vw,125px); aspect-ratio: .72; border-radius:6px; border:3px double #c6a477; box-shadow:inset 5px 0 8px #0005,0 4px 8px #0003; display:grid; place-content:center; padding:.5rem; font:italic 1.1rem var(--serif); overflow-wrap:anywhere; }
.cover[aria-pressed=true],.glass-btn[aria-pressed=true] { outline:2px solid #125e3b; outline-offset:3px }
.cover-emerald { background:#0a2b1b; color:var(--gold) }
.cover-marble { background:#f5f2ed url('./assets/marble.webp') center/cover; color:#181b16 }
.cover-onyx { background:#141714; color:#fff }
.cover-sage { background:#dbe4d5; color:#122a19 }
.book-fields > * { flex:1 1 140px }
#book-status { text-align:center; min-height:1.5rem; margin:0; padding:.3rem; }
#export-document { display:none }
@media(max-width:680px) {
  .book-nav { justify-content:center; gap:.7rem; }
  .book-links { order:3; justify-content:center; width:100%; gap:1rem; }
  .book-hero { padding:1.5rem 1rem 61%; text-align:center; background:linear-gradient(#03140c 40%,transparent 65%),url('./assets/hero.webp') center bottom/100% auto no-repeat; justify-content:center; }
  .hero-copy { max-width:100% }
  .memory-types { justify-content:center }
  .studio-layout { display:block }
  .studio-nav { flex-direction:row; flex-wrap:wrap; justify-content:center; padding:.75rem; gap:.35rem; }
  .studio-nav .wordmark { display:none }
  .studio-nav button { font-size:.8rem; padding:.45rem }
  .studio-panel { padding-top:1.4rem }
  .book-spread { min-height:220px }
  .chapter-head img { width:42px }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto!important; transition:none!important } }
@media print {
  body > :not(#export-document) { display:none!important }
  #export-document { display:block; color:black; }
  #export-document section { break-before:page; white-space:pre-wrap; overflow-wrap:anywhere; }
  #export-document header { text-align:center; padding:25vh 1rem 2rem; }
}
#book-app {
  background-image:url('./assets/palm.webp'),linear-gradient(#ffffff45,#ffffff45),url('./assets/marble.webp');
  background-position:top 50px right,center,center;
  background-size:clamp(100px,20vw,210px) auto,cover,cover;
  background-repeat:no-repeat;
  background-blend-mode:multiply,normal,normal;
}
.studio-layout { min-height:calc(100vh - 100px) }
.studio-panel { padding-top:clamp(2rem,5vw,4rem) }
.studio-nav { backdrop-filter:blur(9px); }
.studio-nav .glass-btn { border-color:transparent; background:transparent; box-shadow:none }
.studio-nav .glass-btn[aria-current=step] { background:#fff9 }
.chapter-caption { flex:1; min-width:0; display:grid; gap:.15rem }
.chapter-caption small { font-size:.72rem }
.chapter-grip { cursor:grab; color:#365647; padding:.3rem }
.evidence-picker { display:grid; gap:.35rem; margin:.65rem 0 }
.evidence-picker label { display:flex; align-items:center; gap:.35rem }
.studio-panel .evidence-picker input { width:auto }
#book-app[data-screen=book] .studio-layout { display:block }
#book-app[data-screen=book] .studio-nav { flex-direction:row; flex-wrap:wrap; justify-content:center; padding:.65rem }
#book-app[data-screen=book] .wordmark { margin:auto 1rem auto 0 }
#book-app[data-screen=book] .studio-panel { padding-top:1.1rem }
.book-spread { grid-template-columns:1fr 1fr; min-height:0 }
.book-page { color:#151a16; border-left:5px double #d7cfc3; border-right:5px double #e1dbd4 }
.book-page h2::after { content:""; display:block; width:3rem; border-top:1px solid #135332; margin:1rem 0 }
.book-spread img { min-height:0; max-height:460px; aspect-ratio:4/5; border-right:5px double #ddd2c5; }
.book-spread.view-reading { grid-template-columns:1fr }
.page-strip { display:flex; flex-wrap:wrap; gap:.6rem; justify-content:center }
.page-strip button { width:88px; min-height:55px; padding:.2rem; display:grid; align-content:start; gap:.15rem; font-size:.67rem; overflow-wrap:anywhere }
.page-strip img { width:100%; height:34px; object-fit:cover; border-radius:5px }
.mini-cover { display:grid; place-content:center; min-height:52px; background:#062b1b; color:#dfbc82; border-radius:5px }
#book-status { position:static; z-index:1; background:#fffc; overflow-wrap:anywhere }
#book-status:empty { visibility:hidden }
@media(max-width:680px) {
  .book-spread img { height:100%; aspect-ratio:auto; max-height:350px }
  .chapter-grip { display:none }
}
.book-page h2 { font-family:inherit }
.title-page { display:grid; place-content:center; text-align:center }
.title-page h2::after { margin-inline:auto }
.cover-emerald .title-page,.cover-onyx .title-page,.cover-sage .title-page { background:inherit; color:inherit; border:3px double #c6a477 }
.cover-emerald .title-page h2::after,.cover-onyx .title-page h2::after { border-color:currentColor }
@media(min-width:681px) {
  .book-hero { background-image:linear-gradient(90deg,#03140c 39%,#03140c 42%,transparent 56%),url('./assets/hero.webp') }
}
@media(max-width:680px) {
  .cover { width:clamp(63px,18vw,110px); font-size:.95rem }
}
#modal .upload input { display:block; position:absolute; width:1px; height:1px; opacity:0; }
#modal .upload:focus-within { outline:2px solid #145638; outline-offset:4px }
.thumbnail-nav { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:.55rem }
.thumbnail-nav > button { padding:.45rem .75rem }
.page-strip { flex-wrap:nowrap; overflow-x:auto; justify-content:start; padding:.35rem; scrollbar-width:thin }
.page-strip button { flex:0 0 88px }
.import-disclosure { color:#365647; font-size:.87rem }
@media(min-width:681px) {
  .studio-layout { grid-template-columns:minmax(180px,24.5%) minmax(0,1fr); }
  .studio-panel { padding-top:2.35rem; }
  .studio-nav { padding-top:2.5rem; }
  .import-options button { min-height:170px; }
  .chapter-row { padding:.45rem .75rem; }
  .covers { gap:1rem; }
}
#book-app {
  background-image:linear-gradient(#ffffff10,#ffffff28),url('./assets/marble.webp');
  background-size:cover,cover;
  background-position:center;
  background-blend-mode:normal;
  position:relative;
  isolation:isolate;
}
#book-app::before {
  content:"";
  position:absolute;
  z-index:-1;
  top:57px;
  right:0;
  width:min(24vw,220px);
  aspect-ratio:1.5;
  background:url('./assets/palm.webp') top right/cover no-repeat;
  mix-blend-mode:multiply;
  mask-image:radial-gradient(ellipse at top right,#000 25%,transparent 78%);
  pointer-events:none;
}
.spread-navigation { display:grid; grid-template-columns:2.6rem minmax(0,1fr) 2.6rem; align-items:center; gap:.55rem }
.spread-navigation > button { border-radius:50%; padding:.2rem; height:2.6rem; font-size:1.55rem; background:#fffe }
.reading-modes { width:fit-content; max-width:100%; margin-inline:auto; border-radius:24px; padding:.35rem; background:#ffffff56; box-shadow:inset 0 1px 6px #fff }
.reading-modes button { border-radius:24px }
.reading-modes button[aria-pressed=true] { background:var(--forest); color:white; outline:none }
.page-picker { margin:.45rem auto; font-size:.8rem }
.page-picker label { display:flex; align-items:center; max-width:100% }
.page-picker select { max-width:min(44vw,270px) }
@media(min-width:681px) {
  #book-app:not([data-screen=book]) .studio-panel { width:min(100%,930px); padding-inline:clamp(1.75rem,3.5vw,3rem) }
  #book-app[data-screen=studio] .studio-panel { position:relative }
  #book-app[data-screen=studio] .studio-add { justify-content:flex-end; margin:.4rem 0 }
  .import-options { gap:1.1rem; margin-block:1.5rem }
  .import-options button { border-radius:24px; background:#fffc; backdrop-filter:blur(8px) }
  .chapter-row { border-radius:19px; margin:.65rem 0; padding:.45rem .85rem }
  .covers { gap:1.2rem }
  .cover { width:clamp(84px,12vw,147px) }
}
@media(max-width:680px) {
  .spread-navigation { grid-template-columns:1.95rem minmax(0,1fr) 1.95rem; gap:.22rem }
  .spread-navigation > button { height:1.95rem; font-size:1.35rem }
  .book-page { padding:.7rem }
}

#book-app {
  background-image:url('./assets/marble.webp');
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
  background-attachment:fixed;
}

.library-dialog { width:min(92vw,34rem); max-height:86vh; padding:2rem; border:1px solid white; border-radius:24px; background:#faf8f2; color:#13251b; text-align:center; box-shadow:0 20px 75px #00190c55; }
.library-dialog::backdrop { background:#051a12a0; backdrop-filter:blur(6px) }
.library-dialog h2 { font:2.4rem/1 var(--serif); margin:.4rem 0 1.4rem }
.library-close { position:absolute; right:.75rem; top:.75rem }
.library-dialog label { display:grid; gap:.35rem; margin:.7rem 0; text-align:left }
.library-dialog input:not([type=checkbox]) { width:100%; padding:.65rem; border:1px solid #a2b1a6; border-radius:8px; background:white; color:#13251b; font:inherit }
.library-dialog .library-consent { display:flex; justify-content:center; align-items:center }
.library-dialog output { display:block; overflow-wrap:anywhere; padding:.75rem; background:#fff; user-select:all }
.library-dialog details { margin-top:1rem }
.library-dialog .glass-btn,#purchase-options .glass-btn { max-width:100%; white-space:normal; overflow-wrap:anywhere }
#purchase-options { margin:1rem auto; max-width:40rem }

/* Keep approved homepage visible from the initial HTML, independent of module initialization. */
#book-home{display:block;min-height:390px}

/* Approved hero and below-the-fold sections render without JavaScript. */
#top > .hero { display:none !important; }
