.hero-row { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.progress-note { max-width: 420px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; text-align: right; }

.header-actions { margin-left: auto; gap: 14px; }
.auth-actions, .user-actions { display: flex; align-items: center; gap: 12px; }
.user-copy { display: grid; gap: 3px; }
.user-copy strong { font-size: 14px; }
.user-copy span { color: var(--muted); font-size: 12px; }

.auth-shell { margin-bottom: 28px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 253, 249, .92); box-shadow: 0 10px 28px rgba(80, 52, 24, .08); }
.auth-forms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.auth-card { display: grid; gap: 12px; padding: 18px; border: 1px solid #eadfd2; border-radius: 12px; background: #fffdfa; }
.auth-card h2 { margin: 0; font: 26px/1.15 'Libre Baskerville', Georgia, serif; }
.auth-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.auth-card label { display: grid; gap: 6px; color: #3f3a35; font-size: 14px; font-weight: 500; }
.auth-card input { min-height: 48px; padding: 0 14px; border: 1px solid #d8c8b5; border-radius: 10px; background: white; }
.auth-message { min-height: 20px; margin: 0; font-size: 14px; }
.auth-welcome { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.auth-welcome strong { display: block; margin-bottom: 6px; font: 26px/1.2 'Libre Baskerville', Georgia, serif; }
.auth-welcome p { margin: 0; color: var(--muted); line-height: 1.7; }
.library-feedback { min-height: 22px; margin: 0 0 18px; color: var(--muted); font-size: 14px; }

.book-list { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 24px 34px; }
.book-card { position: relative; min-width: 0; overflow: hidden; background: var(--panel); border: 1px solid #eadfd2; border-radius: 8px; box-shadow: 0 3px 7px rgba(82,55,27,.12); transition: transform .18s, box-shadow .18s, border-color .18s; }
.book-card:hover { transform: translateY(-3px); box-shadow: 0 7px 16px rgba(82,55,27,.17); }
.book-card.favorite { border-color: #cfaa7c; box-shadow: 0 8px 18px rgba(149, 92, 42, .18); }
.book-card .difficulty-badge { position: absolute; top: 10px; left: 10px; z-index: 2; }
.book-link { display: block; color: inherit; }
.cover, .cover-placeholder { display: block; width: 100%; aspect-ratio: .72; object-fit: cover; background: linear-gradient(145deg, #243733, #101918); }
.cover-placeholder { display: grid; place-items: center; color: #d6b47c; padding: 20px; text-align: center; font: 20px/1.4 'Libre Baskerville', Georgia, serif; }
.book-info { padding: 12px 13px 15px; }
.book-title { margin: 0 0 4px; min-height: 44px; font: 16px/1.3 'Libre Baskerville', Georgia, serif; }
.book-author { margin: 0; color: #514d49; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-progress-label { margin: 16px 0 6px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.progress-row { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.progress-track { flex: 1; height: 4px; background: #e9dfd2; border-radius: 999px; overflow: hidden; }
.progress-value { display: block; height: 100%; background: #79502c; border-radius: inherit; }
.favorite-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 999px;
  background: rgba(255, 253, 249, .92);
  color: #7f7569;
  font-size: 22px;
  line-height: 1;
  transition: transform .16s ease, background .16s ease, color .16s ease, border-color .16s ease;
}
.favorite-toggle:hover { transform: scale(1.05); }
.favorite-toggle.active { color: #b06c2a; border-color: rgba(176, 108, 42, .42); background: rgba(255, 245, 232, .97); }
.favorite-toggle:disabled { cursor: wait; opacity: .75; }
.pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 12px; margin: 34px 0 10px; }
.pagination a { min-width: 38px; height: 38px; display: grid; place-items: center; border-radius: 4px; }
.pagination a[aria-current="page"] { background: var(--accent); color: white; }

.book-list.new-words-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.new-words-toolbar {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid #eadfd2;
  border-radius: 14px;
  background: rgba(255, 253, 249, .96);
  box-shadow: 0 10px 24px rgba(80,52,24,.06);
}
.new-words-toolbar-copy { margin: 0; color: #4d453d; font-size: 14px; }
.new-words-toolbar-copy strong { color: var(--accent-dark); font-size: 18px; }
.new-words-toolbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.new-word-card {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid #eadfd2;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(250,245,238,.96));
  box-shadow: 0 10px 28px rgba(80,52,24,.08);
}
.new-word-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.new-word-copy { display: grid; gap: 10px; min-width: 0; }
.new-word-select {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.new-word-select input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}
.new-word-body { min-width: 0; }
.new-word-title { margin: 0 0 10px; font: 28px/1.1 'Libre Baskerville', Georgia, serif; }
.new-word-translation { margin: 0 0 12px; color: #4d453d; font-size: 16px; line-height: 1.7; }
.new-word-meta { margin: 0; color: var(--muted); font-size: 13px; letter-spacing: .03em; }
.remove-word-button { white-space: nowrap; }

@media (max-width: 1150px) {
  .book-list { grid-template-columns: repeat(4, 1fr); }
  .book-list.new-words-list { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .hero-row { display: grid; gap: 12px; }
  .progress-note { max-width: none; text-align: left; }
  .auth-forms { grid-template-columns: 1fr; }
  .user-copy { display: none; }
  .new-words-toolbar { display: grid; grid-template-columns: 1fr; }
  .new-words-toolbar-actions { justify-content: start; }
  .new-word-head { display: grid; grid-template-columns: 1fr; }
  .remove-word-button { justify-self: start; }
}

@media (max-width: 700px) {
  .auth-shell { padding: 16px; }
  .auth-card { padding: 16px; }
  .book-list { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .book-list.new-words-list { grid-template-columns: 1fr; }
  .auth-actions { width: 100%; justify-content: flex-end; }
  .user-actions { width: 100%; justify-content: flex-end; }
  .new-word-card { padding: 18px; border-radius: 14px; }
  .new-word-title { font-size: 24px; }
  .new-word-translation { font-size: 15px; }
}
