/* Lesestoff – bewusst klein: Systemschriften, keine externen Ressourcen, kein JavaScript. */

:root {
  --bg: #f6f1e7;
  --surface: #fffdf8;
  --text: #2a2620;
  --muted: #776e62;
  --line: #e4dccd;
  --accent: #9a3d1f;
  --accent-text: #fff;
  --star: #c2851a;
  --danger: #a3261b;
  --radius: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1916;
    --surface: #24211d;
    --text: #ece5d8;
    --muted: #a39a8c;
    --line: #3a352e;
    --accent: #e08a62;
    --accent-text: #1b1916;
    --star: #e2ac43;
    --danger: #f07c6e;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--sans);
}

a { color: var(--accent); text-underline-offset: 2px; }

h1, h2 { font-family: var(--serif); font-weight: 600; line-height: 1.2; }
h1 { font-size: 1.75rem; margin: 0 0 .5rem; }
h2 { font-size: 1.2rem; margin: 0 0 .75rem; }

main { max-width: 46rem; margin: 0 auto; padding: 1rem 1rem 4rem; }

/* Kopfzeile */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: 46rem; margin: 0 auto; padding: .9rem 1rem;
}
.brand { font: 600 1.35rem var(--serif); color: var(--text); text-decoration: none; }
.top nav { display: flex; gap: .25rem; }
.top nav a {
  color: var(--muted); text-decoration: none; padding: .35rem .6rem; border-radius: 999px; font-size: .95rem;
}
.top nav a[aria-current] { color: var(--text); background: var(--surface); box-shadow: 0 0 0 1px var(--line); }

/* Formulare */
input, select, textarea, button, .button { font: inherit; color: inherit; }
input:not([type=radio]):not([type=checkbox]):not([type=file]), select, textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
button, .button {
  display: inline-block; padding: .55rem 1rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); cursor: pointer; text-decoration: none; white-space: nowrap;
}
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
button.danger { border-color: var(--danger); color: var(--danger); }
button.link { border: 0; background: none; padding: .25rem; text-decoration: underline; color: var(--muted); }
button.link.danger { color: var(--danger); }

.stack { display: grid; gap: 1rem; }
.stack label { display: grid; gap: .3rem; font-weight: 500; }
.inline { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; }
.inline input[type=number] { width: 7rem; }
.inline select { width: auto; }
.inline input[type=search], .inline input[type=password] { flex: 1 1 14rem; width: auto; }
.inline label { display: grid; gap: .2rem; font-size: .9rem; color: var(--muted); }
.hint { font-weight: 400; font-size: .85rem; color: var(--muted); }

.searchbar { display: flex; gap: .5rem; margin: .5rem 0 1.25rem; }
.searchbar input { flex: 1; }

