.library-page { padding-top: 46px; padding-bottom: 72px; }
.library-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; padding-bottom: 30px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.library-heading h1 { font-size: clamp(30px,4vw,48px); margin: 8px 0 15px; line-height: 1.25; overflow-wrap: anywhere; }
.library-heading p { color: var(--muted); max-width: 760px; white-space: pre-line; overflow-wrap: anywhere; }
.library-heading>.button { flex-shrink: 0; }
.library-count { white-space: nowrap; color: var(--muted); padding-top: 22px; }.library-count strong { color: var(--forest); font-size: 32px; }
.library-search { display: flex; gap: 10px; margin-bottom: 12px; }.library-search input[type=search] { flex: 1; min-width: 0; min-height: 48px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); font: inherit; font-size: 16px; }.library-search input::placeholder { color: var(--muted); }
.library-index-page .library-heading { border: 0; padding-bottom: 24px; margin: 0; }
.library-index-page .library-heading > div { width: 100%; }
.library-title-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.library-index-page .library-title-row .library-count { display: inline; border: 0; background: transparent; padding: 0; }
.library-index-page .library-heading p:not(.eyebrow) { margin: 0; font-size: 15px; line-height: 1.85; }
.library-index-page .library-subnav { margin-bottom: 24px; }
.library-index-page .library-subnav a { min-height: 44px; }
.library-categories { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.library-categories a { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; padding: 8px 12px; color: var(--muted); border: 1px solid transparent; border-radius: 6px; font-size: 13px; }
.library-categories a:hover { color: var(--forest); border-color: var(--line); }
.library-categories a.is-active { color: var(--forest); border-color: var(--line); background: var(--surface-soft); font-weight: 700; }
.library-access-note { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 16px 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.library-access-note p { margin: 0; }.library-access-note a { flex-shrink: 0; color: var(--forest); }
.public-site .library-index-page .results-line { margin: 12px 0; }.library-index-page .results-line > a { display: inline-flex; align-items: center; min-height: 44px; }
.library-index-page .active-filters { margin-bottom: 16px; }
/* File catalog: the description leads, access and file metadata stay together. */
.library-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; border-top: 1px solid var(--line); }
.library-card { display: grid; grid-template-columns: 64px minmax(0, 1fr) 164px; align-items: start; gap: 24px; padding: 28px 0; min-width: 0; border-bottom: 1px solid var(--line); }
.library-file-mark { position: relative; display: flex; align-items: end; width: 60px; min-height: 76px; padding: 12px 8px; border: 1px solid var(--line); border-radius: 2px; background: var(--surface-soft); color: var(--forest); }
.library-file-mark::before { content: ''; position: absolute; top: -1px; right: -1px; width: 16px; height: 16px; border: 1px solid var(--line); border-top: 0; border-right: 0; background: var(--paper); }
.library-file-mark span { font-size: 11px; font-weight: 800; letter-spacing: .04em; overflow-wrap: anywhere; }
.library-card-body { min-width: 0; }
.library-card-kicker { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 8px; }
.library-card-kicker .eyebrow { margin: 0; }
.library-file-format { font-size: 12px; line-height: 1.8; color: var(--muted); }
.library-card h2 { margin: 0 0 10px; font-size: 24px; line-height: 1.4; overflow-wrap: anywhere; }
.library-card h2 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.library-description { color: var(--muted); line-height: 1.8; font-size: 15px; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.library-card-actions { display: grid; align-content: start; gap: 12px; padding-left: 20px; border-left: 1px solid var(--line); min-width: 0; }
.library-card-permission { display: grid; gap: 4px; }
.library-access { display: flex; flex-wrap: wrap; gap: 0 .35em; font-size: 13px; line-height: 1.7; color: var(--forest); }
.library-card-permission small { font-size: 12px; line-height: 1.8; color: var(--muted); }
.library-open { display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; max-width: 100%; color: var(--forest); font-size: 13px; font-weight: 700; line-height: 1.6; text-decoration: underline; text-underline-offset: 5px; overflow-wrap: anywhere; }
.library-open > span:last-child { flex-shrink: 0; }
@media(max-width:1100px) {
  .library-card { grid-template-columns: minmax(0, 1fr) 150px; gap: 20px; }
  .library-file-mark { display: none; }
}
@media(max-width:600px) {
  .library-card { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 24px 0; }
  .library-card h2 { font-size: 22px; }
  .library-card-kicker { justify-content: space-between; gap: 4px 12px; }
  .library-card-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 20px; border: 0; padding: 0; }
  .library-card-permission { gap: 0; }
}
.library-back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 16px; font-size: 14px; }
.library-lock { text-align: center; padding: 60px 20px; border: 1px solid var(--line); background: var(--white); }.library-lock>span { font-size: 44px; color: var(--forest); }.library-lock h2 { font-size: 25px; }.library-lock p { color: var(--muted); }.library-lock .button { margin-top: 16px; }
.library-admin { min-width: 0; }.library-editor { display: grid; gap: 22px; max-width: 820px; }.library-editor textarea { resize: vertical; }.library-editor input[type=file] { padding: 14px 10px; max-width: 100%; }.library-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }.library-editor small { font-weight: 400; line-height: 1.7; }
.library-levels { margin-top: 45px; padding-top: 24px; border-top: 1px solid var(--line); }.library-levels>p { color: var(--muted); }.library-levels a { text-decoration: underline; }.library-level-list { display: grid; gap: 10px; }.library-level-list form { display: flex; align-items: center; gap: 14px; }.library-level-list input { max-width: 280px; min-width: 0; }.library-level-create { display: flex; align-items: end; gap: 14px; margin-top: 22px; }.library-level-create .field { flex: 1; min-width: 0; }
[data-library-message] { overflow-wrap: anywhere; color: var(--forest); }
@media(max-width:760px) { .library-page { padding-top: 28px; }.library-heading { gap: 14px; flex-wrap: wrap; }.library-count { padding-top: 0; }.library-level-create { flex-wrap: wrap; }.library-level-create .field { flex-basis: 40%; } }
@media(max-width:520px) { .library-form-row { grid-template-columns: 1fr; }.library-level-list form { gap: 7px; }.library-level-list input { width: 48%; }.library-heading h1 { font-size: 30px; }.library-lock { padding: 35px 16px; } }

