.library-tabs { margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 14px; }
.library-filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 9px; margin: 0 0 14px; }
.library-filters .search-box { min-width: min(100%, 205px); }
.library-filters .author-field { flex: 0 1 120px; min-width: 104px; }
.library-filters select { width: 100%; height: 38px; padding: 0 8px; margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; background: white; color: inherit; font: inherit; }
.library-course-card, .library-idea-card { min-width: 0; overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 13px; }
.library-course-card, .library-card-body { display: grid; grid-template-rows: auto auto 1fr auto auto; gap: 8px; padding: 14px; }
.library-course-card { grid-template-rows: auto auto 1fr auto auto auto; }
.library-course-card h2, .library-card-body h2 { font-size: 17px; overflow-wrap: anywhere; }
.library-course-card p, .library-card-body p, .library-card-meta { color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.library-course-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: #5f3aae; background: #efe5ff; }
.library-card-meta, .library-card-foot, .library-asset-actions, .library-lesson-nav, .library-detail-meta, .library-review-status {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.library-card-meta span { font-size: 12px; }
.library-card-meta span + span::before { content: '·'; margin-right: 7px; }
.library-card-foot, .library-lesson-nav { justify-content: space-between; }
.library-course-card .library-card-foot, .library-card-body .library-card-foot { padding-top: 7px; border-top: 1px solid var(--line); font-size: 13px; }
.library-progress { display: flex; min-width: 0; align-items: center; gap: 9px; color: var(--muted); }
.library-progress progress { width: min(76%, 240px); height: 7px; overflow: hidden; border: 0; border-radius: 10px; background: #f1ebfa;
  accent-color: var(--violet); }
.library-progress progress::-webkit-progress-bar { background: #f1ebfa; }
.library-progress progress::-webkit-progress-value { background: var(--violet); border-radius: 10px; }
.library-progress progress::-moz-progress-bar { background: var(--violet); }
.library-cover { --ground: #f3e9fe; --main-art: #8763d2; --accent-art: #d5baff; --line-art: #492c88;
  position: relative; min-height: 120px; height: clamp(135px, 16vw, 220px); overflow: hidden; background-color: var(--ground); }
.library-cover-mint { --ground: #e6eee4; --main-art: #6e9c86; --accent-art: #badac0; --line-art: #33594b; }
.library-cover-amber { --ground: #f3e5d4; --main-art: #cc8a4a; --accent-art: #efbf9d; --line-art: #765244; }
.library-cover-coral { --ground: #fae6de; --main-art: #cc736a; --accent-art: #ecb0aa; --line-art: #734249; }
.library-cover-blue { --ground: #dee9fa; --main-art: #487cc1; --accent-art: #9ad2ed; --line-art: #39528c; }
.library-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.library-cover-large { height: clamp(165px, 24vw, 310px); border-radius: 13px; }
.library-cover-art { position: absolute; inset: 0; background-image: radial-gradient(circle at 2px 2px, #fff7 1px, transparent 1px); background-size: 18px 18px; }
.library-cover-art i { position: absolute; display: block; }
.library-cover-art i:first-child { top: 17%; left: 14%; height: 112%; width: 56%; border-radius: 50% 50% 0 0; transform: rotate(-25deg);
  background: linear-gradient(145deg, var(--main-art), var(--accent-art)); }
.library-cover-art i:nth-child(2) { top: 14%; left: 53%; height: 90%; width: 42%; border: 1px solid var(--line-art);
  border-radius: 50%; transform: rotate(23deg); }
.library-cover-art i:nth-child(3) { top: 23%; left: 71%; width: 12%; aspect-ratio: 1; border-radius: 50%; background: var(--line-art); }
.library-cover-mint .library-cover-art i:first-child { border-radius: 23% 23% 42% 42%; width: 41%; height: 74%; left: 30%; transform: rotate(-12deg); }
.library-cover-amber .library-cover-art i:nth-child(2), .library-cover-coral .library-cover-art i:nth-child(2) { border-radius: 4px; }
.library-detail-meta, .library-lesson-nav { margin: 12px 0; }
.library-reading { gap: 15px; }
.library-prose { color: #473b5d; font-size: 15px; line-height: 1.85; overflow-wrap: anywhere; }
.library-prose p { white-space: pre-wrap; }
.library-prose p + p { margin-top: 14px; }
.library-material, .library-review-chapter, .library-attachment-field { display: grid; gap: 8px; }
.library-attachment { display: block; width: min(100%, 580px); max-height: 440px; object-fit: contain; border-radius: 9px; }
.library-attachment.audio { max-width: 410px; }
.library-review-status { margin-bottom: 10px; padding: 10px; border-radius: 8px; border: 1px solid var(--line); background: #faf6ff; font-size: 13px; }
.library-chapter-editor, .library-review-chapter { padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #fcfaff; }
.library-chapter-editor { display: grid; gap: 9px; }
.library-empty-note { padding: 12px; }
@media (max-width: 620px) {
  .library-filters .search-box { width: 100%; }
  .library-filters .author-field { flex: 1 1 110px; }
  .library-filters select { font-size: 16px; }
  .library-grid { grid-template-columns: minmax(0, 1fr); }
  .library-card-foot .button { min-height: 34px; }
}