/* Bausteine */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; margin: 0 0 1rem;
}
.narrow { max-width: 26rem; margin: 2rem auto; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.error { color: var(--danger); }
.flash {
  background: var(--surface); border-left: 3px solid var(--accent); padding: .6rem .9rem; border-radius: 6px; margin: 0 0 1rem;
}
.badge {
  display: inline-block; font-size: .78rem; padding: .1rem .5rem; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line); color: var(--muted);
}
.stars { color: var(--star); letter-spacing: .05em; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.section-title { font-size: 1rem; font-family: var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 1.5rem; }
.plain { padding-left: 1.1rem; }
.plain li { margin: .25rem 0; }
.empty { text-align: center; padding: 3rem 0; }
.empty-tab { padding: 2rem 0; text-align: center; }

/* Tabs */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
.tabs a {
  padding: .5rem .75rem; color: var(--muted); text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a[aria-current] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.count { font-size: .8rem; color: var(--muted); font-weight: 400; }

/* Bücherlisten */
.books { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.books > li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.book { display: flex; gap: .9rem; padding: .7rem; color: inherit; text-decoration: none; align-items: flex-start; }
a.book:hover .book-title { color: var(--accent); }
.book-body { display: grid; gap: .2rem; min-width: 0; }
.book-title { font: 600 1.05rem/1.3 var(--serif); }
.book-authors { color: var(--muted); font-size: .92rem; }
.note { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.hit { display: grid; }
.add-form { display: flex; gap: .4rem; padding: 0 .7rem .7rem; flex-wrap: wrap; }
.add-form select { flex: 1; width: auto; }
.compact .book { padding: .5rem; }
.compact .cover { width: 2.5rem; }
.compact form { padding: 0 .5rem .5rem; }

/* Cover */
.cover {
  flex: none; width: 3.75rem; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px;
  background: var(--line); box-shadow: 0 1px 3px rgb(0 0 0 / .18);
}
.cover-l { width: 8rem; }
.cover-blank {
  display: flex; align-items: center; justify-content: center; padding: .3rem; overflow: hidden;
  background: linear-gradient(160deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #000));
  color: #fff; font: 600 .55rem/1.2 var(--serif); text-align: center;
}
.cover-l.cover-blank { font-size: .9rem; padding: .6rem; }

/* Fortschritt */
.progress-line span { white-space: nowrap; }
.progress-line { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--muted); }
progress { appearance: none; width: 9rem; height: .45rem; border: 0; border-radius: 999px; background: var(--line); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.progress-line.big progress { width: 100%; max-width: 20rem; height: .6rem; }
.progress-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: .5rem; align-items: end; }
.progress-form label { display: grid; gap: .2rem; font-size: .85rem; color: var(--muted); }
@media (max-width: 30rem) { .progress-form { grid-template-columns: repeat(3, minmax(0, 1fr)); } .progress-form button { grid-column: 1 / -1; } }
.history { list-style: none; padding: 0; margin: .75rem 0 0; }

/* Detailseite */
.detail-head { display: flex; gap: 1.25rem; align-items: flex-start; margin-bottom: 1.25rem; }
.subtitle { margin: -.25rem 0 .4rem; font-family: var(--serif); font-size: 1.1rem; color: var(--muted); }
.authors { margin: 0 0 .25rem; font-size: 1.05rem; }
.others { font-size: .9rem; margin: .5rem 0; }
.desc { margin-bottom: 1rem; }
.desc summary, details summary { cursor: pointer; color: var(--muted); font-size: .9rem; margin-bottom: .5rem; }
.prose { white-space: pre-line; font-family: var(--serif); font-size: 1.02rem; line-height: 1.6; }
.reading { margin-bottom: .75rem; }
.reading input[type=date] { width: auto; }
.remove { text-align: center; margin-top: 2rem; }
.stats { list-style: none; padding: 0; display: flex; gap: 1.5rem; flex-wrap: wrap; margin: .5rem 0 0; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }

/* Sternbewertung ohne JavaScript */
.rating { border: 0; padding: 0; margin: 0; }
.rating legend { font-weight: 500; padding: 0; margin-bottom: .3rem; }
.stars-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; }
.stars-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars-input label { cursor: pointer; font-size: 1.9rem; line-height: 1; padding: 0 .1rem; color: var(--line); }
.stars-input label::before { content: "★"; }
.stars-input input:checked ~ label,
.stars-input label:hover, .stars-input label:hover ~ label { color: var(--star); }
.rating .no-rating { display: flex; gap: .4rem; align-items: center; font-weight: 400; margin-top: .3rem; }
.stars-input input:focus-visible + label { outline: 2px solid var(--accent); border-radius: 4px; }

@media (max-width: 30rem) {
  h1 { font-size: 1.45rem; }
  .top { padding: .7rem 1rem; }
  .top nav a { padding: .3rem .45rem; font-size: .9rem; }
  .cover-l { width: 6rem; }
  .detail-head { gap: .9rem; }
  .card { padding: 1rem; }
  .tabs a { padding: .5rem .4rem; font-size: .9rem; }
}
