.library-hero { padding: 3.5rem 0 2.8rem; }
.library-hero h1 { font-size: clamp(2.6rem, 5.5vw, 4.5rem); }
.library-hero .lead { max-width: 760px; }
.library-jump-links { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.8rem; }
.library-jump-links a { display: inline-flex; align-items: center; gap: 1rem; min-height: 44px; padding: .65rem 1rem; background: #fff; border: 1px solid var(--line); border-radius: 999px; color: var(--navy); font-weight: 700; text-decoration: none; }
.library-jump-links a:hover { border-color: var(--blue); }
.library-jump-links span { color: var(--muted); font-size: .8rem; }
.library-section { padding-top: 2.5rem; }
.library-section [hidden] { display: none !important; }
.library-filters { display: grid; grid-template-columns: 1.6fr 1fr 1.2fr auto; gap: 1rem; align-items: end; padding: 1.4rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); }
.library-filters label { display: block; margin-bottom: .4rem; color: var(--navy); font-size: .9rem; font-weight: 700; }
.library-filters input, .library-filters select { box-sizing: border-box; width: 100%; min-width: 0; min-height: 46px; padding: .65rem .75rem; color: var(--ink); background: #fff; border: 1px solid #a9bfc9; border-radius: 8px; font: inherit; }
.library-filters > div { min-width: 0; }
.library-text-button { min-height: 44px; padding: .5rem .2rem; border: 0; background: transparent; color: var(--blue); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.library-text-button:hover { color: var(--navy); }
.library-text-button:disabled { color: var(--muted); cursor: default; text-decoration: none; }
.library-results-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin: 1rem 0 2rem; }
.library-results-bar p { margin: 0; color: var(--muted); font-size: .92rem; }
.library-category { margin-bottom: 2.6rem; scroll-margin-top: 110px; }
.library-category-header { display: flex; align-items: center; gap: .8rem; padding-bottom: .9rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.library-category .library-category-header h2 { margin: 0; font-size: clamp(1.45rem, 3vw, 1.9rem); letter-spacing: -.02em; }
.library-category-count { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 .3rem; border-radius: 999px; color: var(--blue); background: var(--mist); font-size: .8rem; font-weight: 700; }
.library-document-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.35rem; }
.library-document.document-card { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.library-document.is-selected { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue); }
.library-document .document-thumbnail { display: flex; align-items: center; justify-content: center; width: auto; height: 255px; margin: 0; padding: 1.2rem; border: 0; border-radius: 0; background: var(--soft); }
.library-document .document-thumbnail img { display: block; width: 100%; height: 100%; max-height: none; object-fit: contain; border-radius: 0; }
.library-document-body { display: flex; flex: 1; flex-direction: column; padding: 1.3rem; }
.library-document .eyebrow { margin: 0 0 .5rem; font-size: .69rem; letter-spacing: .1em; }
.library-document h3 { margin: 0 0 .6rem; font-size: 1.3rem; line-height: 1.25; }
.library-document-description { margin: 0 0 1rem; color: var(--muted); font-size: .94rem; }
.library-document .document-meta { margin: auto 0 1rem; padding-top: .5rem; color: var(--muted); font-size: .84rem; }
.library-document-actions { display: flex; flex-direction: column; gap: .7rem; }
.library-document-actions .button { justify-content: center; min-height: 44px; padding: .7rem 1rem; font-size: .9rem; }
.library-document-actions .text-link { display: inline-flex; align-items: center; min-height: 44px; font-size: .87rem; }
.library-select { position: absolute; top: .7rem; right: .7rem; z-index: 1; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid #a9bfc9; border-radius: 10px; background: #fff; cursor: pointer; }
.library-select input { width: 22px; height: 22px; margin: 0; accent-color: var(--blue); cursor: pointer; }
.download-tray-slot { margin-top: 2rem; }
.download-tray { z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; padding: 1.15rem 1.4rem; border-radius: var(--radius); color: #fff; background: var(--navy); box-shadow: 0 10px 35px rgba(8, 47, 73, .24); }
.download-tray.is-docked { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); box-sizing: border-box; width: min(1200px, calc(100% - 32px)); }
.download-tray-summary { min-width: 0; }
.download-tray-summary strong { font-size: 1.05rem; }
.download-tray-summary p { max-width: 580px; margin: .35rem 0 0; color: #d7e9ee; font-size: .84rem; }
.download-tray-actions { display: flex; flex: none; align-items: center; gap: 1rem; }
.download-tray-actions .button { min-height: 46px; gap: .6rem; color: var(--navy); background: #fff; }
.download-tray-actions .button:hover { background: var(--mist); }
.download-tray-actions .button:disabled { color: #d7e9ee; background: #2e5268; cursor: default; }
.library-clear { min-width: 44px; min-height: 44px; padding: .5rem 0; border: 0; color: #fff; background: transparent; font: inherit; font-size: .88rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.library-clear:disabled { opacity: .55; cursor: default; }
.download-feedback { margin-top: 1.2rem; }
.library-online .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.library-document-note { margin-top: 2rem; }
.download-library-page .back-to-top { bottom: 8rem; }
.download-library-page.library-selection-active .back-to-top { display: none; }
@media (max-width: 1050px) {
  .library-filters { grid-template-columns: 1.5fr 1fr; }
  .library-filters .library-text-button { justify-self: start; }
  .library-document-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .download-tray { flex-wrap: wrap; }
  .download-tray-actions { margin-left: auto; }
}
@media (max-width: 600px) {
  .download-library-page .back-to-top { bottom: 12rem; }
  .library-hero { padding: 2.6rem 0 2rem; }
  .library-jump-links { flex-direction: column; align-items: flex-start; }
  .library-jump-links a { font-size: .84rem; }
  .library-filters { grid-template-columns: 1fr; padding: 1rem; }
  .library-document-grid, .library-online .card-grid { grid-template-columns: 1fr; }
  .library-document .document-thumbnail { height: 285px; }
  .download-tray { gap: .75rem; padding: 1rem; }
  .download-tray.is-docked { bottom: .6rem; }
  .download-tray-actions { flex-wrap: wrap; flex-direction: row-reverse; justify-content: flex-end; width: 100%; gap: .25rem 1rem; margin-left: 0; }
  .download-tray-actions .button { flex: 1; padding: .65rem .75rem; font-size: .82rem; white-space: nowrap; }
  .library-clear { font-size: .8rem; }
  .download-tray-summary strong { font-size: .95rem; }
  .download-tray-summary p { font-size: .78rem; }
}
