/* Je boeken (books.ts): a shelf of standing covers in Meer's modal, each with where it's kept and its way on; the
   panel that keeps a book with us (keeping.ts); and the toast that says where a book went (toast.ts) */
.modal-card:has(.books) {
  width: min(100%, 1040px);
  padding: 28px 32px 26px;
}
.books-line {
  display: block;
  max-width: 60ch;
  margin: 6px 0 22px;
  color: var(--quiet);
  font-size: 15px;
  line-height: 1.45;
}
.books {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 18px;
  align-items: start;
}
.books-book {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  padding: 8px 10px 14px;
  border-radius: 18px;
  text-align: center;
}
/* the book open now: the one you're in, ringed */
.books-book.is-here {
  background: rgb(36 34 31 / 0.04);
  box-shadow: inset 0 0 0 2px var(--text);
}
.books-cover {
  display: grid;
  place-items: end center;
  height: 196px;
}
.books-cover .order-stage {
  min-height: 0;
  padding: 16px 0 22px;
}
.books-cover .order-book {
  --w: min(132px, 156px * var(--aspect));
}
.books-name {
  margin-top: 2px;
  font-size: 17px;
  font-weight: 600;
}
.books-lines {
  margin: 0;
  max-width: 24ch;
  text-wrap: balance;
  min-height: 2.7em;
  color: var(--quiet);
  font-size: 13px;
  line-height: 1.35;
}
.books-place {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--quiet);
  font-size: 13px;
}
.books-place.is-kept {
  color: #3c6b4f;
  font-weight: 600;
}
.books-place svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.books-book .chip {
  margin-top: 6px;
}
.books-small {
  display: flex;
  flex-wrap: wrap;
  gap: 0 14px;
  justify-content: center;
}
.books-link {
  padding: 4px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgb(36 34 31 / 0.3);
}
.books-small .books-link {
  white-space: nowrap;
  color: var(--quiet);
  font-size: 13px;
}
.books-asked {
  max-width: 22ch;
  color: var(--quiet);
  font-size: 13px;
}
/* + Nieuw boek: an empty book's outline where a cover would stand */
.books-plus {
  width: 118px;
  height: 118px;
  margin: 39px 0;
  border: 2px dashed rgb(36 34 31 / 0.25);
  border-radius: 6px;
  background: none;
  color: var(--quiet);
  font: 300 46px/1 var(--ui-font);
  transition:
    border-color 0.2s,
    transform 0.25s var(--ease);
}
.books-plus:hover {
  border-color: rgb(36 34 31 / 0.5);
}
.books-plus:active {
  transform: scale(0.96);
}
.books-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--quiet);
  font-size: 14px;
}
.books-foot .books-link {
  color: var(--text);
  font-weight: 600;
}
/* keeping with us: the address or the code and its button as one part */
.books-field {
  display: flex;
  gap: 8px;
  max-width: 460px;
}
.books-field input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font: inherit;
  font-size: 16px;
}
.books-field .chip {
  min-height: 44px;
}
.books-back {
  display: block;
  margin-top: 22px;
  color: var(--quiet);
  font-size: 14px;
}
/* Nog eens bestellen (again.ts), in Bestellen's layout */
.again-was {
  display: block;
  margin: 2px 0 6px;
  color: var(--quiet);
  font-size: 14px;
}
.again-kept {
  display: block;
  margin-top: 14px;
  color: #3c6b4f;
  font-size: 14px;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .modal-card:has(.books) {
    padding: 22px 16px calc(var(--safe-bottom) + 20px);
  }
  .books {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .books-cover {
    height: 156px;
  }
  .books-cover .order-book {
    --w: min(104px, 124px * var(--aspect));
  }
  .books-plus {
    width: 92px;
    height: 92px;
    margin: 32px 0;
  }
}

/* The toast: a dark pill clear of the screen's top (under the bar while there is one), its photo a circle seated
   inside the pill's rounded end, as far from its edge all round as Bekijk is at the other end */
.toast {
  --inset: 6px;
  position: fixed;
  z-index: 60;
  inset-inline: 0;
  top: calc(max(var(--top-bottom, 0px), var(--safe-top)) + 20px);
  width: fit-content;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 32px);
  padding: var(--inset);
  /* concentric with the photo's circle at either end, on one line or two */
  border-radius: calc(20px + var(--inset));
  background: #24221f;
  color: #fbf8f3;
  font-size: 15px;
  box-shadow: 0 18px 40px -18px rgb(20 14 8 / 0.65);
  animation: toast-in 0.42s var(--ease) both;
  /* (where it comes from and goes: a little above, or below at the foot) */
  --toast-from: -10px;
}
/* at the foot: over the book's foot, above the agent's dock (its bottom set by toast.ts) */
.toast.is-foot {
  top: auto;
  --toast-from: 10px;
}
.toast.is-leaving {
  animation: toast-out 0.28s ease-in both;
}
.toast img {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.toast span {
  min-width: 0;
  line-height: 1.3;
  text-wrap: balance;
}
.toast:not(:has(img)) span {
  padding-left: 12px;
}
.toast button {
  flex: none;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: rgb(251 248 243 / 0.14);
  color: #f6e7b8;
  font: inherit;
  font-weight: 600;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(var(--toast-from)) scale(0.96);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(calc(var(--toast-from) * 0.8)) scale(0.97);
  }
}
@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast.is-leaving {
    animation-duration: 0.01s;
  }
}
