:root {
  color: #252a26;
  background: #f7f6ef;
  font: 16px/1.55 system-ui, sans-serif;
  --ink: #243b32;
  --surface: #fffdf7;
  --border: #d5d8cd;
}
* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 72rem; margin: auto; padding: clamp(1rem, 4vw, 3rem); }
a { color: var(--ink); text-underline-offset: .2em; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin-top: 0; font-size: clamp(1.65rem, 3.5vw, 2.5rem); }
h2 { margin-top: 0; font-size: 1.2rem; }
.top, nav, .row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.top { padding: .7rem clamp(1rem, 4vw, 3rem); border-bottom: 1px solid var(--border); }
.brand { font-weight: 700; margin-right: auto; text-decoration: none; }
nav { margin-inline: .5rem; }
form, label:not(.row) { display: grid; gap: .55rem; }
input, textarea, select, button, .button {
  font: inherit;
  border: 1px solid var(--border);
  border-radius: .4rem;
  padding: .45rem .7rem;
  background: white;
  color: inherit;
  min-height: 2.75rem;
  max-width: 100%;
}
input[type=checkbox] { min-height: auto; }
button, summary { cursor: pointer; }
button, .button { width: fit-content; }
.primary { background: var(--ink); color: white; }
.button { display: inline-block; text-decoration: none; }
.panel { padding: 1.1rem; margin: 1rem 0; background: var(--surface); border: 1px solid var(--border); border-radius: .65rem; }
summary { padding: .25rem 0; }
details[open] > summary { margin-bottom: .75rem; }
.login { max-width: 27rem; margin: 2rem auto; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(9rem, 100%), 1fr)); gap: 1rem; }
.book img, .placeholder { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: .45rem; }
.placeholder { background: #dbe5d9; color: var(--ink); display: grid; align-content: center; padding: .8rem; overflow: hidden; overflow-wrap: anywhere; font-weight: 700; }
.book h2, .book p { margin: .3rem 0; }
.book a { text-decoration: none; }
.book p { color: #4b5a51; }
.status { padding: .65rem; background: #e1ebdf; }
.note, blockquote { white-space: pre-wrap; overflow-wrap: anywhere; }
#reader {
  margin-top: 1rem;
  padding: clamp(1rem, 4vw, 3rem);
  height: 68vh;
  overflow: auto;
  background: white;
  color: #181e1a;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 1.1rem/1.85 Georgia, serif;
}
#reader[data-font=large] { font-size: 1.35rem; }
#reader[data-font=xlarge] { font-size: 1.65rem; }
#reader[data-theme=warm] { color: #362719; background: #f5e7cc; }
#reader[data-theme=dark] { color: #e6e9e5; background: #222925; }
::highlight(saved-annotations) { color: #242017; background: #f4d884; }
#pdf-display { overflow: auto; margin: .7rem 0 1rem; background: #ecece5; }
#pdf-canvas { display: block; margin-inline: auto; }
#pdf-page { width: 7rem; }
#pdf-reader[data-theme=warm] canvas { filter: sepia(.32); }
#pdf-reader[data-theme=dark] canvas { filter: invert(.88) hue-rotate(180deg); }
#chapter-jump { max-inline-size: min(23rem, 68vw); }
