/* Clear card boundaries and stable content zones for the two public libraries. */
body[data-totink-page="picture-books"] .book-grid,
body[data-totink-page="courseware"] .course-list {
  padding: 18px;
  border: 1px solid #e1cfb6;
  border-radius: 30px;
  background: rgba(255, 253, 248, .72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
}

body[data-totink-page="picture-books"] .book-grid {
  gap: 16px;
}

body[data-totink-page="picture-books"] .book-card,
body[data-totink-page="courseware"] .course-card {
  overflow: hidden;
  border: 2px solid #e8d8c3;
  background: #fff;
  box-shadow: 0 9px 22px rgba(91, 61, 37, .08);
}

body[data-totink-page="picture-books"] .book-card {
  border-radius: 22px;
}

body[data-totink-page="picture-books"] .book-card:hover,
body[data-totink-page="courseware"] .course-card:hover {
  border-color: #ffb28e;
  box-shadow: 0 16px 32px rgba(91, 61, 37, .13);
}

body[data-totink-page="picture-books"] .cover {
  border-bottom: 2px solid #eadbc7;
  background: #fff5e7;
}

body[data-totink-page="picture-books"] .book-body {
  padding: 16px 16px 0;
}

body[data-totink-page="picture-books"] .book-title {
  margin-bottom: 10px;
}

body[data-totink-page="picture-books"] .meta-row {
  min-height: 58px;
  margin-bottom: 9px;
}

body[data-totink-page="picture-books"] .desc {
  min-height: calc(1.5em * 3);
  max-height: calc(1.5em * 3);
  margin-bottom: 13px;
}

body[data-totink-page="picture-books"] .open-btn {
  width: 100%;
  min-height: 41px;
  align-self: stretch;
  border-radius: 12px;
}

body[data-totink-page="picture-books"] .detail-hint,
body[data-totink-page="courseware"] .detail-hint {
  display: none;
}

body[data-totink-page="picture-books"] .file-actions {
  min-height: 43px;
  justify-content: flex-start;
  margin-top: 9px;
  padding: 8px 0;
  border-top: 1px solid #f0e4d5;
}

body[data-totink-page="picture-books"] .file-link,
body[data-totink-page="courseware"] .file-link {
  min-height: 27px;
  padding: 0 8px;
  border-color: #ead8c1;
  border-radius: 8px;
  background: #fff8ed;
  font-size: 10px;
}

body[data-totink-page="picture-books"] .download-metrics {
  min-height: 54px;
  justify-content: space-between;
  margin: 0 -16px;
  padding: 11px 16px;
  border-top: 1px solid #eadbc7;
  background: #fffaf2;
}

body[data-totink-page="picture-books"] .download-metric,
body[data-totink-page="courseware"] .download-metric {
  min-height: 30px;
  padding: 4px 8px;
  border-color: #f1d7c5;
  border-radius: 9px;
  background: #fff;
}

body[data-totink-page="picture-books"] .download-metric strong,
body[data-totink-page="courseware"] .download-metric strong {
  min-width: 25px;
  height: 25px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 7px;
  color: #fff;
  background: #ef7545;
}

body[data-totink-page="courseware"] .course-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

body[data-totink-page="courseware"] .course-card {
  display: flex;
  min-width: 0;
  height: 100%;
  padding: 0;
  gap: 0;
  flex-direction: column;
  border-radius: 22px;
}

body[data-totink-page="courseware"] .course-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  align-self: stretch;
  border: 0;
  border-bottom: 2px solid #eadbc7;
  border-radius: 0;
  background: #fff5e7;
}

body[data-totink-page="courseware"] .course-content {
  min-width: 0;
  display: flex;
  padding: 16px 16px 0;
  flex: 1;
  flex-direction: column;
}

body[data-totink-page="courseware"] .course-title {
  min-height: calc(1.22em * 2);
  max-height: calc(1.22em * 2);
  margin-bottom: 9px;
  font-size: 19px;
}

body[data-totink-page="courseware"] .course-summary {
  min-height: calc(1.5em * 3);
  max-height: calc(1.5em * 3);
  margin-bottom: 11px;
  font-size: 13px;
  line-height: 1.5;
}

body[data-totink-page="courseware"] .course-meta {
  min-height: 58px;
  gap: 7px 13px;
  margin-top: 0;
  font-size: 12px;
}

body[data-totink-page="courseware"] .open-course {
  width: 100%;
  min-height: 41px;
  justify-content: center;
  margin-top: 10px;
  align-self: stretch;
  border-radius: 12px;
}

body[data-totink-page="courseware"] .file-actions {
  min-height: 43px;
  margin-top: 9px;
  padding: 8px 0;
  border-top: 1px solid #f0e4d5;
}

body[data-totink-page="courseware"] .download-metrics {
  min-height: 54px;
  justify-content: space-between;
  margin: 0 -16px;
  padding: 11px 16px;
  border-top: 1px solid #eadbc7;
  background: #fffaf2;
}

@media (max-width: 1100px) and (min-width: 761px) {
  body[data-totink-page="courseware"] .course-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body[data-totink-page="picture-books"] .book-grid,
  body[data-totink-page="courseware"] .course-list {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
    padding: 10px !important;
    border-radius: 22px !important;
  }

  body[data-totink-page="picture-books"] .book-card,
  body[data-totink-page="courseware"] .course-card {
    display: grid !important;
    grid-template-columns: clamp(110px, 31vw, 176px) minmax(0, 1fr) !important;
    min-height: 202px !important;
    border-width: 2px !important;
    border-radius: 18px !important;
  }

  body[data-totink-page="picture-books"] .cover,
  body[data-totink-page="courseware"] .course-thumb {
    width: 100% !important;
    height: 100% !important;
    min-height: 202px !important;
    aspect-ratio: auto !important;
    border: 0 !important;
    border-right: 2px solid #eadbc7 !important;
  }

  body[data-totink-page="picture-books"] .book-body,
  body[data-totink-page="courseware"] .course-content {
    padding: 12px 12px 0 !important;
  }

  body[data-totink-page="picture-books"] .open-btn,
  body[data-totink-page="courseware"] .open-course {
    min-height: 36px !important;
    margin-top: auto !important;
    font-size: 11px !important;
  }

  body[data-totink-page="picture-books"] .download-metrics,
  body[data-totink-page="courseware"] .download-metrics {
    min-height: 43px !important;
    margin: 8px -12px 0 !important;
    padding: 7px 10px !important;
    gap: 5px !important;
  }

  body[data-totink-page="picture-books"] .download-metric,
  body[data-totink-page="courseware"] .download-metric {
    min-height: 26px !important;
    padding: 2px 6px !important;
    font-size: 9px !important;
  }

  body[data-totink-page="picture-books"] .download-metric strong,
  body[data-totink-page="courseware"] .download-metric strong {
    min-width: 21px;
    height: 21px;
  }
}

@media (max-width: 390px) {
  body[data-totink-page="picture-books"] .book-card,
  body[data-totink-page="courseware"] .course-card {
    grid-template-columns: 104px minmax(0, 1fr) !important;
  }

  body[data-totink-page="picture-books"] .meta-row,
  body[data-totink-page="courseware"] .course-meta {
    min-height: 0;
  }
}
