:root {
  --plum: #6b2d5c;
  --plum-soft: #f4e8f0;
  --ink: #241b22;
  --muted: #7a6a75;
  --line: #e6dce3;
  --bg: #fbf8fa;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.55 Georgia, "Iowan Old Style", serif;
  color: var(--ink);
  background: var(--bg);
}
header {
  display: flex; align-items: center; gap: 2rem; flex-wrap: wrap;
  padding: 1rem 2rem; background: var(--plum); color: white;
}
header a { color: white; text-decoration: none; }
.brand { font-weight: bold; font-size: 1.2rem; }
nav { display: flex; gap: 1.2rem; font-family: system-ui, sans-serif; font-size: .95rem; }
nav a { opacity: .8; padding-bottom: 2px; border-bottom: 2px solid transparent; }
nav a.active, nav a:hover { opacity: 1; border-color: white; }
main { max-width: 760px; margin: 2rem auto; padding: 0 1.5rem; }
h1 { font-size: 2rem; margin: 0 0 1rem; }
h2 { margin-top: 2rem; font-size: 1.25rem; }
a { color: var(--plum); }
footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 3rem 0 2rem; }

.tabs { font-family: system-ui, sans-serif; font-size: .9rem; }
.tabs a { margin-right: .4rem; padding: .25rem .7rem; border-radius: 999px; text-decoration: none; }
.tabs a.on { background: var(--plum); color: white; }

.books { list-style: none; padding: 0; }
.book {
  display: grid; grid-template-columns: 1fr auto auto; gap: .2rem 1rem; align-items: center;
  padding: .9rem 0; border-bottom: 1px solid var(--line);
}
.book a { text-decoration: none; font-size: 1.1rem; }
.book .author { grid-column: 1; grid-row: 2; color: var(--muted); font-style: italic; }
.empty { color: var(--muted); padding: 1rem 0; }

.badge {
  font: .75rem system-ui, sans-serif; padding: .15rem .55rem; border-radius: 999px;
  background: var(--plum-soft); color: var(--plum); white-space: nowrap;
}
.badge.reading { background: #fff2cc; color: #7a5a00; }
.badge.done { background: #dff3e4; color: #1f6b35; }
.stars { color: #c08a00; letter-spacing: 1px; }

.byline { color: var(--muted); }
.card {
  display: grid; gap: .8rem; background: white; border: 1px solid var(--line);
  border-radius: 10px; padding: 1.2rem; margin: 1rem 0;
}
.card.row { grid-template-columns: 1fr 1fr auto; align-items: end; }
label { display: grid; gap: .3rem; font: .85rem system-ui, sans-serif; color: var(--muted); }
input, select, textarea {
  font: 1rem Georgia, serif; padding: .5rem .6rem; border: 1px solid var(--line);
  border-radius: 6px; background: white; color: var(--ink);
}
button {
  font: .95rem system-ui, sans-serif; padding: .55rem 1.1rem; border: 0; border-radius: 6px;
  background: var(--plum); color: white; cursor: pointer; justify-self: start;
}
button:hover { filter: brightness(1.15); }
.danger { margin-top: 2.5rem; }
.danger button { background: none; color: #a3302a; border: 1px solid #e3b7b4; }
.error { color: #a3302a; }

.notes { list-style: none; padding: 0; }
.notes li { padding: .6rem 0; border-bottom: 1px dashed var(--line); white-space: pre-wrap; }
.notes time { display: block; font: .75rem system-ui, sans-serif; color: var(--muted); }

.big { font-size: 1.3rem; }
.stats { width: 100%; border-collapse: collapse; }
.stats th { text-align: left; font-weight: normal; width: 30%; }
.stats td, .stats th { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.stats td:nth-child(2) { width: 3rem; text-align: right; padding-right: 1rem; }
.bar span { display: block; height: .7rem; border-radius: 4px; background: var(--plum); min-width: 2px; }
.muted { color: var(--muted); }
.prose { max-width: 60ch; }

@media (max-width: 560px) {
  .card.row { grid-template-columns: 1fr; }
  header { gap: .8rem; }
}
