/* Library-first layout. Preserve brand, routes, form IDs and source behavior. */
.halloween-theme .topbar{padding-top:18px;min-height:82px;gap:14px 24px}
.halloween-theme .page{padding-top:12px}
.halloween-season{margin:0 0 18px;border-block:1px solid var(--line)}
.halloween-season .halloween-sky{position:absolute;inset:0 0 auto;height:100%;z-index:1}
.halloween-season .halloween-witch{--witch-width:138px;left:auto;right:22px;top:4px}
.halloween-season .halloween-bat{left:68%;top:24px;width:25px;height:13px}
.halloween-season .halloween-bat--two{left:80%;top:52px;width:20px}
.halloween-season .halloween-bat--three{display:none}
.halloween-season .halloween-welcome:not([open]){min-height:100px;padding:24px 0}
.halloween-season .halloween-welcome:not([open]) summary{width:calc(100% - 240px);min-height:48px;gap:14px}
.halloween-season .halloween-welcome:not([open]) .halloween-welcome__title{font-size:25px}
.halloween-season .halloween-welcome:not([open]) .halloween-banner-ghost{right:180px;top:30px;width:30px}
.halloween-season .halloween-motion{display:block!important;left:auto;right:180px;bottom:8px;min-height:24px;padding:2px 0;font-size:10px}
.halloween-season:has(.halloween-welcome[open]) .halloween-witch{--witch-width:172px;right:28%;top:5px}
.halloween-season .halloween-welcome[open]{min-height:270px;padding-top:26px}
.halloween-season .halloween-welcome[open] .halloween-story-art{top:30px;max-width:450px;height:230px}
.halloween-season:has(.halloween-welcome[open]) .halloween-motion{left:0;right:auto;bottom:14px}

