.textbooks-main { max-width: 1440px; padding: 0 44px 44px; margin: 0 auto; }
.textbooks-layout { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 22px; }
.textbooks-library { min-width: 0; padding: 5px 0; }
.textbooks-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 13px; }
.textbooks-section-heading .eyebrow { margin-bottom: 7px; }
.textbooks-section-heading h2 { margin: 0; color: var(--ink); font-size: 25px; letter-spacing: -.05em; }
.textbooks-count { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 9px; color: var(--blue); background: var(--blue-soft); font-size: 11px; font-weight: 850; }
.book-list { display: grid; gap: 8px; }
.book-card { appearance: none; display: grid; grid-template-columns: 35px minmax(0, 1fr) auto; align-items: center; width: 100%; min-height: 74px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: var(--surface); font: inherit; text-align: right; cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.book-card:hover { border-color: #b9c7ff; box-shadow: 0 9px 22px rgba(31,45,74,.07); transform: translateY(-1px); }
.book-card.is-active { border-color: #aebdff; box-shadow: 0 8px 23px rgba(49,94,251,.1); background: #fbfcff; }
.book-card-icon { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; color: #fff; background: var(--navy); font-size: 11px; font-weight: 850; }
.book-card.is-active .book-card-icon { background: var(--blue); }
.book-card-copy { min-width: 0; display: grid; gap: 4px; }
.book-card-copy strong { font-size: 12px; }
.book-card-copy small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.book-card-arrow { color: var(--blue); font-size: 17px; }
.textbooks-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 17px; padding: 12px; border: 1px solid #dfe5f2; border-radius: 12px; background: #fbfcff; }
.book-local-controls { display: grid; gap: 10px; margin-top: 17px; }
.book-local-controls .button { cursor: pointer; text-align: center; }
.book-local-controls input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.book-local-controls input[type="file"]:focus-visible + button { outline: 2px solid var(--blue); }
.book-local-controls:has(input:focus-visible) label { outline: 2px solid var(--blue); }
.book-local-controls p { color: var(--muted); font-size: 11px; line-height: 1.5; margin: 0; }
.textbooks-note > span { display: grid; place-items: center; width: 18px; height: 18px; flex: 0 0 18px; border-radius: 50%; color: var(--blue); background: var(--blue-soft); font-size: 11px; font-weight: 900; }
.textbooks-note p { color: var(--muted); font-size: 10px; line-height: 1.65; margin: 0; }
.book-reader { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: 0 4px 18px rgba(31,45,74,.035); }
.reader-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 23px 16px; border-bottom: 1px solid var(--line); }
.reader-header .eyebrow { margin-bottom: 7px; }
.reader-header h2 { margin: 0; color: var(--ink); font-size: 24px; letter-spacing: -.045em; }
.reader-location { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 8px 0 0; }
.reader-header-actions { display: grid; justify-items: end; gap: 8px; flex: 0 0 auto; }
.reader-direct-link { align-self: flex-start; margin-top: 2px; text-decoration: none; white-space: nowrap; }
.reader-section-switch { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid #dfe5f2; border-radius: 10px; background: #f7f8fc; }
.reader-section-link { display: inline-flex; align-items: center; justify-content: center; min-width: 68px; min-height: 30px; padding: 0 9px; border-radius: 7px; color: var(--muted); font-size: 10px; font-weight: 850; text-decoration: none; }
.reader-section-link:hover, .reader-section-link:focus-visible { color: var(--ink); background: #eef1f8; outline: none; }
.reader-section-link.is-active { color: #fff; background: var(--blue); box-shadow: 0 2px 6px rgba(49,94,251,.2); }
.reader-bookmark { display: flex; align-items: center; gap: 10px; margin: 14px 23px 0; padding: 10px 12px; border: 1px solid #dfe5f2; border-radius: 11px; background: #fbfcff; }
.reader-bookmark-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: var(--blue); background: var(--blue-soft); }
.reader-bookmark-icon::before { content: ""; display: block; width: 12px; height: 17px; border-radius: 2px 2px 1px 1px; background: currentColor; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 74%, 0 100%); }
.reader-bookmark div { display: grid; gap: 2px; min-width: 0; }
.reader-bookmark strong { color: var(--ink); font-size: 11px; }
.reader-bookmark > div span { color: var(--muted); font-size: 10px; }
.pdf-frame-wrap { position: relative; min-height: 760px; margin: 14px 14px 0; overflow: hidden; border: 1px solid #dfe4ed; border-radius: 10px; background: #f1f3f7; }
#book-frame { display: block; width: 100%; height: 760px; border: 0; background: #eef1f6; }
.pdf-empty { display: grid; place-items: center; align-content: center; gap: 7px; min-height: 760px; padding: 30px; color: var(--muted); text-align: center; }
.pdf-empty-icon { display: grid; place-items: center; width: 66px; height: 66px; margin-bottom: 5px; border-radius: 18px; color: #fff; background: var(--navy); font-size: 12px; font-weight: 850; letter-spacing: .1em; }
.pdf-empty strong { color: var(--ink); font-size: 15px; }
.pdf-empty p { max-width: 260px; font-size: 11px; line-height: 1.6; margin: 0; }
.pdf-reader { min-height: 760px; background: #e9edf4; }
.pdf-reader-status { position: sticky; top: 0; z-index: 2; padding: 9px 14px; color: var(--muted); background: rgba(247,249,253,.96); border-bottom: 1px solid #dfe4ed; font-size: 11px; text-align: center; }
.pdf-reader-status.is-error { color: #9f2f42; background: #fff4f5; }
.pdf-reader-pages { display: grid; gap: 14px; padding: 14px; }
.pdf-page-shell { position: relative; width: 100%; overflow: hidden; scroll-margin-top: 48px; background: #fff; box-shadow: 0 1px 5px rgba(21,34,58,.12); }
.pdf-page-shell.is-target { box-shadow: 0 0 0 3px rgba(49,94,251,.7), 0 3px 10px rgba(21,34,58,.18); }
.pdf-page-shell[data-rendered="false"], .pdf-page-shell[data-rendered="loading"] { background: linear-gradient(110deg, #eef1f6 8%, #f8f9fc 18%, #eef1f6 33%); background-size: 200% 100%; animation: pdf-page-loading 1.5s linear infinite; }
.pdf-rendered-canvas { display: block; width: 100%; height: 100%; }
.pdf-page-error { display: grid; place-items: center; height: 100%; min-height: 180px; color: #9f2f42; font-size: 11px; }
@keyframes pdf-page-loading { to { background-position-x: -200%; } }
.reader-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 23px 16px; color: #9aa4b4; font-size: 10px; }
.reader-footer a { color: var(--blue); font-weight: 800; text-decoration: none; white-space: nowrap; }
.reader-footer a:hover { text-decoration: underline; }
@media (max-width: 980px) {
  .textbooks-main { padding-left: 24px; padding-right: 24px; }
  .textbooks-layout { grid-template-columns: 260px minmax(0, 1fr); gap: 18px; }
  #book-frame, .pdf-frame-wrap, .pdf-empty { min-height: 680px; height: 680px; }
  #book-frame { height: 680px; }
}
@media (max-width: 720px) {
  .textbooks-main { padding-left: 16px; padding-right: 16px; }
  .textbooks-layout { display: block; }
  .textbooks-library { margin-bottom: 20px; }
  .book-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .book-card { display: block; min-height: 120px; padding: 12px; }
  .book-card-icon { margin-bottom: 10px; }
  .book-card-arrow { display: block; margin-top: 8px; }
  .reader-header { align-items: flex-start; flex-direction: column; padding: 18px 19px 15px; }
  .reader-header-actions { width: 100%; justify-items: stretch; }
  .reader-direct-link { align-self: stretch; width: 100%; justify-content: center; margin-top: 0; }
  .reader-section-switch { justify-self: start; }
  .reader-bookmark { margin-left: 19px; margin-right: 19px; }
  .pdf-frame-wrap { min-height: 0; height: auto; margin-left: 10px; margin-right: 10px; overflow: visible; border: 0; background: transparent; }
  #book-frame { display: none !important; }
  .pdf-reader { min-height: 0; }
  .pdf-reader-pages { gap: 10px; padding: 10px 0; }
  .reader-footer { align-items: flex-start; flex-direction: column; padding-left: 19px; padding-right: 19px; }
}
@media (max-width: 600px) {
  .book-list { grid-template-columns: 1fr; }
  .book-card { display: grid; grid-template-columns: 42px minmax(0, 1fr) 24px; align-items: center; min-height: 88px; padding: 13px 14px; }
  .book-card-icon { margin: 0; }
  .book-card-copy { padding-inline: 8px; }
  .book-card-copy strong { font-size: 14px; }
  .book-card-copy small { font-size: 11px; }
  .book-card-arrow { display: block; margin: 0; }
  .pdf-empty { min-height: 600px; height: 600px; }
}
@media (max-width: 430px) {
  .topbar { height: 66px; }
  .topbar-nav { gap: 2px; margin-inline-end: 0; }
  .topbar-link { padding-inline: 6px; font-size: 10px; }
  .book-card-copy small { display: block; }
}
