.book-status-tag[data-book-state] {
  --status-ink: #205781;
  --status-bg: #edf6ff;
  --status-border: #bcd7ef;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35em;
  max-width: 100%;
  width: fit-content;
  min-height: 22px;
  padding: 3px 8px;
  margin: 4px 0;
  border: 1px solid var(--status-border);
  border-radius: 8px;
  background: var(--status-bg);
  color: var(--status-ink);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: normal;
  white-space: normal;
  word-break: keep-all;
  vertical-align: middle;
}
.book-status-tag[data-book-state="finished"] {
  --status-bg: #fff6ce;
  --status-ink: #695013;
  --status-border: #e3c45b;
}
.book-status-tag:is([data-book-state="partial"], [data-book-state="unknown"]) {
  --status-bg: #f4f4f2;
  --status-ink: #555954;
  --status-border: #d2d6d0;
}
/* Ended books use a medal or an outlined circle; active books keep the blue progress tag. */
.book-status-tag[data-book-state="incomplete"] {
  --status-bg: #f1f3f2;
  --status-ink: #48554f;
  --status-border: #bac6be;
}
.book-status-note {
  display: inline-block; margin: 4px 0; color: #5b635f; font-size: 12px; line-height: 1.4;
}
.book-status-tag .book-status-mark {
  display: inline-block; flex: 0 0 auto; width: .56em; height: .56em;
  border: 1.5px solid currentColor; border-radius: 50%;
}
.book-status-tag .book-status-medal {
  display: inline-block; position: static; width: 17px; height: 21px; flex: 0 0 auto;
  margin: -2px 0; background: transparent; object-fit: contain;
}
/* Use a neutral surface for missing activity records. */
.book-status-fact {
  display: grid; gap: 2px; padding: 7px 9px; border: 1px solid #d6dcd9; border-radius: 8px;
  background: #f4f5f4; color: #525b56; font-size: 12px; line-height: 1.5;
}
.book-status-fact[data-activity-state="complete"] {
  background: #edf7ef; border-color: #c5dfcd; color: #285b3c;
}
.book-status-fact[data-activity-state="incomplete"] {
  background: #ffebe5; border-color: #dfaa99; color: #863a29;
  border-inline-start: 3px solid #c2674e; padding-inline-start: 7px;
}
.book-status-fact strong {color: inherit; font-size: 13px;}
/* Book details pair each activity with a growth sticker. */
.book-status-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  container-type: inline-size;
  margin: 14px 0;
  text-align: start;
}
.book-status-facts > .book-status-fact {
  --sticker-size: clamp(29px, 8vw, 42px);
  grid-template-columns: var(--sticker-size) minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  gap: 1px clamp(4px, 1.4vw, 9px);
  box-sizing: border-box;
  min-width: 0;
  min-height: 68px;
  padding: 9px clamp(5px, 1.8vw, 12px);
  border: 1px solid #dcdeda;
  border-radius: 16px;
  background: #f5f5f2;
  color: #525b56;
  line-height: 1.4;
}
.book-status-facts > [data-activity-state="incomplete"] {
  background: #fff8e9;
  border-color: #ebdfc3;
  color: #715025;
}
.book-status-facts > [data-activity-state="complete"] {
  background: #f0f8f3;
  border-color: #d0e5d8;
  color: #285a43;
}
.book-status-facts > .book-status-fact::before {
  content: "";
  grid-area: 1 / 1 / span 2 / 2;
  justify-self: center;
  align-self: center;
  width: 100%;
  aspect-ratio: 1;
  background: url("/assets/book-growth-stickers-v1.png") left center / 200% 100% no-repeat;
  filter: drop-shadow(0 1px 1px rgb(76 55 38 / 18%));
}
.book-status-facts > [data-activity-state="complete"]::before {
  background-position: right center;
}
.book-status-facts > [data-activity-state="unknown"]::before {
  width: 52%;
  border: 1px dashed #8a928c;
  border-radius: 50%;
  background: linear-gradient(#8a928c, #8a928c) center / 36% 1px no-repeat;
  filter: none;
}
.book-status-facts > .book-status-fact > span {
  font-size: 12px;
  font-weight: 500;
  word-break: keep-all;
}
.book-status-facts > .book-status-fact > strong {
  color: inherit;
  font-size: 14px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
@container (max-width: 275px) {
  .book-status-facts > .book-status-fact {
    --sticker-size: 26px;
    column-gap: 3px;
    padding-inline: 5px;
    min-height: 60px;
  }
  .book-status-facts > .book-status-fact > strong {font-size: 13px;}
}
.book-status-left {display: block; color: #34546a; font-size: 13px; line-height: 1.6; word-break: keep-all;}
.parent-shelf-book .book-status-tag, .completed-book .book-status-tag {font-size: 11px;}
.report-book-name .book-status-tag {margin-bottom: 0;}
.book-status-history {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 7px; max-width: 38rem; margin-top: 6px;
}
.book-status-history .book-status-fact {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 5px;
  padding-block: 3px; min-width: 0; line-height: 1.45;
}
.book-status-history .book-status-fact strong {font-variant-numeric: tabular-nums;}
@media (min-width: 640px) {
  .book-status-history {grid-template-columns: repeat(4, minmax(0, 1fr));}
}
@media print {.book-status-tag[data-book-state] {border: 1pt solid currentColor;}}
