/* Learning Library */
.library-header { display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:space-between; gap:20px; margin:15px 0 32px; }
.library-search-wrap { position:relative; min-width:280px; }
.library-search-wrap input { width:100%; padding:12px 42px 12px 16px; border:1.5px solid var(--line); border-radius:10px; background:var(--white); font-family:var(--sans); font-size:14px; }
.library-search-wrap input:focus { outline:0; border-color:var(--green); box-shadow:0 0 0 3px var(--green-soft); }
.library-search-wrap svg, .library-search-wrap .search-icon { position:absolute; top:50%; right:14px; transform:translateY(-50%); color:var(--charcoal); opacity:.6; pointer-events:none; }
.library-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:24px; margin-bottom:40px; }
.book-card { display:flex; flex-direction:column; overflow:hidden; border:1px solid var(--line); border-radius:16px; background:var(--white); transition:transform .2s ease, box-shadow .2s ease; }
.book-card:hover { transform:translateY(-4px); box-shadow:0 12px 24px rgb(14 59 46 / 8%); }
.book-thumb { position:relative; aspect-ratio:3 / 4; overflow:hidden; background:var(--cream2); }
.book-thumb img { width:100%; height:100%; object-fit:cover; }
.book-badge { position:absolute; top:12px; left:12px; padding:4px 10px; border-radius:100px; background:var(--gold); color:var(--white); font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; }
.book-content { display:flex; flex-grow:1; flex-direction:column; padding:20px; }
.book-content h4 { margin-bottom:4px; color:var(--black); font-family:var(--serif); font-size:18px; }
.book-content .sub-title { margin-bottom:7px; color:#7a847e; font-size:13px; }
.book-content .btn { width:100%; margin-top:auto; justify-content:center; }

/* PDF reader: one authoritative toolbar definition. */
.sqa-pdf-modal-overlay.hidden { display:none !important; }
.sqa-pdf-modal-overlay {
  position:fixed !important;
  inset:0 !important;
  z-index:99999 !important;
  display:flex;
  width:100vw;
  height:100dvh;
  align-items:stretch;
  justify-content:stretch;
  padding:0;
  background:rgb(8 20 16 / 88%);
}
.sqa-pdf-modal-overlay.is-active { display:flex !important; }
.sqa-pdf-wrapper { --reader-green:var(--green, #0e3b2e); --reader-green-2:var(--green2, #175c46); --reader-gold:var(--gold, #b7924f); position:relative; display:flex !important; flex-direction:column !important; width:100%; max-width:none; height:100dvh; min-height:0; border:0; border-radius:0; overflow:hidden; background:var(--reader-green); }
.sqa-pdf-toolbar { display:flex; flex:0 0 auto; width:100%; align-items:center; justify-content:space-between; min-height:68px; gap:14px; padding:12px 18px; overflow-x:auto; overflow-y:hidden; border-bottom:1px solid rgb(255 255 255 / 15%); background:var(--reader-green); color:var(--white, #fff); scrollbar-width:thin; }
.sqa-reader-identity { display:flex; flex:0 0 auto; align-items:center; min-width:210px; gap:12px; }
.sqa-reader-book-icon { display:inline-flex; flex:0 0 40px; align-items:center; justify-content:center; width:40px; height:40px; border:2px solid var(--reader-gold); border-radius:50%; color:var(--reader-gold); font-size:16px; }
.sqa-reader-book-copy h3 { max-width:260px; margin:0; overflow:hidden; color:var(--white, #fff); font-family:var(--serif); font-size:17px; line-height:1.2; text-overflow:ellipsis; white-space:nowrap; }
.sqa-reader-book-copy p { display:none; }
.sqa-pdf-toolbar .controls-btn { display:flex; flex:0 0 auto; align-items:center; flex-wrap:nowrap; gap:7px; white-space:nowrap; }
.sqa-pdf-toolbar .sqa-reader-control, .sqa-pdf-toolbar .sqa-action-tile { display:inline-flex; flex:0 0 auto; box-sizing:border-box; height:42px; min-height:42px; align-items:center; justify-content:center; border:1px solid rgb(255 255 255 / 20%); border-radius:9px; background:var(--reader-green-2); color:var(--white, #fff); }
.sqa-pdf-toolbar .sqa-reader-control { gap:5px; padding:4px 6px; }
.sqa-pdf-toolbar .sqa-control-label { margin-left:3px; color:var(--white, #fff); font-size:13px; font-weight:700; }
.sqa-pdf-toolbar .sqa-page-control-row, .sqa-pdf-toolbar .sqa-control-row { display:inline-flex; flex:1 1 auto; align-items:center; justify-content:flex-end; gap:4px; }
.sqa-pdf-toolbar .page-nev { width:194px; padding-right:7px; }
.sqa-pdf-toolbar .page-search-control { width:184px; }
.sqa-pdf-toolbar .page-load-control { width:205px; }
.sqa-pdf-toolbar .sqa-page-counter { display:inline-flex; align-items:center; gap:4px; color:rgb(255 255 255 / 82%); font-size:12px; }
.sqa-pdf-toolbar input, .sqa-pdf-toolbar select { box-sizing:border-box; height:32px; border:1px solid rgb(14 59 46 / 35%); border-radius:7px; outline:0; background:var(--white, #fff); color:var(--reader-green); font-family:var(--sans); font-size:12px; font-weight:700; }
.sqa-pdf-toolbar input:focus, .sqa-pdf-toolbar select:focus { border-color:var(--reader-gold); box-shadow:0 0 0 2px rgb(183 146 79 / 35%); }
.sqa-pdf-toolbar input::-webkit-inner-spin-button, .sqa-pdf-toolbar input::-webkit-outer-spin-button { margin:0; -webkit-appearance:none; }
.sqa-pdf-toolbar #sqa-pdf-page-num { width:40px; padding:2px; text-align:center; }
.sqa-pdf-toolbar #sqa-pdf-page-search { width:58px; padding:2px 7px; }
.sqa-pdf-toolbar #sqa-pdf-load-count { width:82px; padding:2px 6px; }
.sqa-pdf-toolbar button { display:inline-flex; flex:0 0 32px; box-sizing:border-box; width:32px; height:32px; align-items:center; justify-content:center; padding:0; border:0; border-radius:7px; background:transparent; color:var(--white, #fff); cursor:pointer; line-height:1; }
.sqa-pdf-toolbar button:hover, .sqa-pdf-toolbar .sqa-action-tile:hover { background:rgb(255 255 255 / 14%); color:var(--white, #fff); }
.sqa-pdf-toolbar .zoom-btn { width:76px; gap:2px; }
.sqa-pdf-toolbar .zoom-btn span, .sqa-pdf-toolbar .sqa-action-tile span { display:none; }
.sqa-pdf-toolbar .sqa-action-tile { width:42px; padding:0; text-decoration:none; }
.sqa-pdf-toolbar #sqa-pdf-download-btn { color:var(--reader-gold); }
.sqa-pdf-toolbar #sqa-pdf-close:hover { border-color:#ef4444; background:#b91c1c; }
.sqa-pdf-viewport { display:flex; flex:1 1 auto; width:100%; min-height:0; align-items:flex-start; justify-content:center; overflow:auto; padding:20px; background:#17211d; }
.sqa-pdf-viewport #sqa-pdf-canvas { display:block; max-width:100%; height:auto; margin:0 auto; }
#sqa-pdf-loader { position:absolute; inset:0; z-index:10; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; background:rgb(23 33 29 / 92%); color:var(--reader-gold); text-align:center; }
#sqa-pdf-loader i { font-size:36px; }
#sqa-pdf-loader p { margin:0; color:var(--white, #fff); font-size:13px; font-weight:600; }
#sqa-pdf-loader.hidden { display:none !important; }

@media (max-width:1279px) {
  .sqa-pdf-toolbar { gap:10px; padding:10px 14px; }
  .sqa-reader-identity { min-width:180px; }
  .sqa-reader-book-copy h3 { max-width:190px; }
  .sqa-pdf-toolbar .controls-btn { max-width:calc(100vw - 260px); overflow-x:auto; padding-bottom:2px; }
}

@media (max-width:900px) {
  .library-header { flex-direction:column; align-items:stretch; }
  .library-search-wrap { min-width:0; }
  .sqa-pdf-modal-overlay { padding:0; }
  .sqa-pdf-wrapper { height:100vh; border-radius:0; }
  .sqa-pdf-toolbar { align-items:flex-start; flex-direction:column; gap:10px; padding:10px; }
  .sqa-pdf-viewport { padding:10px; }
  .sqa-reader-identity { min-width:0; }
  .sqa-reader-book-copy h3 { max-width:calc(100vw - 92px); }
  .sqa-pdf-toolbar .controls-btn { width:100%; overflow-x:auto; padding-bottom:3px; }
  .sqa-pdf-toolbar .page-search-control, .sqa-pdf-toolbar .page-load-control { display:none; }
}

@media (max-width:560px) {
  .sqa-pdf-toolbar { min-height:0; gap:8px; padding:8px; }
  .sqa-reader-book-icon { flex-basis:36px; width:36px; height:36px; font-size:14px; }
  .sqa-reader-book-copy h3 { max-width:calc(100vw - 80px); font-size:15px; }
  .sqa-pdf-toolbar .controls-btn { gap:5px; }
  .sqa-pdf-toolbar .page-nev { width:184px; }
  .sqa-pdf-toolbar .zoom-btn, .sqa-pdf-toolbar #sqa-pdf-download-btn { display:none; }
  .sqa-pdf-toolbar .sqa-action-tile { width:40px; min-height:40px; height:40px; }
  .sqa-pdf-viewport { padding:6px; }
}
