.library-body { min-width: 320px; background: #f3f5ef; }
.library-header { position: sticky; z-index: 20; top: 0; width: 100%; max-width: none; height: 62px; padding: 0 max(22px, calc((100vw - 1180px) / 2)); background: rgba(249, 250, 246, .96); border-bottom: 1px solid #e2e7dd; backdrop-filter: blur(12px); }
.library-header .site-nav { gap: 20px; font-size: 12px; }
.library-main { width: min(1180px, 100%); max-width: 1180px; margin: 0 auto; padding: 27px 25px 50px; }
.library-main .breadcrumbs { margin-bottom: 19px; }
.library-hero { padding-bottom: 22px; border-bottom: 1px solid #dfe5db; }
.library-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, .68fr); gap: 26px; align-items: end; }
.library-eyebrow { margin: 0 0 7px; color: #54745d; font-size: 9px; font-weight: 850; letter-spacing: .16em; }
.library-hero h1 { margin: 0; color: #203c31; font-family: ui-sans-serif, system-ui, sans-serif; font-size: clamp(31px, 4.6vw, 52px); font-weight: 790; letter-spacing: -.05em; line-height: 1.04; }
.library-hero h1 span { color: #52765b; }
.library-lede { max-width: 760px; margin: 13px 0 0; color: #607269; font-size: 13px; line-height: 1.7; }
.library-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 12px; border: 1px solid #dfe6db; border-radius: 13px; background: #fbfcf8; }
.library-summary > div { display: grid; gap: 4px; min-height: 54px; align-content: center; padding: 5px 8px; border-right: 1px solid #e4e9e0; }
.library-summary > div:last-child { border-right: 0; }
.library-summary strong { color: #284b36; font-size: 18px; letter-spacing: -.03em; }
.library-summary span { color: #738178; font-size: 8px; line-height: 1.35; }
.library-search-row { max-width: 790px; margin-top: 21px; }
.library-search-row > label { display: block; margin-bottom: 7px; color: #3b5548; font-size: 11px; font-weight: 750; }
.library-search-control { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px; border: 1px solid #d4ddd1; border-radius: 11px; background: #fff; box-shadow: 0 3px 12px rgba(33, 59, 52, .035); }
.library-search-control:focus-within { border-color: #75947b; box-shadow: 0 0 0 3px rgba(83, 121, 97, .13); }
.library-search-control > span { color: #587a62; font-size: 22px; line-height: 1; }
.library-search-control input { min-width: 0; min-height: 44px; padding: 0; border: 0; border-radius: 0; outline: 0; box-shadow: none; background: transparent; font-size: 13px; }
.library-search-control input:focus { border: 0; box-shadow: none; }
.library-search-control button { flex: 0 0 auto; border: 0; padding: 6px 8px; color: #4b6d55; background: #edf3eb; border-radius: 7px; font-size: 10px; font-weight: 700; }
.library-search-control button[hidden] { display: none; }
#library-status { margin: 7px 1px 0; color: #78867c; font-size: 10px; line-height: 1.45; }
.library-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.library-filter { min-height: 32px; padding: 6px 10px; border: 1px solid #dce5da; border-radius: 999px; color: #52695b; background: #fbfcf8; font-size: 10px; font-weight: 720; }
.library-filter:hover, .library-filter:focus-visible { border-color: #9ab09a; color: #264d37; background: #edf3eb; }
.library-filter[aria-pressed="true"] { border-color: #355d43; color: #fff; background: #31583e; }
.library-control-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0 25px; }
.library-shortcut { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 11px; border: 1px solid #e1e7dc; border-radius: 12px; color: #2c4b38; background: #fffefa; text-decoration: none; }
.library-shortcut:hover { border-color: #a8bda8; background: #fbfcf8; }
.shortcut-mark { flex: 0 0 37px; display: grid; width: 37px; height: 37px; place-items: center; border: 1px solid #dfe7dc; border-radius: 11px 11px 11px 4px; color: #46674c; background: #edf3e9; font-family: Georgia, serif; font-size: 18px; font-weight: 700; }
.library-shortcut-gems .shortcut-mark { color: #615182; background: #f0ecf7; border-color: #e5def0; }
.library-shortcut > span:nth-child(2) { display: grid; gap: 4px; min-width: 0; }
.library-shortcut strong { font-size: 11px; }
.library-shortcut small { color: #718075; font-size: 8px; line-height: 1.45; }
.shortcut-arrow { margin-left: auto; color: #68816d; font-size: 14px; }
.library-results { scroll-margin-top: 78px; }
.library-results-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.library-results-heading .library-eyebrow { margin-bottom: 4px; }
.library-results-heading h2, .library-evidence h2 { margin: 0; color: #203c31; font-family: ui-sans-serif, system-ui, sans-serif; font-size: 22px; font-weight: 780; letter-spacing: -.025em; }
.library-results-heading p:not(.library-eyebrow) { margin: 6px 0 0; color: #758177; font-size: 10px; line-height: 1.45; }
.library-visible-count { color: #748178; font-size: 10px; font-weight: 700; white-space: nowrap; }
.library-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; align-items: stretch; }
.library-card { min-width: 0; overflow: hidden; display: flex; flex-direction: column; border: 1px solid #e1e6dd; border-radius: 13px; background: #fffefa; box-shadow: 0 2px 7px rgba(33, 59, 52, .03); }
.library-card-visual { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1.14 / 1; overflow: hidden; padding: 14px; border-bottom: 1px solid #edf0e8; background: radial-gradient(ellipse at 50% 45%, #fbfcf8, #edf1e9); }
.library-card-visual img { display: block; width: 100%; height: 100%; object-fit: contain; }
.library-card-visual.is-card img { object-fit: contain; }
.library-visual-placeholder { display: grid; width: 100%; height: 100%; place-items: center; align-content: center; gap: 9px; padding: 15px; border: 1px dashed #cbbd9f; border-radius: 11px; color: #735f43; background: radial-gradient(ellipse at center, #fcf8ef, #f5f0e4); text-align: center; }
.library-visual-placeholder strong { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 16px 16px 16px 5px; color: #6e6047; background: #e9dfca; font-family: Georgia, serif; font-size: 19px; }
.library-visual-placeholder span { max-width: 140px; font-size: 9px; font-weight: 750; line-height: 1.45; }
.library-image-status { position: absolute; right: 8px; bottom: 8px; padding: 4px 6px; border: 1px solid rgba(255,255,255,.8); border-radius: 999px; color: #506652; background: rgba(255,255,255,.92); font-size: 7px; font-weight: 800; }
.library-card-content { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 7px; padding: 11px 12px 12px; }
.library-card-kicker { color: #64806a; font-size: 8px; line-height: 1.35; letter-spacing: .08em; font-weight: 850; text-transform: uppercase; }
.library-card h3 { margin: 0; color: #1c4230; font-size: 14px; line-height: 1.28; font-weight: 780; overflow-wrap: anywhere; }
.library-card-subtitle { color: #78867c; font-size: 9px; line-height: 1.4; }
.library-card-effect { margin: 0; color: #41584b; font-size: 10px; line-height: 1.55; }
.library-card-effect strong { display: block; margin-bottom: 3px; color: #355c40; font-size: 8px; letter-spacing: .06em; text-transform: uppercase; }
.library-card-effect.is-unknown { padding: 7px 8px; border-left: 2px solid #d2b67e; border-radius: 0 7px 7px 0; color: #785f3c; background: #fbf6eb; font-style: italic; }
.library-card-progression { margin: 0; color: #66776b; font-size: 9px; line-height: 1.5; }
.library-card-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.library-tag { display: inline-flex; padding: 4px 6px; border-radius: 999px; color: #4f6d55; background: #edf3e9; font-size: 7px; line-height: 1.2; font-weight: 800; }
.library-tag-warning { color: #765c36; background: #f8f0e0; }
.library-card-source { display: block; margin-top: auto; padding-top: 5px; color: #3f6d4a; font-size: 9px; line-height: 1.45; font-weight: 750; text-decoration: none; overflow-wrap: anywhere; }
.library-card-source:hover { text-decoration: underline; text-underline-offset: 3px; }
.library-empty { margin: 8px 0 0; padding: 19px; border: 1px dashed #cbd9c9; border-radius: 11px; color: #5b6c60; background: #fbfcf8; font-size: 12px; }
.library-evidence { margin-top: 35px; padding: 21px; border: 1px solid #e6e1d2; border-radius: 14px; background: #fbf8f0; }
.library-evidence h2 { color: #564a35; font-size: 17px; }
.evidence-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 13px; }
.evidence-grid p { margin: 0; padding: 11px; border: 1px solid #ece4d3; border-radius: 9px; color: #74664e; background: rgba(255,255,255,.58); font-size: 10px; line-height: 1.55; }
.evidence-grid strong { color: #55472f; }
.library-source-note { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid #ebe3d2; color: #7b6f59; font-size: 9px; line-height: 1.6; }
.library-source-note a { color: #426b49; }
.library-main .kb-bottom-nav { margin-top: 25px; }
.library-body .site-footer { max-width: 1180px; }
.library-card[hidden], .library-filter[hidden] { display: none !important; }
@media (max-width: 1050px) { .library-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 780px) {
  .library-header { position: static; height: auto; min-height: 62px; padding: 12px 18px; }
  .library-header .site-nav { width: 100%; justify-content: space-between; flex-wrap: wrap; gap: 9px 14px; padding-top: 9px; border-top: 1px solid rgba(33,59,52,.08); }
  .library-main { padding: 24px 18px 42px; }
  .library-hero-grid { grid-template-columns: 1fr; gap: 14px; }
  .library-summary { max-width: 550px; }
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
}
@media (max-width: 560px) {
  .library-main { padding: 20px 13px 35px; }
  .library-hero h1 { font-size: 34px; }
  .library-lede { font-size: 12px; }
  .library-control-strip { grid-template-columns: 1fr; gap: 7px; }
  .library-shortcut { padding: 9px 10px; }
  .library-results-heading { align-items: flex-start; }
  .library-results-heading h2 { font-size: 19px; }
  .library-grid { grid-template-columns: 1fr; gap: 10px; }
  .library-card { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: stretch; }
  .library-card-visual { height: 100%; min-height: 126px; aspect-ratio: auto; padding: 9px; border-right: 1px solid #edf0e8; border-bottom: 0; }
  .library-visual-placeholder { gap: 6px; padding: 8px; }
  .library-visual-placeholder strong { width: 38px; height: 38px; font-size: 16px; }
  .library-visual-placeholder span { font-size: 7px; }
  .library-image-status { right: 4px; bottom: 4px; padding: 3px 4px; font-size: 6px; }
  .library-card-content { padding: 9px 10px; }
  .library-card h3 { font-size: 13px; }
  .library-card-effect { font-size: 9px; }
  .evidence-grid { grid-template-columns: 1fr; }
  .library-evidence { padding: 15px; }
}
@media (prefers-reduced-motion: reduce) { .library-body *, .library-body *::before, .library-body *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }


/* Image-led library directory and dedicated category pages */
.library-callout { margin: 14px 0 0; padding: 11px 13px; border-left: 3px solid #8ba77c; border-radius: 0 9px 9px 0; color: #586b5d; background: #e9f0e5; font-size: 10px; line-height: 1.55; }
.library-directory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; align-items: stretch; }
.directory-card { display: flex; min-width: 0; flex-direction: column; overflow: hidden; border: 1px solid #dfe6dc; border-radius: 14px; color: inherit; background: #fffefa; box-shadow: 0 3px 10px rgba(33, 59, 52, .035); text-decoration: none; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.directory-card:hover, .directory-card:focus-visible { transform: translateY(-2px); border-color: #9cb49d; box-shadow: 0 9px 22px rgba(33, 59, 52, .09); outline: none; }
.directory-card[hidden] { display: none !important; }
.directory-card-visual { position: relative; display: grid; min-height: 168px; aspect-ratio: 1.65 / 1; place-items: center; overflow: hidden; padding: 15px; border-bottom: 1px solid #edf0e8; background: radial-gradient(ellipse at 50% 45%, #fff, #e8eee5); }
.directory-card-visual img { display: block; width: 100%; height: 100%; object-fit: contain; }
.directory-card-placeholder { display: grid; width: 56px; height: 56px; place-items: center; border-radius: 18px 18px 18px 6px; color: #47624d; background: #dce8d9; font-family: Georgia, serif; font-size: 21px; font-weight: 800; }
.directory-image-label { position: absolute; right: 8px; bottom: 8px; padding: 5px 8px; border: 1px solid rgba(255,255,255,.8); border-radius: 999px; color: #36533e; background: rgba(255,255,255,.92); font-size: 8px; font-weight: 800; }
.directory-card-content { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 7px; padding: 13px 14px 14px; }
.directory-card-content h3 { margin: 0; color: #1f4230; font-size: 16px; line-height: 1.25; }
.directory-card-summary, .directory-card-note { margin: 0; color: #5d7162; font-size: 10px; line-height: 1.55; }
.directory-card-note { padding-top: 7px; border-top: 1px solid #edf0e8; color: #7a684b; font-size: 9px; }
.directory-card-open { margin-top: auto; padding-top: 5px; color: #3f6d4a; font-size: 9px; font-weight: 850; }
.library-overview { margin: 24px 0 28px; padding: 17px; border: 1px solid #e2e8dd; border-radius: 14px; background: #fafcf8; }
.library-overview-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 11px; }
.library-overview-card { display: flex; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid #e6ece2; border-radius: 9px; background: #fff; }
.library-overview-card p { margin: 0; color: #53685a; font-size: 10px; line-height: 1.55; }
.library-overview-index { flex: 0 0 auto; display: grid; width: 24px; height: 24px; place-items: center; border-radius: 8px 8px 8px 3px; color: #4b6b50; background: #edf3e9; font-size: 8px; font-weight: 850; }
.library-data-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 10px; }
.library-data-panel { min-width: 0; overflow: hidden; padding: 12px; border: 1px solid #e3e9e0; border-radius: 10px; background: #fff; }
.library-data-panel h3, .library-data-panel > summary { margin: 0 0 9px; color: #31523b; font-size: 11px; line-height: 1.4; font-weight: 800; }
.library-data-panel.is-collapsible > summary { cursor: pointer; }
.library-data-panel.is-collapsible[open] > summary { margin-bottom: 8px; }
.library-data-note { margin: 0 0 8px; color: #786445; font-size: 9px; line-height: 1.45; }
.library-table-wrap { width: 100%; overflow-x: auto; border: 1px solid #edf0e8; border-radius: 8px; scrollbar-color: #bacbb7 transparent; }
.library-table-wrap table { width: 100%; border-collapse: collapse; color: #4a5f50; font-size: 9px; line-height: 1.4; }
.library-table-wrap th, .library-table-wrap td { min-width: 65px; padding: 7px 8px; border-bottom: 1px solid #edf0e8; text-align: left; vertical-align: top; }
.library-table-wrap th { color: #48634d; background: #f2f6ef; font-size: 8px; font-weight: 850; white-space: nowrap; }
.library-table-wrap tr:last-child td { border-bottom: 0; }
.library-table-wrap td.is-unknown { color: #8a704c; font-style: italic; background: #fcf8ef; }
.library-detail-body .library-card-content { gap: 7px; }
.library-card-details { width: 100%; margin-top: 2px; border-top: 1px solid #edf0e8; color: #56695b; font-size: 9px; line-height: 1.5; }
.library-card-details > summary { padding: 8px 0 2px; color: #41634a; cursor: pointer; font-size: 9px; font-weight: 850; }
.library-detail-list { display: grid; grid-template-columns: 1fr; gap: 3px; margin: 7px 0 0; }
.library-detail-list dt { color: #3e5d45; font-size: 8px; font-weight: 850; }
.library-detail-list dd { margin: 0 0 7px; color: #576b5c; overflow-wrap: anywhere; }
.library-detail-heading { margin: 9px 0 5px; color: #355940; font-size: 9px; }
.library-level-list { margin: 5px 0 0; padding-left: 17px; color: #56695b; }
.library-level-list li { padding: 2px 0; }
.library-skill-variant { margin: 8px 0 0; padding: 8px; border: 1px solid #e5ebe2; border-radius: 8px; background: #fbfcf9; }
.library-skill-level { margin-top: 7px; }
.library-skill-level h5 { margin: 0 0 4px; color: #4e6c53; font-size: 8px; }
.library-skill-entry { margin: 4px 0; padding: 7px; border-radius: 6px; color: #53675a; background: #f2f6ef; overflow-wrap: anywhere; }
.library-skill-entry strong { display: block; margin-bottom: 2px; color: #416048; font-size: 8px; }
.library-skill-entry.is-specialization { border-left: 2px solid #a991c2; background: #f6f2fa; }
.library-skill-entry.is-specialization strong { color: #665078; }
.library-tier-controls { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0 2px; }
.library-tier-button { min-height: 27px; padding: 4px 7px; border: 1px solid #dfe7dc; border-radius: 999px; color: #52695b; background: #f8faf6; font-size: 8px; font-weight: 800; }
.library-tier-button:hover, .library-tier-button:focus-visible { border-color: #92aa93; outline: none; }
.library-tier-button[aria-pressed="true"] { border-color: #456d4c; color: #fff; background: #456d4c; }
.library-tier-effect { margin: 0; padding: 8px; border-left: 2px solid #83a078; border-radius: 0 7px 7px 0; color: #425b49; background: #f3f7f0; font-size: 9px; line-height: 1.5; overflow-wrap: anywhere; }
.library-tier-effect strong { display: block; margin-bottom: 3px; color: #355c40; font-size: 8px; letter-spacing: .05em; text-transform: uppercase; }
.library-detail-body .library-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.library-detail-body .library-card-visual { aspect-ratio: 1.15 / 1; }
.library-detail-body .library-card-visual.is-card { aspect-ratio: 1.25 / 1.1; }
.library-detail-body .library-card-effect { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; }
.library-detail-body .library-tier-effect { display: block; }
.library-detail-body .library-card-source { margin-top: auto; }
@media (max-width: 1050px) {
  .library-directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-detail-body .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  .library-directory-grid { gap: 9px; }
  .directory-card-visual { min-height: 135px; }
  .library-overview { padding: 13px; }
  .library-data-panels { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .library-directory-grid { grid-template-columns: 1fr; gap: 9px; }
  .directory-card { display: grid; grid-template-columns: 108px minmax(0, 1fr); align-items: stretch; }
  .directory-card-visual { min-height: 124px; height: 100%; aspect-ratio: auto; padding: 8px; border-right: 1px solid #edf0e8; border-bottom: 0; }
  .directory-card-content { padding: 9px 10px; gap: 5px; }
  .directory-card-content h3 { font-size: 13px; }
  .directory-card-summary { font-size: 9px; }
  .directory-card-note { font-size: 8px; }
  .library-detail-body .library-grid { grid-template-columns: 1fr; }
  .library-overview-cards { grid-template-columns: 1fr; }
  .library-overview-card { padding: 8px; }
  .library-data-panel { padding: 9px; }
  .library-detail-body .library-card { display: grid; grid-template-columns: 102px minmax(0, 1fr); }
  .library-detail-body .library-card-visual, .library-detail-body .library-card-visual.is-card { min-height: 135px; height: 100%; aspect-ratio: auto; padding: 8px; border-right: 1px solid #edf0e8; border-bottom: 0; }
  .library-detail-body .library-card-content { min-width: 0; padding: 8px; }
  .library-detail-body .library-card-effect { font-size: 8px; -webkit-line-clamp: 4; }
  .library-detail-body .library-tier-effect { font-size: 8px; -webkit-line-clamp: unset; }
  .library-detail-body .library-card-source { font-size: 8px; }
}

/* Chapter Skills reference renders its icons at 48 × 48 CSS pixels. Keep
   these small textures compact; do not enlarge them into full-card artwork. */
.library-detail-body[data-library="skills"] .library-card { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: start; }
.library-detail-body[data-library="skills"] .library-card-visual { width: 76px; height: 80px; min-height: 0; aspect-ratio: auto; padding: 14px; border: 0; background: transparent; }
.library-detail-body[data-library="skills"] .library-card-visual img { width: 48px; height: 48px; max-width: 48px; max-height: 48px; object-fit: contain; }
.library-detail-body[data-library="skills"] .library-image-status { display: none; }
.library-detail-body[data-library="skills"] .library-card-content { min-width: 0; padding: 12px 12px 12px 0; }
.library-detail-body[data-library="skills"] .library-visual-placeholder { width: 48px; height: 48px; padding: 0; }
.library-detail-body[data-library="skills"] .library-visual-placeholder strong { width: 42px; height: 42px; }
.library-detail-body[data-library="skills"] .library-visual-placeholder span { display: none; }
.directory-card[data-library="skills"] .directory-card-visual img { width: 48px; height: 48px; object-fit: contain; }
.library-permalink { color: #496c51; font-size: 10px; font-weight: 700; text-underline-offset: 3px; }
.library-card:target { outline: 2px solid #729779; outline-offset: 3px; scroll-margin-top: 82px; }
@media (max-width: 560px) {
  .library-detail-body[data-library="skills"] .library-card { grid-template-columns: 70px minmax(0, 1fr); }
  .library-detail-body[data-library="skills"] .library-card-visual { width: 70px; height: 74px; padding: 11px; }
  .library-detail-body[data-library="skills"] .library-card-content { padding: 10px 10px 10px 0; }
}

.library-detail-body[data-library="skills"] .library-grid { align-items: start; }
