.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; }
.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: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; }
.book-reader { min-width: 0; 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-header-actions { display: grid; justify-items: end; gap: 8px; flex: 0 0 auto; }
.reader-expand-button { cursor: pointer; }
.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; overflow: visible; border: 1px solid #dfe4ed; border-radius: 10px; 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; }
.reader-native-shell { display: grid; grid-template-columns: 265px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px; }
.reader-question-nav { grid-column: 1; position: sticky; top: 12px; max-height: calc(82vh - 24px); overflow: auto; padding: 12px; border: 1px solid #d7dfec; border-radius: 10px; background: #fbfcff; }
.reader-question-nav-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid #e5eaf2; }
.reader-question-nav-heading .eyebrow { margin: 0 0 4px; font-size: 9px; }
.reader-question-nav-heading strong { color: var(--ink); font-size: 13px; }
.reader-question-toggle { min-height: 30px; padding: 0 8px; border: 1px solid #cfd8e8; border-radius: 7px; color: var(--ink); background: #fff; font: inherit; font-size: 10px; font-weight: 800; cursor: pointer; touch-action: manipulation; }
.reader-question-toggle:hover, .reader-question-toggle:focus-visible { border-color: #aabaff; background: #f5f7ff; outline: none; }
.reader-return-question { display: block; width: 100%; min-height: 36px; margin: 0 0 10px; padding: 0 9px; border: 1px solid #b8c5ff; border-radius: 7px; color: #2446b4; background: #eef2ff; font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; touch-action: manipulation; }
.reader-return-question:hover, .reader-return-question:focus-visible { background: #e3e9ff; outline: none; }
.reader-question-list { display: grid; gap: 5px; max-height: calc(82vh - 185px); overflow-y: auto; overscroll-behavior: contain; padding-inline-end: 3px; }
.reader-question-row { display: grid; gap: 3px; padding: 8px; border: 1px solid transparent; border-radius: 8px; background: #f2f5fa; }
.reader-question-row.is-current { border-color: #b8c5ff; background: #eef2ff; }
.reader-question-row strong { color: var(--ink); font-size: 11px; }
.reader-question-row small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.reader-question-actions { display: flex; gap: 5px; margin-top: 3px; }
.reader-question-actions button { min-height: 32px; padding: 0 9px; border: 1px solid #c7d1f4; border-radius: 6px; color: #2446b4; background: #fff; font: inherit; font-size: 10px; font-weight: 800; cursor: pointer; touch-action: manipulation; }
.reader-question-actions button:hover, .reader-question-actions button:focus-visible { background: #eaf0ff; outline: none; }
.reader-embed-wrap { grid-column: 2; min-width: 0; height: 82vh; min-height: 720px; overflow: hidden; border: 1px solid #cbd5e4; border-radius: 8px; background: #dfe5ee; }
#book-frame { display: block; width: 100%; height: 100%; min-height: 720px; border: 0; background: #eef1f6; }
.reader-footer { display: flex; align-items: center; justify-content: flex-end; 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; }
.reader-question-empty { color: var(--muted); font-size: 11px; line-height: 1.5; }
.textbooks-layout.reader-is-expanded { display: block; }
.reader-is-expanded .textbooks-library { display: none; }
.reader-is-expanded .book-reader { position: fixed; z-index: 50; inset: 12px; display: flex; flex-direction: column; max-width: none; border-color: #b9c6dd; box-shadow: 0 22px 70px rgba(16,26,43,.28); }
.reader-is-expanded .reader-header { flex: 0 0 auto; }
.reader-is-expanded .pdf-frame-wrap { flex: 1 1 auto; min-height: 0; margin-bottom: 0; }
.reader-is-expanded .reader-native-shell { height: 100%; min-height: 0; }
.reader-is-expanded .reader-embed-wrap { height: 100%; min-height: 0; }
.reader-is-expanded #book-frame { height: 100%; min-height: 0; }
.reader-is-expanded .reader-footer { flex: 0 0 auto; }
body.reader-expanded-active { overflow: hidden; }
@media (max-width: 980px) {
  .textbooks-main { padding-left: 24px; padding-right: 24px; }
  .textbooks-layout { grid-template-columns: 260px minmax(0, 1fr); gap: 18px; }
  .reader-native-shell { grid-template-columns: 230px minmax(0, 1fr); gap: 9px; }
  .reader-question-nav { padding: 9px; }
  .reader-embed-wrap, #book-frame { min-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-expand-button { width: 100%; justify-content: center; }
  .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; margin-left: 10px; margin-right: 10px; border: 0; background: transparent; }
  .reader-native-shell { display: flex; flex-direction: column; gap: 10px; padding: 0; }
  .reader-question-nav { position: static; align-self: stretch; order: 0; box-sizing: border-box; width: 100%; max-height: 294px; padding: 12px; border-radius: 14px; box-shadow: 0 5px 16px rgba(31,45,74,.06); }
  .reader-question-nav-heading { min-height: 34px; padding-bottom: 9px; }
  .reader-question-nav-heading strong { font-size: 14px; }
  .reader-question-toggle { min-height: 34px; padding-inline: 12px; }
  .reader-question-filter { height: 38px; margin: 9px 0; border-radius: 9px; font-size: 13px; }
  .reader-question-row { padding: 9px; border-radius: 10px; }
  .reader-question-row strong { font-size: 12px; }
  .reader-question-actions { gap: 7px; }
  .reader-question-actions button { flex: 1; min-height: 36px; border-radius: 8px; font-size: 11px; }
  .reader-question-list { max-height: 180px; }
  .reader-embed-wrap { order: 1; width: 100%; height: 78vh; min-height: 560px; border-radius: 8px; }
  #book-frame { min-height: 560px; }
  .reader-footer { align-items: flex-start; flex-direction: column; padding-left: 19px; padding-right: 19px; }
  .reader-is-expanded .book-reader { inset: 0; border-radius: 0; }
  .reader-is-expanded .reader-question-nav { max-height: 250px; }
}
@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; }
}
@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; }
}
