.authors-page, .writer-page { max-width: 1120px; }
.authors-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 12px; margin-bottom: 16px; }
.authors-heading .page-heading { margin: 0; }
.authors-heading > a { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; white-space: nowrap; }
.authors-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(145px, 235px) auto; align-items: center; gap: 8px 12px; }
.authors-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-inline: 12px 8px;
  border: 1px solid var(--control-line);
  border-radius: var(--radius-control);
  background: var(--subtle);
  color: var(--muted);
}
.authors-search:focus-within { border-color: var(--focus); box-shadow: inset 0 0 0 1px var(--focus); }
.authors-search input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1rem;
}
.authors-search input::placeholder { color: var(--muted); }
.authors-genre { min-width: 0; }
.authors-genre select {
  width: 100%;
  min-height: 46px;
  padding: 6px 8px;
  border: 1px solid var(--control-line);
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
}
.authors-free { display: flex; align-items: center; gap: 7px; min-height: 44px; color: var(--ink); font-size: .875rem; font-weight: var(--weight-label); cursor: pointer; }
.authors-free input { width: 24px; height: 24px; margin: 0; accent-color: var(--focus); }
.authors-sort {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 12px;
  border-bottom: 1px solid var(--line);
}
.authors-sort button {
  min-height: 44px;
  padding: 6px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: .9rem;
  font-weight: var(--weight-label);
}
.authors-sort button:hover, .authors-sort [aria-pressed="true"] { color: var(--accent-ink); }
.authors-sort [aria-pressed="true"] { box-shadow: inset 0 -2px var(--focus); }
.authors-sort button:focus-visible, .authors-genre select:focus-visible { outline-offset: -2px; }
.authors-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 0 clamp(16px, 3vw, 40px);
  margin-block: 0 24px;
  padding: 0;
  list-style: none;
}
.author-card { display: flex; flex-direction: column; align-items: stretch; min-width: 0; padding-block: 12px; border-bottom: 1px solid var(--line); }
.author-card-link {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  margin-bottom: 8px;
}
.author-card-initials, .writer-portrait {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: var(--radius-control);
  background: var(--tint);
  color: var(--accent-ink);
  font-weight: var(--weight-strong);
}
.author-card-link > svg { color: var(--muted); }
.author-card-link h2 { font-size: 1.1rem; font-weight: var(--weight-strong); line-height: 1.25; overflow-wrap: anywhere; }
.author-card-link p { margin-top: 2px; color: var(--muted); font-size: .82rem; line-height: 1.35; overflow-wrap: anywhere; text-wrap: pretty; }
.author-card-book {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 56px;
  margin-top: auto;
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius-control);
  background: var(--subtle);
  color: var(--ink);
  overflow-wrap: anywhere;
}
.author-card-book small, .author-card-book strong { display: block; }
.author-card-book small { color: var(--muted); font-size: .79rem; line-height: 1.3; }
.author-card-book strong { margin-top: 2px; font-size: .9rem; font-weight: var(--weight-label); line-height: 1.3; }
.author-card-cover { width: 100%; box-shadow: none; }
.author-card-cover::after { display: none; }
.author-card-link:hover h2, .author-card-book:hover strong { color: var(--accent-ink); }
.author-card-book:focus-visible { outline-offset: -2px; }
.authors-empty { margin-top: 16px; }

.writer-back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin-block: -8px 8px; }
.writer-header {
  display: grid;
  grid-template-columns: clamp(64px, 9vw, 104px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px clamp(12px, 2vw, 24px);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.writer-header h1 { font: var(--weight-heading) clamp(1.65rem, 4vw, 2.6rem)/1.15 var(--sans); letter-spacing: -.035em; overflow-wrap: anywhere; }
.writer-header .writer-portrait { width: 100%; font-size: clamp(1.15rem, 3vw, 1.9rem); }
.writer-genres { margin-top: 4px; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.writer-header .writer-actions .button { min-height: 44px; }
.writer-page .writer-bio { padding: 0; border: 0; background: transparent; }

@media (max-width: 570px) {
  .authors-heading { margin-bottom: 12px; }
  .authors-controls { grid-template-columns: minmax(0, 1fr) auto; }
  .authors-search { grid-column: 1 / -1; }
  .authors-sort { margin-top: 8px; }
  .authors-sort button { padding-inline: 10px; }
  .authors-grid { grid-template-columns: minmax(0, 1fr); }
  .writer-header { grid-template-columns: 64px minmax(0, 1fr); padding-bottom: 16px; }
  .writer-header .writer-actions { grid-column: 1 / -1; }
  .writer-header .writer-actions .button { width: 100%; }
}