.is-catalogue .intro{margin:8px 0 16px}.is-catalogue .intro h1{font-size:30px;margin:0 0 4px}.is-catalogue .intro .intro-copy{font-size:13px}
.is-catalogue .welcome-benefit{padding:8px 12px;margin:8px 0 12px;font-size:12px}.is-catalogue .welcome-benefit p{margin:0}
.catalogue-toolbar{grid-template-columns:minmax(200px,1fr) 148px 180px auto auto!important;align-items:end;padding:12px 14px;gap:12px!important;border-radius:10px;background:var(--surface)}
.catalogue-toolbar .catalogue-query-field{grid-column:auto}
.catalogue-toolbar label{font-size:12px!important;font-weight:500}
.catalogue-toolbar input,.catalogue-toolbar select{margin-top:5px;min-height:44px}
.catalogue-search-field{position:relative;min-width:0}.catalogue-search-field>label{display:block}.catalogue-search-field>input{width:100%;min-width:0}
.catalogue-toolbar .catalogue-filter-actions{grid-column:auto;padding:0}
.catalogue-toolbar .catalogue-filter-actions>button{min-height:44px;white-space:nowrap;padding:8px 18px}
.catalogue-refine{display:contents}
.catalogue-refine>summary{grid-column:5;grid-row:1;display:flex!important;align-items:center;justify-content:center;gap:6px;border:1px solid var(--line);border-radius:6px;padding:8px 14px;min-height:44px!important;list-style:none;font-size:13px;user-select:none}
.catalogue-refine>summary::-webkit-details-marker{display:none}.catalogue-refine>summary::after{content:'+';font-size:18px;line-height:1}.catalogue-refine[open]>summary::after{content:'−'}
.catalogue-refine[open]>summary{border-color:var(--accent);color:var(--accent)}
#catalogue-refine-count{display:inline-grid;place-items:center;min-width:20px;height:20px;border-radius:50%;background:var(--accent);color:var(--accent-text);font-size:11px}
.catalogue-refine-panel{grid-column:1/-1;border-top:1px solid var(--line);padding-top:14px;min-width:0}
.catalogue-refine:not([open])>.catalogue-refine-panel{display:none!important}
.catalogue-secondary-filters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.catalogue-refine-panel .catalogue-advanced{border:0;padding:0;margin-top:8px}
.catalogue-refine-panel .catalogue-advanced-grid{grid-template-columns:1fr 1fr}
.catalogue-secondary-actions{display:flex;gap:8px;justify-content:flex-end;padding-top:12px}
.catalogue-secondary-actions button{min-height:40px;font-size:12px}
.catalogue-refine-panel .catalogue-tag-panels{gap:18px}.catalogue-refine-panel .catalogue-display-panel{margin-top:8px}
.catalogue-active-filters:empty{display:none}.catalogue-active-filters{padding-top:10px}
.catalogue-active-filters button{position:relative;background:var(--soft);border-color:transparent;border-radius:2px 6px 6px 2px;border-left:3px solid var(--accent);font-size:12px}
.catalogue-result-bar{padding:12px 0;flex-wrap:wrap}.catalogue-result-bar p{font-size:13px}.catalogue-result-bar>div{gap:8px;flex-wrap:wrap}.catalogue-result-bar button{font-size:12px;min-height:38px}
#catalogue-picks-open{color:var(--accent);border-color:var(--accent)}
.catalogue-card{display:flex;flex-direction:column;height:100%;padding-bottom:14px;min-width:0}
.catalogue-cards{align-items:stretch;gap:26px 20px}
.catalogue-art{padding:6px 6px 20px;background:var(--soft);border-radius:7px}
.catalogue-id{font-size:9px;left:8px;bottom:4px}
.catalogue-copy{display:flex;flex-direction:column;min-width:0}
.catalogue-copy h3{font-size:1rem;line-height:1.5;min-height:3em;margin:7px 0 5px;font-weight:650}
.catalogue-original-title{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;height:1.5em;line-height:1.5;margin:0 0 5px;font-size:11px}
.catalogue-copy .author{margin:0 0 8px;line-height:1.5;min-height:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.catalogue-badges{display:block;font-size:10px;letter-spacing:0;line-height:1.5;min-height:1.5em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.catalogue-synopsis{line-height:1.6;min-height:3.2em;margin-bottom:8px}
.catalogue-card-tags{overflow:visible;max-height:none!important;display:flex;flex-wrap:nowrap;gap:5px;min-height:32px;margin-top:10px}
.catalogue-card-tags button{font-size:11px;min-height:28px;padding:4px 7px;min-width:0;max-width:31%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:4px;background:var(--soft);border-color:transparent}
.catalogue-card-tags .catalogue-tags-more{flex:none;max-width:none;color:var(--accent);background:none;font-variant-numeric:tabular-nums}
.catalogue-card-footer{margin-top:auto;padding-top:6px;display:flex;justify-content:space-between;align-items:flex-start;gap:8px;flex-wrap:wrap}
.catalogue-card-footer button,.catalogue-card-footer a{font-size:11px;min-height:32px;white-space:nowrap;text-decoration:none!important}
.catalogue-card-footer button:hover,.catalogue-card-footer a:hover{color:var(--accent);text-decoration:underline!important}
.catalogue-copy .book-title-action{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere;line-height:inherit;font-weight:inherit;min-height:0}
.catalogue-copy .catalogue-original-title{font-size:.75rem;color:var(--muted)}
.catalogue-facts,.catalogue-metrics{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.6}
.catalogue-card-footer button{display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:4px 0}
.catalogue-suggestions{position:absolute;top:calc(100% + 8px);left:0;width:max(100%,340px);max-width:calc(100vw - 48px);z-index:12;border:1px solid var(--line);border-radius:10px;background:var(--surface);box-shadow:0 14px 34px #302b3620;padding:5px}
.catalogue-suggestions[hidden]{display:none!important}
.catalogue-suggestions>button{display:flex;align-items:center;gap:10px;width:100%;padding:8px;border:0;border-radius:6px;background:none;color:var(--ink);text-align:left}
.catalogue-suggestions>button:is(:hover,[aria-selected=true]){background:var(--soft)}
.catalogue-suggestions img,.suggestion-no-cover{width:32px;height:46px;object-fit:cover;border-radius:3px;flex:none;background:var(--soft)}
.catalogue-suggestions>button>span:nth-child(2){flex:1;min-width:0}.catalogue-suggestions strong{display:block;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.catalogue-suggestions small{display:block;font-size:11px;color:var(--muted);margin-top:3px}
#catalogue-picks{width:min(820px,calc(100% - 28px));border-radius:12px;padding:24px}#catalogue-picks::backdrop{background:#111a18a6}
.picks-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}.picks-heading h2{font-family:var(--serif);font-size:30px;font-weight:400;margin:0}.picks-heading p{font-size:12px;color:var(--muted);margin:6px 0 0}
#catalogue-picks-content{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.pick-book{display:flex;gap:12px;align-items:center;text-align:left;background:none;border:1px solid var(--line);padding:14px;border-radius:7px;color:var(--ink)}
.pick-book--lead{grid-row:span 3;align-items:flex-start;flex-wrap:wrap;background:var(--soft);border-color:transparent}
.pick-book img{width:54px;height:78px;object-fit:contain;flex:none;border-radius:3px}.pick-book--lead img{width:110px;height:165px}
.pick-book>span:nth-child(2){flex:1;min-width:0}.pick-book small,.pick-book strong,.pick-book>span>span{display:block}.pick-book small{font-size:10px;color:var(--accent);margin-bottom:5px}.pick-book strong{font-size:14px;line-height:1.5}.pick-book>span>span{font-size:12px;color:var(--muted);margin-top:6px}.pick-book p{font-size:12px;line-height:1.7;color:var(--muted)}
.catalogue-detail{animation:library-page-open .22s cubic-bezier(.2,.7,.2,1);transform-origin:left center}
@keyframes library-page-open{from{opacity:.5;transform:perspective(900px) rotateY(-5deg) translateX(6px)}to{opacity:1;transform:none}}
.catalogue-cards>.empty{grid-column:1/-1;padding:36px 20px;text-align:center}.catalogue-cards>.empty::before{content:'';display:block;width:64px;height:74px;margin:0 auto 16px;background:url('./halloween-ghost-v1.webp') center/contain no-repeat;animation:ghost-breathe 6.8s ease-in-out infinite}
@media(min-width:1101px) and (max-width:1450px){.halloween-theme .topbar{padding-top:16px}}
@media(max-width:1100px){.halloween-theme .topbar{padding-top:14px}.catalogue-toolbar{grid-template-columns:minmax(180px,1fr) 120px 160px auto auto!important;gap:8px!important}.catalogue-toolbar select{padding-inline:8px}.catalogue-card-footer{flex-wrap:wrap}.catalogue-secondary-filters{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:767px){.halloween-theme .topbar{padding-top:12px;gap:8px}.halloween-theme .topbar nav{gap:20px}.halloween-season{margin-bottom:12px}.halloween-season .halloween-welcome:not([open]){min-height:92px;padding:15px 0}.halloween-season .halloween-welcome:not([open]) summary{width:calc(100% - 116px);min-height:60px;gap:10px}.halloween-season .halloween-welcome:not([open]) .halloween-welcome__title{font-size:21px;line-height:1.25}.halloween-season .halloween-welcome:not([open]) .halloween-welcome__title>span,.halloween-season .halloween-welcome:not([open]) .halloween-welcome__title em{display:block;margin-left:0}.halloween-season .halloween-witch{--witch-width:106px;right:2px;top:3px}.halloween-season .halloween-welcome:not([open]) .halloween-banner-ghost,.halloween-season .halloween-bat{display:none}.halloween-season .halloween-motion{right:5px;bottom:0;font-size:10px}.halloween-season:has(.halloween-welcome[open]) .halloween-witch{--witch-width:114px;right:0;top:0}.halloween-season .halloween-welcome[open]{min-height:270px}.halloween-season .halloween-welcome[open] .halloween-story-art{top:95px;width:53%;height:150px}.halloween-season:has(.halloween-welcome[open]) .halloween-motion{left:0;right:auto;bottom:5px}.is-catalogue .intro h1{font-size:25px}.is-catalogue .intro .intro-copy{font-size:12px}.catalogue-toolbar{grid-template-columns:1fr 1fr auto!important;padding:12px;gap:10px!important}.catalogue-search-field{grid-column:1/3}.catalogue-toolbar .catalogue-filter-actions{grid-column:3;grid-row:1}.catalogue-toolbar>.catalogue-access-field,.catalogue-toolbar>.catalogue-sort-field{grid-column:auto!important}.catalogue-toolbar>.catalogue-sort-field{min-width:0}.catalogue-refine>summary{grid-column:3;grid-row:2;padding-inline:10px}.catalogue-toolbar label{font-size:11px!important}.catalogue-toolbar select{font-size:12px}.catalogue-toolbar .catalogue-filter-actions>button{padding-inline:14px}.catalogue-toolbar>.catalogue-access-field,.catalogue-toolbar>.catalogue-sort-field{grid-row:2}.catalogue-result-bar{gap:8px}.catalogue-result-bar>div{width:100%;justify-content:space-between;gap:6px}.catalogue-result-bar button{font-size:11px;padding-inline:8px}.catalogue-result-bar p{font-size:12px}.catalogue-cards{gap:22px 12px}.catalogue-card-tags button{font-size:10px;padding-inline:5px}.catalogue-card-tags{gap:3px;min-height:28px}.catalogue-card-footer{gap:0 8px}.catalogue-copy h3{font-size:14px}.catalogue-date{font-size:9px}.catalogue-refine-panel .catalogue-tag-panels{grid-template-columns:1fr;gap:0}.catalogue-suggestions{width:calc(100vw - 64px);max-width:calc(100vw - 64px)}#catalogue-picks{padding:16px}.picks-heading h2{font-size:25px}#catalogue-picks-content{grid-template-columns:1fr}.pick-book--lead{grid-row:auto}.pick-book--lead img{width:78px;height:116px}}
@media(prefers-reduced-motion:reduce){.catalogue-detail,.catalogue-cards>.empty::before{animation:none!important}}
@media(max-width:767px){.catalogue-toolbar>.catalogue-search-field{grid-column:1/3}.halloween-lanterns{height:14px}.halloween-branch{top:-115px}.halloween-moon{display:none}}

/* Shared indexed search, rendered in the current section. */
.novel-search-field{position:relative;z-index:8;min-width:0}.novel-search-field .catalogue-suggestions{top:88px;left:0;width:100%;max-width:100%;z-index:30}.catalogue-suggestions [role=option]{touch-action:manipulation}.quick-search-results{scroll-margin-top:20px;padding:20px 0 30px;margin:0 0 24px;border-bottom:1px solid var(--line)}.quick-search-results[hidden]{display:none}.quick-search-results h2{font-family:var(--serif);margin:0 0 8px;font-size:28px}.quick-search-results .book-grid{grid-template-columns:repeat(auto-fill,minmax(190px,1fr))}.quick-search-results .cover-wrap{aspect-ratio:2/3}.quick-search-results .cover-slot{width:100%;height:100%}.quick-search-pagination{display:flex;gap:12px;justify-content:center;padding:20px 0 0}@media(max-width:767px){.novel-search-field .catalogue-suggestions{top:80px}.quick-search-results .book-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.quick-search-results h2{font-size:23px}.quick-search-results .section-heading{align-items:flex-start}.quick-search-results .section-heading>button{font-size:12px}}

/* Secondary reading metadata opens in place; no requests or hover-only content. */
.catalogue-card-extra{min-width:0;flex:1;font-size:12px;color:var(--muted)}
.catalogue-card-extra summary{cursor:pointer;min-height:44px;display:flex;align-items:center;gap:6px;list-style:none;width:fit-content}
.catalogue-card-extra summary::-webkit-details-marker{display:none}
.catalogue-card-extra summary::after{content:'+';color:var(--accent)}
.catalogue-card-extra[open] summary::after{content:'−'}
.catalogue-card-extra summary:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:3px}
.catalogue-card-extra>div{padding:0 0 8px}
.catalogue-card-extra .catalogue-original-title{display:block;height:auto;overflow:visible;overflow-wrap:anywhere;white-space:normal;margin:0 0 4px}
.catalogue-card-extra .catalogue-metrics{white-space:normal;margin:0;font-size:11px}
.catalogue-card-footer>button{flex-shrink:0;min-height:44px}
.book-info h3{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.catalogue-synopsis{min-height:3.2em}
@media(max-width:767px){.catalogue-card-extra{font-size:11px}.catalogue-card-footer{gap:0 8px}.catalogue-card-footer>button{font-size:11px}}
