.authors-page {
  padding-block-start: clamp(2rem, 5vw, 4rem);
}

.history-page {
  max-width: 52rem;
  padding-block-end: 3rem;
}
.history-intro,
.history-count {
  color: var(--muted);
  line-height: 1.65;
  font-size: .875rem;
}
.history-date {
  display: grid;
  gap: .375rem;
  width: min(100%, 14rem);
  margin-block: 1.5rem 1rem;
}
.history-date label {
  color: var(--green);
  font-weight: 600;
}
.history-date select {
  width: 100%;
  min-height: 44px;
  padding: .5rem .75rem;
  border: 1px solid var(--line);
  border-radius: .45rem;
  background: #fffefa;
  color: var(--ink);
  font: inherit;
}
.history-date select:focus-visible,
.history-row :is(button, a):focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
.history-list {
  list-style: none;
  padding: 0;
  margin: .5rem 0 0;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: #fffefa;
}
.history-row {
  display: grid;
  grid-template-columns: 3.25rem minmax(0,1fr) auto;
  align-items: start;
  gap: .75rem;
  padding: .875rem clamp(.75rem, 3vw, 1.25rem);
}
.history-row + .history-row { border-top: 1px solid var(--line); }
.history-cover {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 4;
  border-radius: .3rem;
  overflow: hidden;
  background: var(--soft);
}
.history-cover :is(.cover-original, .cover-crop, .thumb) { width: 100%; max-height: 100%; }
.history-cover .cover-original img { display: block; width: 100%; height: auto; max-height: calc(3.25rem * 4 / 3); object-fit: contain; }
.history-cover .thumb { min-height: 0; aspect-ratio: 3 / 4; }
.history-cover .thumb small { font-size: .625rem; }
.history-copy { min-width: 0; }
.history-row .book-title {
  padding: .15rem 0;
  margin: 0;
  text-align: start;
  overflow-wrap: anywhere;
}
.history-row .book-title:hover { text-decoration: underline; }
.history-copy p { margin: .3rem 0 0; color: #5c695f; font-size: .8rem; overflow-wrap: anywhere; }
.history-copy .history-events { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .65rem; color: var(--green); line-height: 1.5; }
.history-event-link { min-block-size: 24px; max-inline-size: 100%; padding-block: .15rem; text-decoration: underline; text-underline-offset: .18em; }
.history-event-unavailable { color: #5c695f; }
.history-change {
  color: #40552e;
  background: var(--soft);
  border-radius: .375rem;
  padding: .25rem .45rem;
  font-size: .75rem;
  white-space: nowrap;
}
.history-change--added { background: #e1efd9; }
.history-change--recorded { background: #eeeee9; }

@media (max-width: 420px) {
  .history-row { grid-template-columns: 3.25rem minmax(0,1fr); row-gap: .375rem; }
  .history-cover { grid-row: span 2; }
  .history-change { grid-column: 2; justify-self: start; }
}

.authors-page > h2,
#budget-title {
  font-family: Georgia, "Noto Serif TC", "Noto Serif JP", "PMingLiU", serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.25;
}

#authors-page > .authors-intro {
  max-width: 72ch;
  margin: .75rem 0 1.5rem;
  font-size: .9rem;
  color: var(--ink);
}

.author-filters {
  display: grid;
  grid-template-columns: minmax(12rem, 1.5fr) minmax(0, 1fr) minmax(0, .8fr);
  gap: .65rem;
}

.author-filters .select-wrap {
  min-width: 0;
  justify-content: space-between;
}

.author-filters .select-wrap > span {
  color: var(--green);
  flex-shrink: 0;
}

.author-filters select {
  min-width: 0;
  max-width: 100%;
  text-overflow: ellipsis;
}

.author-results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .25rem 1rem;
  margin-block: .5rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.author-saved-filter {
  margin: 0;
  min-height: 44px;
  cursor: pointer;
}

.author-saved-filter input {
  accent-color: var(--green);
}

#author-count {
  color: var(--green);
  font-size: .85rem;
}

.author-grid {
  margin-top: 0;
}

.author-card header {
  display: flow-root;
}

.author-card .author-bookmark {
  float: inline-end;
  margin: 0 0 .6rem .6rem;
  min-height: 36px;
}

.author-card h3 {
  font-family: Georgia, "Noto Serif TC", "Noto Serif JP", "PMingLiU", serif;
  font-size: 1.25rem;
}

.author-card-footer button {
  min-height: 40px;
  font-size: .82rem;
  text-decoration: underline;
  text-underline-offset: .22em;
}

.shelf-tabs {
  flex-wrap: wrap;
  padding: 0;
  overflow: visible;
  gap: .35rem;
  border: 0;
}

.shelf-tabs [role="tab"] {
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  background: var(--paper);
}

.shelf-tabs [aria-selected="true"] {
  color: white;
  background: var(--green);
  border-color: var(--green);
}

.shelf-tab-count {
  color: var(--green);
}

#shelf-status,
.event-budgets:has(#budget-login) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--soft);
  padding: clamp(1rem, 3vw, 2rem);
  border: 0;
  border-radius: 6px;
}

#shelf-status-text,
.event-budgets:has(#budget-login) p {
  color: var(--ink);
  font-size: 1rem;
  margin: 0;
}

.event-budgets {
  padding: 0 0 1rem;
}

.event-budgets th,
.event-budgets td {
  padding: .9rem .65rem;
  font-size: .875rem;
}

.event-budgets thead {
  background: var(--soft);
}

.event-budgets thead th {
  color: var(--ink);
}

.event-budgets th:nth-child(3),
.event-budgets .budget-total {
  text-align: end;
}

.event-budgets .budget-total {
  color: var(--green);
  font-weight: 700;
}

@media (max-width: 760px) {
  .author-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .author-filters .search {
    grid-column: 1 / -1;
  }

  .author-filters .select-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .25rem;
    padding: .5rem .6rem;
  }

  .author-filters select {
    width: 100%;
    padding: .25rem 0;
  }

  .shelf-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .event-budgets th,
  .event-budgets td {
    padding: .7rem .3rem;
    font-size: .8rem;
  }
}
