#story-library-panel .panel-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.story-library-header-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

#story-library-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 12px;
}

.story-book {
  width: 100%;
  min-width: 0;
  min-height: 172px;
  display: grid;
  grid-template-columns: 106px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid #d9e1ea;
  border-radius: 8px;
  background: #ffffff;
  color: #18212f;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(24, 33, 47, 0.08);
}

.story-book:hover,
.story-book:focus-visible {
  border-color: #2c7be5;
  box-shadow: 0 0 0 2px rgba(44, 123, 229, 0.16);
  outline: none;
}

.story-book.active {
  border-color: #df3f8f;
}

.story-book-cover {
  position: relative;
  width: 106px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 5px;
  border: 1px solid #c6ced8;
  background: #edf1f6;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow: 5px 5px 0 #dce3eb;
}

.story-book-cover::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: rgba(18, 30, 46, 0.2);
}

.story-book-cover.no-image::after {
  content: "Story";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #536174;
  font-size: 13px;
  font-weight: 700;
}

.story-book-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.story-book-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.story-book-title {
  min-width: 0;
  color: #172033;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.story-book-active-label {
  flex: 0 0 auto;
  color: #b92570;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
}

.story-book-category {
  color: #2c69b7;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.story-book-description {
  display: -webkit-box;
  overflow: hidden;
  color: #536174;
  font-size: 12px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.story-book-progress {
  color: #344155;
  font-size: 12px;
  font-weight: 650;
}

.story-library-message {
  grid-column: 1 / -1;
  align-self: start;
  padding: 18px;
  border: 1px solid #d9e1ea;
  border-radius: 8px;
  background: #ffffff;
  color: #536174;
  text-align: center;
}

#story-library-footer {
  justify-content: center;
}

@media (max-width: 720px) {
  #story-library-list {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px;
    gap: 10px;
  }

  .story-book {
    min-height: 150px;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px;
    padding: 10px;
  }

  .story-book-cover {
    width: 88px;
  }

  .story-book-title {
    font-size: 16px;
  }
}
