*{box-sizing:border-box}body{margin:0;background:#f6f7f4;color:#203c39;font:17px/1.55 system-ui,sans-serif}main{max-width:1120px;margin:auto;padding:30px 24px 70px}header{display:flex;flex-wrap:wrap;justify-content:space-between;gap:20px;align-items:center}header span,.meta{font-size:13px;letter-spacing:.03em;color:#536b66}a{color:#166956;text-underline-offset:3px}header a{font-size:24px;font-weight:750;text-decoration:none}h1{font-size:clamp(30px,5vw,48px);line-height:1.12;margin:45px 0 12px;letter-spacing:-.035em}.intro{font-size:22px;max-width:680px}form{display:flex;flex-wrap:wrap;align-items:end;gap:16px;background:white;border:1px solid #d5dfd7;border-radius:18px;padding:22px;margin:28px 0}label{display:grid;gap:7px;font-size:14px;font-weight:600}.search{flex-basis:100%}input,select,button,textarea{font:inherit;border:1px solid #b9ccc3;border-radius:8px;padding:11px;background:white;color:inherit}input{width:100%}button{cursor:pointer}button:hover{background:#e8f2eb}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #cc9b38;outline-offset:3px}#sources{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}article{background:white;border:1px solid #d5dfd7;border-radius:16px;padding:24px;display:flex;flex-direction:column}h2{font-size:22px;line-height:1.3;margin:10px 0}.tags{color:#536b66;font-size:14px}.actions{display:flex;align-items:center;gap:18px;margin-top:auto;padding-top:14px;flex-wrap:wrap}.note{margin-top:24px;padding:18px;border-top:1px solid #c8d8cd}summary{cursor:pointer;font-weight:650}dialog{max-width:650px;width:90%;border:1px solid #c8d8cd;border-radius:16px;padding:26px}dialog::backdrop{background:#142f3966}textarea{width:100%;margin-bottom:18px;resize:vertical}#count{min-height:26px}@media(max-width:640px){#sources{grid-template-columns:1fr}header span{display:none}form label{width:100%}main{padding:20px 16px}h1{margin-top:28px}}.library-extra{width:100%}.library-extra summary{font-size:14px;color:#536b66}.library-filter-grid{display:flex;align-items:end;gap:16px;flex-wrap:wrap;margin-top:18px}.library-folders{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:20px 0 28px}.library-folder{display:grid;grid-template-columns:38px minmax(0,1fr);gap:3px 12px;text-align:left;padding:20px;border-radius:14px;align-items:center;min-height:104px;transition:background .15s,border-color .15s}.library-folder:hover{border-color:#166956;background:#edf5f0}.folder-symbol{grid-row:span 2;font-size:36px;color:#166956}.library-folder strong{font-size:17px;line-height:1.3}.library-folder .tags{margin:0}.library-topics{display:flex;gap:8px;flex-wrap:wrap;margin:18px 0 28px}.library-topics button{border-radius:24px;padding:10px 16px;font-size:15px}.library-topics button[aria-pressed=true]{color:white;background:#166956;border-color:#166956}.library-back{border:0;background:transparent;padding:8px 0;color:#166956;text-decoration:underline;text-underline-offset:3px}#source-navigation{padding-bottom:10px;border-bottom:1px solid #d5dfd7;margin-bottom:20px}#source-navigation h2{font-size:24px;margin-top:18px}@media(max-width:760px){.library-folders{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:480px){.library-folders{grid-template-columns:1fr;gap:10px}.library-folder{min-height:84px;padding:14px}.library-filter-grid{display:grid;grid-template-columns:1fr;width:100%}.library-filter-grid label{min-width:0}.library-filter-grid select{width:100%;max-width:100%}}

#filters{padding:18px;margin:20px 0}.library-extra{flex:1;min-width:210px;width:auto}.library-reset{padding:6px 0;border:0;background:transparent;text-decoration:underline;text-underline-offset:3px;font-size:14px}.folder-symbol{display:block;position:relative;width:31px;height:23px;border:2px solid #166956;border-radius:3px;background:#e7f2ed;margin-top:5px}.folder-symbol:before{content:'';position:absolute;left:-2px;top:-8px;width:16px;height:8px;border:2px solid #166956;border-bottom:0;border-radius:3px 3px 0 0;background:#e7f2ed}

#filters .library-pathway { display: block; max-width: 23rem; margin-top: .9rem; }
.library-course-topic {
  grid-column: 1 / -1;
  margin: 1.25rem 0 0;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--line, #dae6e1);
}

.library-subject,
.library-bibliography { grid-column: 1 / -1; }
.library-subject {
  border: 1px solid var(--line, #dae6e1);
  border-radius: 12px;
  background: #fff;
}
.library-subject > summary { cursor: pointer; padding: .85rem 1rem; font-weight: 650; }
.library-subject-count { float: right; font-variant-numeric: tabular-nums; }
.library-subject-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 12px;
  padding: 0 12px 12px;
}
.library-bibliography li { margin: 0 0 1rem; }
.library-bibliography li p { margin: .2rem 0; }
.library-subject:not([open]) > .library-subject-cards { display: none; }

.library-results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.library-view {
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid #d5dfd7;
  border-radius: 10px;
  background: white;
}
.library-view[hidden] { display: none; }
.library-view button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 7px;
}
.library-view button[aria-pressed=true] { background: #166956; color: #fff; }
#sources[data-view=list],
#sources[data-view=list] .library-subject-cards,
#sources[data-view=list] .library-bibliography-results {
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}
.library-source-row {
  border: 1px solid #d5dfd7;
  border-radius: 8px;
  background: #fff;
}
.library-source-row > summary {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) minmax(0, 34%);
  align-items: baseline;
  gap: 8px;
  padding: .55rem .8rem;
  line-height: 1.35;
}
.library-source-row > summary::before {
  content: '';
  width: 6px;
  height: 6px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(-45deg);
}
.library-source-row[open] > summary::before { transform: rotate(45deg); }
.library-source-row > summary::-webkit-details-marker { display: none; }
.library-source-row > summary .tags { font-weight: 400; }
.library-source-row > article { border: 0; padding: .65rem 1.1rem 1.1rem; }
.library-source-row:not([open]) > article { display: none; }
.library-bibliography-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
  gap: 18px;
  margin-top: 14px;
}
@media (max-width: 550px) {
  .library-source-row > summary { grid-template-columns: 12px minmax(0, 1fr); }
  .library-source-row > summary .tags { grid-column: 2; }
}

.library-search-entry {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 7px;
}
.library-search-entry input { min-width: 0; }
.library-search-entry button {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: .4rem;
  padding: 0 .8rem;
  min-height: 44px;
  background: #166956;
  border-color: #166956;
  color: #fff;
  font-weight: 650;
}
.library-search-entry button:hover {
  background: #114f41;
  border-color: #114f41;
}
.library-results-bar { scroll-margin-top: 1rem; }
