/* Homepage only: compact discovery; catalog and reader preferences are unchanged. */
body.home-compact{--home-surface:#111224;--home-ink:#edf0ff;--home-muted:#b8b4c9;--home-border:#9485a5;background:var(--home-surface);color:var(--home-ink)}
body.home-compact[data-theme="light"]{--home-surface:#fff;--home-ink:#282229;--home-muted:#625a66;--home-border:#93879d}
body.home-compact .ambient{display:none}
body.home-compact .site-header{position:relative;inset:auto;display:grid;grid-template-columns:auto minmax(0,1fr);height:auto;min-height:73px;padding:12px max(16px,calc((100% - 1180px)/2));gap:10px 24px;background:var(--home-surface);color:var(--home-ink);border-bottom:1px solid var(--home-border);backdrop-filter:none}
/* The canonical scroll handler still toggles .scrolled. Keep both states in flow. */
body.home-compact .site-header,
body.home-compact .site-header.scrolled{position:relative!important;inset:auto;transform:none;width:100%;max-width:none;box-sizing:border-box;margin:0;border-radius:0;box-shadow:none;background:var(--home-surface)!important}
body.home-compact .brand>span{display:none}
body.home-compact .header-actions{justify-self:end;display:flex;align-items:center;gap:10px;min-width:0}
body.home-compact .compact-search{display:flex;align-items:center;justify-content:flex-start;gap:12px;width:clamp(160px,26vw,350px);height:44px;padding:8px 14px;border:1px solid var(--home-border);border-radius:10px;background:var(--home-surface);color:var(--home-muted)}
body.home-compact .compact-search b{font-size:13px;font-weight:400}
body.home-compact .desktop-nav{grid-row:2;grid-column:1/-1;display:flex;justify-content:flex-start;gap:24px;overflow-x:auto;max-width:100%;white-space:nowrap;padding:0;scrollbar-width:thin}
body.home-compact .desktop-nav a{display:inline-flex;align-items:center;min-height:44px;flex:none;color:var(--home-ink);font-size:14px}
body.home-compact .desktop-nav a.active{color:#a78bfa;border-bottom:3px solid currentColor}
body.home-compact[data-theme="light"] .desktop-nav a.active{color:#6730b8}
body.home-compact .hero.ai-portal{position:relative;isolation:isolate;width:min(1180px,calc(100% - 32px));height:auto;min-height:0;margin:20px auto 28px;border-radius:16px;display:grid;overflow:hidden;background:#111224;color:#fff}
body.home-compact .hero.ai-portal .hero-image{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:1;transform:none}
body.home-compact .hero.ai-portal .hero-overlay{position:absolute;inset:0;background:linear-gradient(90deg,rgba(10,8,20,.9),rgba(10,8,20,.3) 75%);opacity:1}
body.home-compact .hero.ai-portal .hero-grain{display:none}
body.home-compact .hero.ai-portal .hero-shell{position:relative;display:block;width:100%;min-height:300px;padding:32px 36px 60px;margin:0}
body.home-compact .hero.ai-portal .hero-content{width:min(560px,100%);max-width:none;margin:0;padding:0}
body.home-compact .hero.ai-portal h1{margin:10px 0;max-width:none;font-size:clamp(24px,3.1vw,38px);line-height:1.3;color:#fff;background:none;-webkit-text-fill-color:currentColor;letter-spacing:0}
body.home-compact .hero.ai-portal h1 em{color:#e0ccff;font-style:normal}
body.home-compact .hero.ai-portal p{margin:0 0 14px;font-size:14px;line-height:1.6;color:#eee8f7;max-width:52ch}
body.home-compact .hero.ai-portal .eyebrow{color:#e0ccff;font-size:11px}
body.home-compact .hero.ai-portal .hero-actions{margin:0;display:flex;flex-wrap:wrap}
body.home-compact .hero.ai-portal .hero-actions>a{min-height:44px;font-size:14px}
body.home-compact .hero.ai-portal .hero-pagination{display:flex;position:absolute;inset:auto 24px 16px;justify-content:center;gap:4px;margin:0;z-index:3;transform:none}
body.home-compact .hero.ai-portal .hero-pagination button{display:grid;place-items:center;width:44px;min-width:44px;height:44px;padding:0;border-radius:8px;border:0;background:transparent;opacity:1}
body.home-compact .hero.ai-portal .hero-pagination button::after{content:"";display:block;width:8px;height:8px;border-radius:999px;background:#b8b4c9;box-shadow:0 0 0 2px #111224}
body.home-compact .hero.ai-portal .hero-pagination button[aria-current="true"]::after{width:20px;background:#e0ccff}
body.home-compact .hero.ai-portal .hero-pagination button:focus-visible{outline:3px solid #e0ccff;outline-offset:-3px}
body.home-compact main>.content-section{width:min(1180px,calc(100% - 32px));margin:0 auto;padding:24px 0;background:transparent;border-top:1px solid var(--home-border)}
body.home-compact .home-free-links{display:flex;align-items:center;flex-wrap:wrap;gap:8px 16px;width:min(1180px,calc(100% - 32px));margin:0 auto 20px;color:var(--home-muted)}
body.home-compact .home-free-links>span{font-size:10px;letter-spacing:.08em}
body.home-compact .home-free-links>a{display:inline-flex;align-items:center;min-height:44px;color:var(--home-ink);font-size:14px;text-decoration:underline;text-underline-offset:4px}
body.home-compact .section-heading h2{font-size:clamp(22px,2.5vw,28px);line-height:1.4}
body.home-compact .section-heading{margin-bottom:18px;gap:12px;flex-wrap:wrap}
body.home-compact .section-heading .eyebrow{display:none}
body.home-compact .novel-shelves{gap:24px}
body.home-compact .original-library.novel-rail{grid-auto-columns:clamp(140px,15vw,182px);gap:16px;margin-right:0;padding-right:2px}
body.home-compact .novel-shelf-head h3{font-size:19px;line-height:1.4}
body.home-compact .novel-shelf-head p{font-size:12px}
body.home-compact .continue-section{margin:24px auto;width:min(1180px,calc(100% - 32px))}
@media(max-width:1100px){body.home-compact .header-actions .ghost-button{display:none}}
@media(max-width:980px){body.home-compact .header-actions .theme-toggle b{display:none}}
body.home-compact :is(a,button):focus-visible{outline:3px solid #a78bfa;outline-offset:3px}
body.home-compact[data-theme="light"] :is(a,button):focus-visible{outline-color:#6730b8}
@media(max-width:760px){
  body.home-compact .site-header{padding:10px 16px;gap:8px 12px}
  body.home-compact .header-actions{gap:6px}
  body.home-compact .header-actions .ghost-button,body.home-compact .header-actions .theme-toggle b{display:none}
  body.home-compact .header-actions .theme-toggle,body.home-compact .compact-search{width:44px;min-width:44px;height:44px;padding:8px;justify-content:center}
  body.home-compact .compact-search b{display:none}
  body.home-compact .header-actions .gold-button{padding:8px 10px;min-height:44px;font-size:12px;white-space:nowrap}
  body.home-compact .desktop-nav{gap:20px}
  body.home-compact .hero.ai-portal{margin:16px auto 20px}
  body.home-compact .hero.ai-portal .hero-shell{min-height:260px;padding:24px 20px 116px}
  body.home-compact .hero.ai-portal h1{font-size:clamp(22px,5vw,30px);max-width:100%}
  body.home-compact .hero.ai-portal p{font-size:13px}
  body.home-compact .hero.ai-portal .hero-pagination{inset:auto 8px 12px;gap:2px;flex-wrap:wrap}
  body.home-compact .hero.ai-portal .hero-pagination button{width:44px;min-width:44px;height:44px}
  body.home-compact .original-library.novel-rail{grid-auto-columns:140px;gap:12px}
  body.home-compact .novel-shelf-controls{display:flex}
  body.home-compact .novel-shelf-controls button{width:44px;height:44px}
}
@media(max-width:390px){body.home-compact .site-header .brand img{width:88px!important;height:38px!important}}
@media(prefers-reduced-motion:reduce){body.home-compact .hero.ai-portal *{transition:none;animation:none}}