.library-document-heading { display: block; padding-bottom: 24px; margin-bottom: 24px; }
.library-document-heading > .eyebrow { margin: 0 0 12px; }
.library-document-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.library-document-title h1 { max-width: 900px; margin: 0 0 16px; font-size: clamp(30px, 3.3vw, 42px); line-height: 1.3; }
.library-document-title > .button { flex-shrink: 0; min-height: 48px; }
.library-document-heading .library-document-description { max-width: 76ch; margin: 0 0 24px; font-size: 16px; line-height: 1.85; }
.library-document-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; max-width: 850px; margin: 0; padding: 20px 0 0; border-top: 1px solid var(--line); }
.library-document-facts div { min-width: 0; }
.library-document-facts dt { color: var(--muted); font-size: 12px; line-height: 1.7; }
.library-document-facts dd { margin: 6px 0 0; color: var(--forest); font-size: 15px; font-weight: 600; line-height: 1.6; overflow-wrap: anywhere; }
.library-document-facts dd span { margin-inline-start: .35em; font-size: 12px; font-weight: 400; }
.library-document-heading .library-document-filename { display: flex; gap: 12px; margin: 16px 0 0; font-size: 12px; line-height: 1.8; }
.library-document-filename > span:first-child { flex-shrink: 0; }
.library-document-filename > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.library-document-heading .library-draft-note { margin: 12px 0 0; font-size: 13px; color: var(--danger); }
.library-detail .library-access-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 280px); align-items: center; gap: 32px; padding: 32px; border-radius: 8px; text-align: left; }
.library-access-message { min-width: 0; }
.library-access-message .eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--forest); }
.library-access-message h2 { margin: 0 0 12px; font-size: 24px; line-height: 1.4; overflow-wrap: anywhere; }
.library-access-message p:not(.eyebrow) { margin: 6px 0 0; font-size: 15px; line-height: 1.8; }
.library-access-actions { display: grid; justify-items: stretch; gap: 4px; min-width: 0; }
.library-access-panel .button { min-height: 48px; margin: 0; padding-inline: 16px; white-space: normal; line-height: 1.5; text-align: center; }
.library-access-return { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; font-size: 13px; text-decoration: underline; text-underline-offset: 4px; }
@media(max-width:760px) {
  .library-detail { padding-top: 20px; }
  .library-document-title { flex-direction: column; gap: 0; }
  .library-document-title h1 { font-size: 30px; }
  .library-document-title > .button { margin-bottom: 16px; }
  .library-document-facts { gap: 12px; padding-top: 16px; }
  .library-document-facts dd { font-size: 14px; }
  .library-detail .library-access-panel { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 24px; }
  .library-access-message h2 { font-size: 22px; }
}
