.sticky-bar { 
    position: sticky; 
    top: 0; 
    z-index: 100; 
    background: rgba(255, 255, 255, 0.9); 
    backdrop-filter: blur(8px);
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.5rem; }
.book-card { background: white; border-radius: 1.5rem; overflow: hidden; border: 1px solid #e5e7eb; transition: 0.3s; }
.book-card:hover { transform: translateY(-8px); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); }
.animate-fade-in { animation: fadeIn 0.6s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.bg-custom { background-color: #1ca170; }
.text-custom { color: #1ca170; }
.border-custom { border-color: #1ca170; }

#filterSection {
    transition: all 0.3s ease-in-out;
    max-height: 500px;
    overflow: hidden;
}
#filterSection.hidden-filter {
    max-height: 0;
    margin-bottom: 0;
    opacity: 0;
}

.btn-filter-toggle {
    background-color: #f0fdf4;
    color: #1ca170;
    transition: all 0.2s;
}
.btn-filter-toggle:hover {
    background-color: #1ca170 !important;
    color: white !important;
}

.reader-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(15, 23, 42, 0.78); opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }
.reader-modal.is-open { opacity: 1; pointer-events: auto; }
.reader-shell { width: min(100%, 1080px); max-height: calc(100vh - 2rem); overflow: auto; border-radius: 1.25rem; background: #fff; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35); }
.reader-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; background: white; border-bottom: 1px solid #e2e8f0; }
.reader-title { min-width: 0; margin: 0; overflow: hidden; color: #166534; font-size: 1rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.reader-close, .reader-controls button { display: inline-flex; width: 2.5rem; height: 2.5rem; align-items: center; justify-content: center; border: 0; border-radius: 0.75rem; color: #166534; background: #dcfce7; cursor: pointer; transition: 0.2s; }
.reader-close:hover, .reader-controls button:hover { color: white; background: #16a34a; }
.reader-status { padding: 3rem 1rem; color: #166534; font-weight: 700; text-align: center; }
.book-viewport { display: flex; min-height: min(72vh, 680px); align-items: center; justify-content: center; overflow: auto; padding: 1.5rem; background: #fff; }
.book-page-flip { width: min(100%, 920px); height: min(72vh, 650px); flex: 0 0 auto; transform: scale(var(--reader-zoom, 1)); transform-origin: center center; transition: transform 0.2s ease; }
.flip-page { display: flex; align-items: center; justify-content: center; overflow: hidden; background: white; }
.flip-page canvas { display: block; max-width: 100%; max-height: 100%; }
.reader-controls { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 1rem; background: white; color: #166534; font-weight: 800; }
.reader-control-divider { width: 1px; height: 1.75rem; background: #d1d5db; }
.zoom-indicator { width: auto !important; min-width: 3.75rem; padding: 0 0.5rem; background: transparent !important; }
.reader-drive-link { margin-left: 1rem; color: #15803d; font-size: 0.8rem; text-decoration: underline; }
.reader-drive-link.is-primary { padding: 0.7rem 1rem; border-radius: 0.75rem; color: white; background: #16a34a; text-decoration: none; }
body.reader-open { overflow: hidden; }
.detail-modal { position: fixed; inset: 0; z-index: 190; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(255, 255, 255, .92); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.detail-modal.is-open { opacity: 1; pointer-events: auto; }
.detail-shell { position: relative; width: min(100%, 820px); max-height: calc(100vh - 2rem); overflow: auto; background: #fff; box-shadow: 0 20px 60px rgba(23, 60, 54, .25); }
.detail-close { position: absolute; top: 1.25rem; right: 1.25rem; z-index: 2; display: inline-flex; width: 2.5rem; height: 2.5rem; align-items: center; justify-content: center; border: 1px solid #e5ebe6; color: var(--ink); background: #fff; cursor: pointer; }
.detail-layout { display: grid; grid-template-columns: 250px 1fr; gap: 2.5rem; padding: 2.5rem; }
.detail-cover-wrap { display: flex; min-height: 340px; align-items: center; justify-content: center; background: #fff; }.detail-cover { display: block; width: 100%; height: 340px; object-fit: contain; cursor: pointer; }
.detail-content { padding: .5rem 2rem .5rem 0; }.detail-content h2 { max-width: 500px; margin: 0 0 .8rem; color: var(--ink); font-family: 'Fredoka', sans-serif; font-size: 2.2rem; font-weight: 600; line-height: 1.08; cursor: pointer; }.detail-description { margin: 0 0 1.2rem; color: var(--muted); font-family: 'Nunito', sans-serif; font-size: .85rem; line-height: 1.6; }.detail-read-button { display: flex; align-items: center; justify-content: center; gap: .5rem; width: fit-content; margin: .2rem auto 1.5rem; padding: .8rem 1.2rem; border: 0; color: #fff; background: var(--green); font-family: 'Nunito', sans-serif; font-size: .8rem; font-weight: 900; cursor: pointer; }.detail-read-button:hover { background: var(--ink); }.detail-meta { border-top: 1px solid #e5ebe6; }.detail-meta-row { display: grid; grid-template-columns: 145px 1fr; gap: 1rem; padding: .72rem 0; border-bottom: 1px solid #e5ebe6; font-family: 'Nunito', sans-serif; font-size: .8rem; }.detail-meta-row span { color: var(--muted); }.detail-meta-row strong { overflow-wrap: anywhere; color: var(--ink); font-weight: 700; }

@media (max-width: 640px) {
    .detail-modal { padding: 0; }
    .detail-shell { width: 100%; height: 100dvh; max-height: none; }
    .detail-layout { grid-template-columns: 1fr; gap: 1.2rem; padding: 3.5rem 1.2rem 1.5rem; }
    .detail-cover-wrap { min-height: 190px; }.detail-cover { height: 190px; }.detail-content { padding: 0; }.detail-content h2 { font-size: 1.8rem; }.detail-meta-row { grid-template-columns: 118px 1fr; padding: .65rem 0; font-size: .75rem; }
    .reader-modal { padding: 0; }
    .reader-shell { width: 100%; height: 100dvh; max-height: none; border-radius: 0; }
    .reader-header { padding: 0.8rem 1rem; }
    .reader-title { font-size: 0.9rem; }
    .book-viewport { min-height: calc(100dvh - 124px); padding: 0.25rem; }
    .book-page-flip { width: calc(100vw - 16px); height: calc(100dvh - 150px); }
    .reader-controls { flex-wrap: nowrap; gap: 0.35rem; min-height: 3.5rem; padding: 0.5rem; }
    .reader-controls button { width: 2.25rem; height: 2.25rem; }
    .reader-control-divider { display: none; }
    .zoom-indicator { min-width: 3.5rem; }
    .reader-drive-link { display: none; }
    .reader-drive-link.is-primary { display: block; width: 100%; margin: 0.25rem 0 0; text-align: center; }
}

@media (max-width: 900px) {
    header {
        flex-direction: column !important;
        gap: 1.5rem !important;
        padding: 1.5rem !important;
        text-align: center;
    }

    header > img {
        width: min(15rem, 55vw) !important;
    }

    header > div {
        text-align: center !important;
    }

    header h1 {
        font-size: clamp(2.25rem, 7vw, 3.5rem) !important;
    }

    header p {
        max-width: 42rem !important;
        margin-left: auto;
        margin-right: auto;
        font-size: 1rem !important;
    }

    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }

    .book-card {
        border-radius: 1rem;
    }
}

@media (max-width: 560px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
}

/* Library landing page */
:root {
    --ink: #173c36;
    --muted: #64736e;
    --mint: #dff2e8;
    --green: #1b8a68;
    --yellow: #f6c85f;
    --coral: #ed806c;
    --blue: #85b9d5;
    --paper: #ffffff;
}

html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: 'Nunito', sans-serif; }
body::before { display: none; }
.site-shell { width: min(1180px, calc(100% - 40px)); margin: auto; }
.site-nav { display: flex; align-items: center; justify-content: space-between; gap: 2rem; min-height: 78px; border-bottom: 1px solid #dce6df; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); font-size: 1.08rem; font-weight: 700; text-decoration: none; }
.brand img { width: 38px; height: 38px; object-fit: contain; }
.brand b { color: var(--green); }
.nav-links { display: flex; gap: 2rem; margin-left: auto; }
.nav-links a, .nav-stat { color: var(--muted); font-family: Arial, sans-serif; font-size: .78rem; font-weight: 700; text-decoration: none; }
.nav-links a:hover { color: var(--green); }
.nav-stat { display: flex; align-items: center; gap: .45rem; padding-left: 1.5rem; border-left: 1px solid #dce6df; }
.nav-stat i { color: var(--green); }
.nav-stat strong { color: var(--ink); }
.hero-section { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; min-height: 410px; border-bottom: 1px solid #dce6df; }
.hero-copy { padding: 4rem 0; }
.eyebrow { margin: 0 0 1rem; color: var(--green); font-family: Arial, sans-serif; font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow span { display: inline-block; width: 26px; height: 2px; margin: 0 .5rem .2rem 0; background: var(--coral); }
.hero-copy h1 { max-width: 580px; margin: 0; color: var(--ink); font-family: 'Fredoka', sans-serif; font-size: clamp(2.5rem, 4vw, 4rem); font-weight: 600; letter-spacing: 0; line-height: 1.04; }
.hero-copy h1 em { color: var(--coral); font-weight: 400; }
.hero-description { max-width: 440px; margin: 1.8rem 0; color: var(--muted); font-family: Arial, sans-serif; font-size: .97rem; line-height: 1.7; }
.hero-action { display: inline-flex; align-items: center; gap: .8rem; padding: .85rem 1.2rem; color: #fff; background: var(--green); font-family: Arial, sans-serif; font-size: .78rem; font-weight: 800; text-decoration: none; }
.hero-action:hover { background: var(--ink); }
.hero-action i { font-size: .7rem; }
.hero-art { position: relative; height: 330px; overflow: hidden; }
.sun-disc { position: absolute; top: 1rem; right: 8%; width: 230px; height: 230px; border-radius: 50%; background: #f7e9bd; }
.hero-art img { position: absolute; right: 12%; bottom: -1rem; z-index: 1; width: min(300px, 72%); height: auto; filter: drop-shadow(8px 12px 0 rgba(23, 60, 54, .1)); }
.hero-note { position: absolute; right: 2%; bottom: 2.5rem; z-index: 2; padding: .65rem .85rem; color: var(--ink); background: #fff; font-family: 'Nunito', sans-serif; font-size: .72rem; font-weight: 700; line-height: 1.25; box-shadow: 4px 5px 0 #dce6df; transform: rotate(3deg); }.hero-note b { color: var(--coral); }
.category-section { padding: 4.2rem 0 3.7rem; }
.section-heading, .library-intro { display: flex; align-items: end; justify-content: space-between; gap: 2rem; }
.section-heading h2, .library-intro h2 { margin: 0; font-family: 'Fredoka', sans-serif; font-size: 2rem; font-weight: 600; letter-spacing: 0; }
.section-heading a { color: var(--green); font-family: Arial, sans-serif; font-size: .78rem; font-weight: 800; text-decoration: none; }.section-heading a i { margin-left: .4rem; }
.category-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: .7rem; margin-top: 1.8rem; }
.category-chip { display: flex; flex-direction: column; justify-content: space-between; min-height: 112px; padding: 1rem; border: 0; color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: transform .2s ease, outline-color .2s ease; }.category-chip:hover { transform: translateY(-5px); }.category-chip.is-active { outline: 2px solid var(--ink); outline-offset: 3px; }.category-chip i { font-size: 1.4rem; }.category-chip span { font-family: Arial, sans-serif; font-size: .76rem; font-weight: 800; }.category-green { background: #cfe9dc; }.category-yellow { background: #f9e5a9; }.category-coral { background: #f4c0b1; }.category-blue { background: #c2deeb; }.category-lilac { background: #ddd7ec; }
.library-section { padding: 3.7rem 0 1rem; border-top: 1px solid #dce6df; }.section-note { margin: .5rem 0 0; color: var(--muted); font-family: Arial, sans-serif; font-size: .82rem; }.library-count { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-family: Arial, sans-serif; font-size: .72rem; }.library-count i { color: var(--green); }
.search-panel { margin-top: 2rem; padding: 1rem; background: #fff; border: 1px solid #e1e9e3; box-shadow: 0 8px 28px rgba(23, 60, 54, .06); }.search-panel .sticky-bar { position: static; padding: 0; border: 0; background: transparent; box-shadow: none; }.search-panel input { border-color: #dce6df; border-radius: 0 !important; font-family: Arial, sans-serif; }.search-panel .btn-filter-toggle { border-radius: 0 !important; }.search-panel #filterSection { justify-content: flex-start; }
.books-section { padding: 1rem 0 5rem; }.card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.2rem; }.book-card { border-radius: .9rem; border: 1px solid #e1e9e3; border-bottom: 1px solid #e1e9e3; box-shadow: 0 8px 22px rgba(23,60,54,.06); }.book-card:hover { transform: translateY(-5px); border-color: #c7ddd1; box-shadow: 0 16px 30px rgba(23,60,54,.12); }.book-card > div:first-child { border-radius: .65rem; background: #f3f8f4; border-color: #e5eee8; }.book-card h3 { font-family: Georgia, 'Times New Roman', serif; }.book-card button { border-radius: .6rem; background: var(--green); }.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1.4rem 0 1.8rem; border-top: 1px solid #dce6df; color: var(--muted); font-family: 'Nunito', sans-serif; font-size: .74rem; line-height: 1.5; }.site-footer span:first-child { color: var(--ink); font-weight: 700; }.site-footer span:last-child { color: #7a8983; }

@media (max-width: 800px) { .site-shell { width: min(100% - 28px, 600px); }.nav-links { display: none; }.nav-stat { padding-left: 0; border: 0; }.hero-section { grid-template-columns: 1fr; min-height: auto; }.hero-copy { padding: 3.2rem 0 1rem; }.hero-art { height: 285px; }.hero-art img { right: 19%; width: 240px; }.hero-note { right: 4%; bottom: 1.5rem; }.sun-disc { right: 15%; top: .5rem; width: 190px; height: 190px; }.category-list { grid-template-columns: repeat(2, 1fr); }.category-chip:last-child { grid-column: span 2; min-height: 76px; }.section-heading, .library-intro { align-items: flex-start; flex-direction: column; }.library-count { margin-top: -1rem; }.card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.site-footer { gap: .6rem; flex-direction: column; } }
@media (max-width: 480px) { .site-shell { width: calc(100% - 24px); }.brand { font-size: .95rem; }.nav-stat { font-size: .68rem; }.hero-copy h1 { font-size: 3.2rem; }.hero-description { font-size: .88rem; }.category-list { gap: .5rem; }.category-chip { min-height: 96px; padding: .75rem; }.card-grid { grid-template-columns: 1fr; }.search-panel { padding: .65rem; }.search-panel .flex { gap: .4rem; }.search-panel input { font-size: .9rem; }.search-panel #alphaContainer { max-height: 90px; overflow: auto; } }

.book-card h3, .site-footer, .search-panel input { font-family: 'Nunito', sans-serif; }
.shelf-actions { display: flex; align-items: center; gap: .7rem; }
.shelf-actions a { margin-right: .5rem; color: var(--green); font-family: 'Nunito', sans-serif; font-size: .8rem; font-weight: 900; text-decoration: none; }
.shelf-actions button { display: inline-flex; width: 3.7rem; height: 3.7rem; align-items: center; justify-content: center; border: 2px solid var(--green); border-radius: .9rem; color: var(--green); background: #fff; font-size: 1.15rem; cursor: pointer; transition: .2s ease; }
.shelf-actions button:hover { color: #fff; background: var(--green); }
@media (max-width: 800px) { .shelf-actions button { width: 3rem; height: 3rem; } }

.feature-section { padding: 3.8rem 0 1rem; border-top: 1px solid #dce6df; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin-top: 1.8rem; }
.feature-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; min-height: 125px; padding: 1.15rem; color: var(--ink); text-decoration: none; transition: transform .2s ease; }.feature-card:hover { transform: translateY(-4px); }.feature-card-green { background: #cfe9dc; }.feature-card-coral { background: #f4c0b1; }.feature-card-blue { background: #c2deeb; }.feature-icon { display: grid; width: 2.6rem; height: 2.6rem; place-items: center; color: var(--ink); background: rgba(255,255,255,.55); border-radius: 50%; }.feature-card h3 { margin: 0; font-family: 'Fredoka', sans-serif; font-size: 1.05rem; font-weight: 600; }.feature-card p { margin: .35rem 0 0; color: rgba(23,60,54,.7); font-family: 'Nunito', sans-serif; font-size: .72rem; line-height: 1.4; }.feature-arrow { font-size: .75rem; }
.shelves-section { padding: 3.8rem 0 1rem; }.book-shelf + .book-shelf { margin-top: 3.5rem; }.shelf-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; }.shelf-heading h2 { margin: 0; font-family: 'Fredoka', sans-serif; font-size: 1.8rem; font-weight: 600; }.shelf-heading a { color: var(--green); font-family: 'Nunito', sans-serif; font-size: .75rem; font-weight: 800; text-decoration: none; }.shelf-track { display: flex; gap: 1rem; overflow-x: auto; padding: 1.5rem .1rem .8rem; scrollbar-color: var(--green) transparent; }.shelf-book { flex: 0 0 148px; padding: 0; border: 0; color: var(--ink); background: transparent; font-family: 'Nunito', sans-serif; text-align: left; cursor: pointer; }.shelf-cover { position: relative; display: block; height: 190px; overflow: hidden; background: #eef5ef; }.shelf-cover img { width: 100%; height: 100%; object-fit: cover; }.shelf-cover span { position: absolute; right: .35rem; bottom: .35rem; padding: .25rem .4rem; color: var(--ink); background: rgba(255,255,255,.88); font-size: .58rem; font-weight: 800; }.shelf-book strong { display: -webkit-box; margin-top: .6rem; overflow: hidden; font-size: .78rem; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
@media (max-width: 800px) { .feature-grid { grid-template-columns: 1fr; }.shelf-heading { align-items: flex-start; flex-direction: column; gap: .5rem; } }

@media (min-width: 901px) {
    .reader-modal { padding: 0; }
    .reader-shell { width: 100%; height: 100vh; max-height: none; overflow: hidden; border-radius: 0; }
    .reader-header { min-height: 3.75rem; padding: .8rem 1.25rem; }
    .reader-title { font-size: 1.05rem; }
    .reader-status { padding: 4rem 1rem; }
    .book-viewport { min-height: 0; height: calc(100% - 8.5rem); padding: 1rem 2rem 1.25rem; background: #f3f7f4; }
    .book-page-flip { width: min(100%, 720px); height: min(100%, 880px); }
    .flip-page { box-shadow: 0 8px 24px rgba(23, 60, 54, .12); }
    .reader-controls { min-height: 4.75rem; padding: .85rem 1rem; border-top: 1px solid #e2e8f0; }
}