.books{max-width:1080px;margin:0 auto;padding-bottom:32px}.books-search{display:flex;flex-direction:column;gap:8px;max-width:520px;margin-bottom:24px}.books-search input{width:100%;box-sizing:border-box}.books-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:24px;align-items:start}.book-card{min-width:0;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-md);overflow:hidden}.book-cover{position:relative;aspect-ratio:3/4;background:var(--brand-soft)}.book-cover-fallback{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;gap:18px;text-align:center;padding:20px;color:var(--brand-deep);border:12px solid var(--surface-muted);overflow-wrap:anywhere}.book-cover-fallback strong{font-family:"Source Serif 4",serif;font-size:1.3rem;line-height:1.3}.book-cover-fallback span{font-size:.8rem}.book-cover img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:var(--surface-muted)}.book-description{padding:18px}.book-script{color:var(--ink-soft);font-size:.75rem}.book-description h2{font-size:1.1rem;line-height:1.35;margin:8px 0;overflow-wrap:anywhere}.book-description p{font-size:.875rem;line-height:1.5;color:var(--ink-soft);margin:0 0 16px;overflow-wrap:anywhere}.book-description .button{display:block;text-align:center;min-height:44px;box-sizing:border-box}.books-empty{padding:40px 24px;border:1px dashed var(--line-strong);border-radius:var(--radius-md);text-align:center;color:var(--ink-soft);background:var(--surface)}.books-empty h2{font-size:1.3rem;color:var(--ink)}
@media(max-width:1200px){.books-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:640px){.books-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.book-description{padding:12px}.book-description h2{font-size:1rem}.book-cover-fallback{padding:10px;border-width:8px}.book-cover-fallback strong{font-size:1.1rem}.book-cover-fallback span{font-size:.7rem}.books-search{max-width:none}}
@media(max-width:360px){.books-grid{grid-template-columns:1fr}}
.books-reader{max-width:1000px;margin:0 auto;padding-bottom:24px}.books-reader-heading{display:flex;align-items:center;gap:24px;margin-bottom:20px}.books-reader-heading h1{font-size:1.4rem;margin:0;overflow-wrap:anywhere}.books-reader-heading a{flex:none}.books-reader-tools{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:16px}.books-reader-tools label{display:flex;flex-direction:column;gap:6px;min-width:0;max-width:65%;font-size:.8rem}.books-reader-tools select{width:100%;min-height:44px;padding:8px 12px;border:1px solid var(--line-strong);border-radius:12px;background:var(--surface);color:var(--ink);font:inherit}.books-reader-font{display:flex;gap:8px;align-items:center;font-size:.8rem}.books-reader-font .button{min-height:44px;min-width:44px;padding:8px}.books-reader-stage{height:clamp(360px,66dvh,760px);background:#fffdf8;border:1px solid var(--line);border-radius:16px;overflow:hidden}.books-reader-stage iframe{width:100%;height:100%;border:0;display:block}.books-reader-status:empty{display:none}.books-reader-status{padding:12px 0;color:var(--ink-soft)}.books-reader-footer{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:16px}.books-reader-footer span{font-size:.75rem;color:var(--ink-soft);text-align:center}.books-reader-footer .button{min-height:44px}.books-reader [hidden]{display:none}
@media(max-width:640px){.books-reader-heading{align-items:flex-start;flex-direction:column;gap:14px}.books-reader-tools{gap:10px}.books-reader-tools label{max-width:60%}.books-reader-font{flex-wrap:wrap;justify-content:flex-end}.books-reader-font span{width:100%;text-align:right}.books-reader-stage{height:54dvh;min-height:340px}.books-reader-footer .button{padding:8px 12px;font-size:.8rem}}
/* The reader has its own Back to Books exit; the fixed mobile dock must not
   cover book text or page controls. The bookshelf and other screens keep it. */
@media(max-width:980px){.library-app .books-shell:has(.books-reader) .sidebar{display:none}.library-app .student-shell.books-shell:has(.books-reader){padding-bottom:0}}
/* A width-driven portrait sheet, not a viewport-height dashboard panel.
   The document scrolls around it; the EPUB remains horizontally paginated. */
.books-reader{max-width:720px}
.books-reader-stage{position:relative;height:auto;min-height:0;aspect-ratio:210/297}
.books-reader-stage>iframe{position:absolute;inset:0}
.library-app .books-reader .book-page-guide{margin-top:22px;padding:22px;background:#fff;border:1px solid #d8dfe4;border-radius:14px;box-shadow:0 4px 16px #183b7708}
.library-app .books-reader .book-page-guide h2{margin:0 0 8px;font-family:Georgia,'Times New Roman',serif;font-size:1.5rem;font-weight:500;color:#0b2346}
.library-app .books-reader .book-page-guide>p{color:#526176;line-height:1.55}
.library-app .books-reader .book-page-guide .field-label{display:flex;flex-direction:column;gap:8px;margin:16px 0 12px}
.library-app .books-reader .book-page-guide textarea{box-sizing:border-box;width:100%;min-height:94px}
.library-app .books-reader .book-page-guide [data-book-ai-status]:empty{display:none}
.library-app .books-reader [data-book-ai-answer]:not(:empty){margin-top:16px;padding:14px;background:#f7f9fb;border:1px solid #e1e8ee;border-radius:10px}
.library-app .books-reader .book-ai-response .ai-thinking-mark{flex-basis:24px;width:24px;height:24px}
.library-app .books-reader .book-ai-response .ai-response-content{white-space:pre-wrap;line-height:1.6}
/* Approved catalogue treatment; the EPUB reader and application shell stay unchanged. */
.library-app .books-shell .books{max-width:1280px;}
.library-app .books-shell .books>.student-screen-head{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:12px;min-height:200px;box-sizing:border-box;padding:30px 34px;margin-bottom:20px;border:1px solid #e4e0d6;border-radius:14px;background:#f1ece1 url('/media/books/catalogue-hero.jpg') center/cover no-repeat;}
.library-app .books-shell .books>.student-screen-head h1{font-family:Georgia,'Times New Roman',serif;font-size:clamp(2rem,3.5vw,3.5rem);font-weight:500;line-height:1.1;color:#0b2346;letter-spacing:-.035em;}
.library-app .books-shell .books>.student-screen-head p{max-width:44%;margin:0;color:#43556b;line-height:1.5;}
.library-app .books-shell .books-search{max-width:none;margin-bottom:18px;}
.library-app .books-shell .books-search input{min-height:46px;border-radius:10px;background:#fff;}
.library-app .books-shell .books-section-title{font-family:Georgia,'Times New Roman',serif;font-weight:500;font-size:1.7rem;margin:0 0 16px;color:#0b2346;letter-spacing:-.025em;}
.library-app .books-shell .books-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:16px;align-items:stretch;}
.library-app .books-shell .book-card{display:flex;flex-direction:column;background:#fdfbf7;border-radius:10px;border-color:#e6e2d9;}
.library-app .books-shell .book-cover{aspect-ratio:3/4;background:linear-gradient(135deg,#f1eee5,#faf8f2);}
.library-app .books-shell .book-card:nth-child(even) .book-cover{background:linear-gradient(135deg,#eaf0f3,#f7f9fa);}
.library-app .books-shell .book-cover img{inset:12px;width:calc(100% - 24px);height:calc(100% - 24px);background:transparent;filter:drop-shadow(3px 5px 4px #15233330);}
.library-app .books-shell .book-cover-fallback{inset:12px;border:1px solid #c6cbd2;box-shadow:3px 5px 7px #1523331c;background:#e4eaf1;padding:12px;}
.library-app .books-shell .book-cover:has(img) .book-cover-fallback{visibility:hidden;}
.library-app .books-shell .book-description{display:flex;flex-direction:column;flex:1;padding:10px 14px 12px;}
.library-app .books-shell .book-description h2{font-family:Georgia,'Times New Roman',serif;font-size:1.125rem;font-weight:500;color:#0b2346;margin:5px 0;}
.library-app .books-shell .book-description p{margin-bottom:8px;}
.library-app .books-shell .book-description .button{margin-top:auto;text-align:left;border:0;background:none;color:#183b77;border-radius:6px;padding:10px 0;}
.library-app .books-shell .book-description .button::after{content:' →';}
@media(max-width:1200px){.library-app .books-shell .books-grid{grid-template-columns:repeat(4,minmax(0,1fr));}}
@media(max-width:1050px){.library-app .books-shell .books-grid{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media(max-width:640px){
 .library-app .books-shell .books-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
 .library-app .books-shell .books>.student-screen-head{min-height:320px;justify-content:flex-start;padding:24px;background-size:auto 175px;background-position:65% bottom;background-color:#f1ece1;}
 .library-app .books-shell .books>.student-screen-head p{max-width:100%;}
 .library-app .books-shell .book-description{padding:10px;}
 .library-app .books-shell .book-description h2{font-size:1.05rem;}
}
@media(max-width:360px){.library-app .books-shell .books-grid{grid-template-columns:1fr;}}
