.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-view-switcher { display: inline-flex; flex-wrap: wrap; gap: .25rem; max-width: 100%; margin: -.6rem 0 1.8rem; padding: .3rem; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.library-view-switcher button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; padding: .6rem .85rem; border: 0; border-radius: 8px; color: var(--ink); background: transparent; font: inherit; font-size: .85rem; font-weight: 700; line-height: 1.3; cursor: pointer; }
.library-view-switcher button:hover { background: var(--mist); }
.library-view-switcher button[aria-pressed="true"] { color: #fff; background: var(--navy); }
.library-view-switcher button:disabled { opacity: .6; cursor: default; }
.library-view-switcher svg { flex: none; }
.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; }
  .library-view-switcher { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); box-sizing: border-box; width: 100%; gap: .15rem; padding: .25rem; }
  .library-view-switcher button { min-width: 44px; padding: .5rem .45rem; font-size: .78rem; }
  .library-view-switcher svg { display: none; }
}

/* One set of documents and selections, presented at three densities. */
#download-library[data-view="small"] .library-document-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#download-library[data-view="list"] .library-document-grid { grid-template-columns: 1fr; gap: .75rem; }
#download-library[data-view="small"] .library-document,
#download-library[data-view="list"] .library-document { display: grid; align-items: start; gap: .8rem; padding: 1rem; }
#download-library[data-view="small"] .library-document { grid-template-columns: 44px 80px minmax(0, 1fr); }
#download-library[data-view="list"] .library-document { grid-template-columns: 44px 48px minmax(0, 1fr); }
#download-library[data-view="small"] .library-select,
#download-library[data-view="list"] .library-select { position: static; margin: 0; }
#download-library[data-view="small"] .document-thumbnail,
#download-library[data-view="list"] .document-thumbnail { margin: 0; padding: 0; border-radius: 6px; }
#download-library[data-view="small"] .document-thumbnail { height: 108px; }
#download-library[data-view="list"] .document-thumbnail { height: 64px; }
#download-library[data-view="small"] .library-document-body,
#download-library[data-view="list"] .library-document-body { min-width: 0; align-self: stretch; padding: 0; }
#download-library[data-view="small"] h3,
#download-library[data-view="list"] h3 { font-size: 1.1rem; }
#download-library[data-view="small"] .library-document-description { font-size: .87rem; }
#download-library[data-view="small"] .document-meta,
#download-library[data-view="list"] .document-meta { font-size: .78rem; }
#download-library[data-view="small"] .library-document-actions,
#download-library[data-view="list"] .library-document-actions { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .35rem .8rem; }
#download-library[data-view="small"] .library-document-actions .button,
#download-library[data-view="list"] .library-document-actions .button { padding: .6rem .7rem; font-size: .82rem; }
#download-library[data-view="small"] .library-document-actions .text-link,
#download-library[data-view="list"] .library-document-actions .text-link { font-size: .8rem; }
#download-library[data-view="list"] .library-document-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1.3rem; }
#download-library[data-view="list"] .eyebrow { grid-column: 1; grid-row: 1; margin: 0; font-size: .62rem; }
#download-library[data-view="list"] h3 { grid-column: 1; grid-row: 2; margin: .2rem 0 .35rem; }
#download-library[data-view="list"] .library-document-description { display: none; }
#download-library[data-view="list"] .document-meta { grid-column: 1; grid-row: 3; margin: 0; padding: 0; }
#download-library[data-view="list"] .library-document-actions { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
@media (max-width: 1050px) {
  #download-library[data-view="small"] .library-document-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  #download-library[data-view="list"] .library-document-body { grid-template-columns: minmax(0, 1fr); }
  #download-library[data-view="list"] .library-document-actions { grid-column: 1; grid-row: 4; margin-top: .4rem; }
}
@media (max-width: 600px) {
  #download-library[data-view="small"] .library-document,
  #download-library[data-view="list"] .library-document { gap: .5rem; padding: .75rem; }
  #download-library[data-view="small"] .library-document { grid-template-columns: 44px 64px minmax(0, 1fr); }
  #download-library[data-view="small"] .document-thumbnail { height: 86px; }
  #download-library[data-view="small"] h3,
  #download-library[data-view="list"] h3 { font-size: 1rem; }
  #download-library[data-view="small"] .eyebrow,
  #download-library[data-view="list"] .eyebrow { font-size: .58rem; letter-spacing: .04em; }
  #download-library[data-view="small"] .library-document-actions .button,
  #download-library[data-view="list"] .library-document-actions .button { width: 100%; padding: .6rem .4rem; font-size: .76rem; }
}
