body.library-overview,
body.library-reading {
  background:
    radial-gradient(ellipse at 95% 8%, #dce9cfb0, transparent 34%),
    radial-gradient(ellipse at 0% 37%, #dae8ddbd, transparent 38%),
    radial-gradient(ellipse at 78% 76%, #eee9d3a6, transparent 35%),
    linear-gradient(145deg, #f7f9f3, #edf3e9 42%, #f6f7ee 78%, #eff4ec);
  background-attachment: fixed;
}

.library-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(24px, 5vw, 56px);
  padding: clamp(20px, 4vw, 40px);
  margin: 16px 0 26px;
  border: 1px solid #cddcc5;
  border-radius: 22px;
  background: #ffffffa8;
}
.library-hero h1,
.library-hero h3 { margin: 0; }
.library-hero p { line-height: 1.85; }
body.library-overview img.library-hero-image {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 14px;
  margin: 0;
  cursor: auto;
}
body.library-overview .library-hero-compact .library-hero-image {
  aspect-ratio: 2 / 1;
}

.library-list {
  display: grid;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 18px 0 32px;
}
.library-list > li { margin: 0; padding: 0; }
body.library-overview a.library-row {
  display: grid;
  grid-template-columns: 144px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 12px 20px 12px 12px;
  border: 1px solid #cddcc5;
  border-radius: 17px;
  background: #ffffffa8;
  color: var(--aoi-ink);
  text-decoration: none;
  transition: background-color .2s, border-color .2s;
}
body.library-overview a.library-row:hover,
body.library-overview a.library-row:focus-visible {
  background: #fff;
  border-color: #8da883;
}
body.library-overview img.library-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 10px;
  margin: 0;
  cursor: auto;
}
.library-row-content { display: grid; gap: 7px; min-width: 0; }
.library-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--aoi-muted);
  font-size: .8125rem;
}
.library-tag {
  padding: 1px 9px;
  background: #e9f1e3;
  color: #355940;
  border: 1px solid #cfdec8;
  border-radius: 999px;
}
.library-row-title {
  font-family: var(--aoi-serif);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.library-row-arrow { color: var(--aoi-green); }
body.library-overview .library-review { grid-template-columns: minmax(0, 1fr); }

body.library-reading .updates-page > .source-content {
  box-sizing: border-box;
  width: 100%;
  max-width: 960px;
  min-width: 0;
  margin: 0 auto;
  padding: clamp(18px, 5vw, 52px);
  border: 1px solid #cddcc5;
  border-radius: 22px;
  background: #ffffffa8;
}
body.library-reading .source-content h1 {
  margin: 0 0 22px;
  line-height: 1.45;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  overflow-wrap: anywhere;
}
body.library-reading .source-content h2 {
  margin-top: 2.25rem;
  border-bottom: 1px solid #ceded0;
  padding-bottom: .5rem;
}
body.library-reading .library-article-cover { margin: 0 0 28px; }
body.library-reading img.library-article-image {
  display: block;
  width: 100%;
  max-height: 360px;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  border-radius: 15px;
  margin: 0;
}
body.library-reading .source-content :is(img, video, iframe) { max-width: 100%; }
body.library-reading .source-content :is(figure, pre, table, .table-wrap, .video-wrap, .article-outline) {
  min-width: 0;
  max-width: 100%;
}
body.library-reading .source-content :is(pre, .table-wrap, table) { overflow-x: auto; }
body.library-reading .source-content figure:not(.library-article-cover) { margin-inline: 0; }
body.library-reading .source-content .copy-button {
  min-height: 44px;
  border-radius: 999px;
  color: var(--aoi-green);
  background: #f9fbf5;
}

@media (max-width: 600px) {
  body.library-reading .updates-page { padding-inline: 14px; }
  .library-hero { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  body.library-overview a.library-row {
    grid-template-columns: 76px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 9px 10px 9px 9px;
  }
  body.library-overview img.library-thumb { aspect-ratio: 1; }
  .library-meta { gap: 3px 7px; font-size: .75rem; }
  .library-row-title { font-size: 1rem; }
  body.library-reading .source-content h1 { font-size: 1.6rem; }
}

.writing-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block: 22px;
}
.writing-nav a {
  padding: 6px 13px;
  border: 1px solid #cddcc5;
  border-radius: 999px;
  background: #f9fbf5;
  color: var(--aoi-ink);
}
.writing-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: #26332a;
}
.writing-materials {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0;
  list-style: none;
}
.writing-comparison > summary { padding-block: 4px; }
.writing-manuscript { white-space: normal; overflow-wrap: anywhere; }
.writing-manuscript p { white-space: pre-wrap; }

body.library-overview #curriculum .chapters {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
body.library-overview #curriculum .chapter.ready {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
  min-height: 98px;
  border-color: #dfe7d8;
  border-radius: 14px;
  background: #ffffffc7;
}
body.library-overview #curriculum .chapter-visual {
  width: 88px;
  height: 78px;
  aspect-ratio: auto;
  margin: 10px 0 10px 10px;
  padding: 0;
  background: transparent;
}
body.library-overview #curriculum .chapter-visual img {
  object-fit: contain;
  border-radius: 7px;
  filter: saturate(.72) contrast(.97) brightness(1.025);
}
body.library-overview #curriculum .chapter-copy { padding: 10px 25px 10px 5px; }
body.library-overview #curriculum .chapter-meta { font-size: .75rem; margin-bottom: 3px; }
body.library-overview #curriculum .chapter h3 {
  font-size: 1rem;
  line-height: 1.65;
  letter-spacing: .01em;
}
body.library-overview #curriculum .chapter-arrow {
  right: 10px;
  bottom: 10px;
  font-size: .875rem;
}
@media (max-width: 1000px) {
  body.library-overview #curriculum .chapters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  body.library-overview #curriculum .chapters { grid-template-columns: minmax(0, 1fr); }
}

.library-file-note,
.library-resource-link {
  color: var(--aoi-green);
  font-size: .8125rem;
}
.library-file-note { order: 1; }
.source-content .resource-group { margin: 2rem 0; }
.source-content .resource-group > h2 { margin: 0 0 1rem; }

.library-overview .course > div { min-width: 0; }
.library-overview .course > .button { flex-shrink: 0; }
@media (max-width: 760px) {
  .library-overview .course { flex-direction: column; align-items: stretch; }
}
