/* 자료실(#library): 헤더와 푸터 사이에서 적재 플래너 대신 보인다. */
.library-view {
  --lib-muted: #5f6763;
  --lib-line: rgba(0, 0, 0, 0.09);
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 16px 56px;
  color: #1d1d1f;
  line-height: 1.6;
}
.library-view[hidden] {
  display: none;
}
.library-view .lib-head h2 {
  font-size: 26px;
  margin: 4px 0 6px;
}
.library-view .lib-head p {
  margin: 0 0 8px;
  color: var(--lib-muted);
  font-size: 14px;
  max-width: 760px;
}
.library-view .lib-section {
  margin-top: 26px;
}
.library-view .lib-section > h3 {
  font-size: 18px;
  margin: 0 0 12px;
}
.library-view .lib-section > h3 small {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--lib-muted);
}
.library-view .lib-docs,
.library-view .lib-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.library-view .lib-doc,
.library-view .lib-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--lib-line);
  border-radius: 14px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  font-size: 13.5px;
}
.library-view .lib-doc:hover,
.library-view .lib-card:hover {
  border-color: #0071e3;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}
.library-view .lib-doc b,
.library-view .lib-card b {
  font-size: 15px;
}
.library-view .lib-doc > span:last-child,
.library-view .lib-card > span {
  color: #3a4148;
}
.library-view .lib-meta {
  font-size: 12px;
  color: var(--lib-muted) !important;
}
.library-view .lib-open {
  margin-top: auto;
  font-size: 12.5px;
  font-weight: 700;
  color: #0071e3 !important;
}
.library-view .lib-tag {
  align-self: flex-start;
  padding: 2px 9px;
  border-radius: 999px;
  background: #e8f1fd;
  color: #1b4f8f;
  font-size: 12px;
  font-weight: 700;
}
.library-view .lib-disclaimer {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f6f7f5;
  color: var(--lib-muted);
  font-size: 12.5px;
}
.library-view .lib-plan {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 6px;
  font-size: 14px;
}
.library-view .lib-plan li span {
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: #eef1f3;
  color: #5f6763;
}
.library-view .lib-plan li[data-state='done'] span {
  background: #e5f5ec;
  color: #145c33;
}
.library-view .lib-plan a {
  color: #0071e3;
}
.library-view .lib-crumb a {
  font-size: 14px;
  font-weight: 700;
  color: #0071e3;
  text-decoration: none;
}
.library-view .lib-article {
  margin-top: 12px;
  padding: 22px;
  border: 1px solid var(--lib-line);
  border-radius: 16px;
  background: #fff;
  font-size: 15px;
}
.library-view .lib-article h2 {
  font-size: 24px;
  margin: 8px 0 12px;
}
.library-view .lib-article h3 {
  font-size: 17px;
  margin: 22px 0 8px;
}
.library-view .lib-article p,
.library-view .lib-article li {
  color: #2b3230;
}
.library-view .lib-figure {
  margin: 20px 0 24px;
  overflow: hidden;
  border: 1px solid var(--lib-line);
  border-radius: 14px;
  background: #f7f8f6;
}
.library-view .lib-figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.library-view .lib-figure figcaption {
  padding: 10px 14px 12px;
  color: var(--lib-muted);
  font-size: 12.5px;
  line-height: 1.55;
}
.library-view .lib-figure figcaption span {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #e8f1ec;
  color: #285943;
  font-size: 11px;
  font-weight: 700;
}
.library-view .lib-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin: 6px 0;
}
.library-view .lib-table th,
.library-view .lib-table td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--lib-line);
  text-align: left;
  vertical-align: top;
}
.library-view .lib-table th {
  background: #f6f7f5;
  font-weight: 700;
}
@media (max-width: 640px) {
  .library-view .lib-article {
    padding: 16px;
    font-size: 14.5px;
  }
  .library-view .lib-table {
    display: block;
    overflow-x: auto;
  }
  .library-view .lib-figure {
    margin: 16px -4px 20px;
    border-radius: 12px;
  }
}
.library-view .lib-head a {
  color: #0071e3;
  font-weight: 700;
}
.library-view .lib-article ol,
.library-view .lib-article ul {
  padding-left: 22px;
}
/* CTU Code 전체 요약: 항목 카드와 중요도 표시 */
.library-view .lib-item {
  margin: 10px 0;
  padding: 12px 14px;
  border: 1px solid var(--lib-line);
  border-left: 4px solid #d5dbd8;
  border-radius: 10px;
  background: #fff;
}
.library-view .lib-item[data-level='3'] {
  border-left-color: #0071e3;
  background: #f7fbff;
}
.library-view .lib-item[data-level='2'] {
  border-left-color: #7fb89a;
}
.library-view .lib-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}
.library-view .lib-item-head b {
  font-size: 15.5px;
}
.library-view .lib-item-head small {
  color: var(--lib-muted);
  font-size: 12px;
}
.library-view .lib-level {
  padding: 1px 8px;
  border-radius: 999px;
  background: #eef1f3;
  color: #5f6763;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.library-view .lib-item[data-level='3'] .lib-level {
  background: #e3efff;
  color: #0b4a99;
}
.library-view .lib-item[data-level='2'] .lib-level {
  background: #e5f5ec;
  color: #145c33;
}
.library-view .lib-item p {
  margin: 6px 0 0;
}
.library-view .lib-item ul {
  margin: 6px 0 0;
}
.library-view .lib-why {
  color: var(--lib-muted) !important;
  font-size: 13px;
}
.library-view .lib-links a,
.library-view .lib-article p a {
  color: #0071e3;
  font-weight: 600;
}
/* 자료실 목록: 공식 원문 카드 표시와 준비 중 카드 */
.library-view .lib-card .lib-kind {
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  background: #1d1d1f;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.library-view .lib-soon {
  border-style: dashed;
  background: #fafbfa;
  cursor: default;
}
.library-view .lib-doc.lib-soon:hover {
  border-color: var(--lib-line);
  transform: none;
  box-shadow: none;
}
.library-view .lib-soon .lib-tag {
  background: #fff4d6;
  color: #7a4d00;
}
.library-view .lib-doc.lib-soon > .lib-open {
  color: var(--lib-muted) !important;
}
.library-view .lib-head p,
.library-view .lib-disclaimer {
  line-height: 1.7;
}
/* 사례집 등: 단락·사례 바로 아래 출처 줄 */
.library-view .lib-source {
  margin: -4px 0 20px;
  padding: 8px 12px;
  border-left: 3px solid var(--lib-line);
  color: var(--lib-muted);
  font-size: 12.5px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
/* 해설 카드·해설 머리의 중요도 별 */
.library-view .lib-doc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.library-view .lib-level[data-level='3'] {
  background: #e3efff;
  color: #0b4a99;
}
.library-view .lib-level[data-level='2'] {
  background: #e5f5ec;
  color: #145c33;
}
/* 해설 표: 한국어는 띄어쓰기에서만 줄을 바꾸고(단어 중간에서 끊지 않음), 머리줄과 짧은 항목 열은 한 줄로 */
.library-view .lib-article table th,
.library-view .lib-article table td {
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.library-view .lib-article table th,
.library-view .lib-article table .lib-nowrap {
  white-space: nowrap;
}
@media (max-width: 640px) {
  /* 휴대폰: 긴 설명 열이 너무 좁아지지 않게 최소 폭을 두고, 표는 옆으로 밀어 본다 */
  .library-view .lib-article table td:not(.lib-nowrap) {
    min-width: 11em;
  }
}
/* 작업 순서로 보기 */
.library-view .lib-stages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 640px) {
  .library-view .lib-stages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.library-view .lib-stage {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--lib-line);
  border-radius: 12px;
  background: #fff;
}
.library-view .lib-stage > b {
  font-size: 15px;
}
.library-view .lib-stage > small {
  color: var(--lib-muted);
  font-size: 12px;
}
.library-view .lib-stage ul {
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.library-view .lib-stage a {
  word-break: keep-all;
  color: #0b4a99;
  font-size: 13px;
  text-decoration: none;
}
.library-view .lib-stage a:hover {
  text-decoration: underline;
}
/* Cubestow 도면(SVG): 흰 바탕 도면이 카드 배경과 구분되게 */
.library-view .lib-drawing img {
  background: #fff;
}
.library-view .lib-drawing figcaption span {
  background: #e3efff;
  color: #0b4a99;
}
/* 해설 머리의 원문 대조 확인일 */
.library-view .lib-checked {
  margin: -6px 0 18px;
  color: var(--lib-muted);
  font-size: 12.5px;
}
/* 첫 화면 구간 접기 */
.library-view details.lib-section > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}
.library-view details.lib-section > summary::-webkit-details-marker {
  display: none;
}
.library-view details.lib-section > summary::after {
  content: '';
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-left: 2px;
  border-right: 2.5px solid currentColor;
  border-bottom: 2.5px solid currentColor;
  transform: translateY(-3px) rotate(45deg);
  transition: transform 0.15s;
}
.library-view details.lib-section[open] > summary::after {
  transform: translateY(2px) rotate(-135deg);
}
.library-view details.lib-section > summary > h3 {
  margin: 0;
  font-size: 18px;
}
.library-view details.lib-section > summary > h3 small {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--lib-muted);
}
.library-view details.lib-section[open] > summary {
  margin-bottom: 12px;
}
.library-view details.lib-section {
  padding-top: 14px;
  border-top: 1px solid var(--lib-line);
}
.library-view .lib-fold {
  margin-top: 6px;
  padding: 7px 14px;
  border: 1.5px solid #b9cdbf;
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
/* 공식 원문: 회람 번호 표시와 IMO 소개 페이지 한 줄 링크 */
.library-view .lib-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
}
.library-view .lib-circ {
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8f1fd;
  color: #1b4f8f;
  font-size: 12px;
  font-weight: 800;
}
.library-view .lib-intro {
  margin-left: 10px;
  color: #0071e3;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
/* 첫 화면 맨 위 저작권·해설 안내 */
.library-view .lib-notice {
  max-width: 820px;
  margin: 8px 0 10px;
  padding: 14px 16px;
  border: 1px solid #ead9ae;
  border-radius: 12px;
  background: #fffaf0;
  font-size: 14px;
  line-height: 1.7;
}
.library-view .lib-notice b {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}
.library-view .lib-notice p {
  margin: 0;
  color: #3a4148;
}
.library-view .lib-head .lib-start {
  margin: 0 0 8px;
}
