:root {
  font: 15px Arial, "DejaVu Sans", sans-serif;
  color: #314653;
  background: #dce5ef;
  --ink: #314653;
  --muted: #536777;
  --cream: radial-gradient(ellipse at 31% 16%, #fff9ee, #f5e5d0 60%, #dcc4ac);
  --blue: radial-gradient(ellipse at 31% 16%, #abc1ce, #7796a9 60%, #526f84);
  --glass: radial-gradient(ellipse at 31% 16%, #f3f5fc, #dce5ef 60%, #bac9dd);
  --light: #fff8ed;
  --edge: #fff8ed;
  --shadow: 0 3px 1px #b69e89, 1px 5px 8px #40567255, inset 0 0 0 2px #fffefa55;
  --blue-shadow: 0 3px 1px #4e6a7c, 1px 5px 8px #40567255, inset 0 0 0 2px #fffefa55;
}
*, *::before, *::after { box-sizing: border-box }
body { margin: 0; min-height: 100dvh; padding-bottom: calc(91px + env(safe-area-inset-bottom)); background: linear-gradient(180deg,#fbebed30,#dbe6f34f,#e6ecf739), url(forest.jpg) center / cover fixed no-repeat }
[hidden] { display: none !important }
img { max-width: 100%; display: block }
button, select, input, textarea { font: inherit; color: inherit }
button, select { cursor: pointer }
button, select, .panel, .book, .listrow, .entry-section, .entry-heading, .series-unit, .open-diary, #auth, .empty, dialog, .stats-grid > div {
  background: var(--cream); border: 1px solid var(--edge); border-radius: 17px; box-shadow: var(--shadow);
}
button, select { min-height: 44px; padding: 8px 13px; font-size: 14px; font-weight: 700 }
button:disabled, select:disabled { opacity: .58; cursor: default }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid #405672; outline-offset: 3px }
button:active:not(:disabled) { box-shadow: 0 1px 1px #7f7570, inset 0 0 0 2px #fffefa55 }
.primary, #add, #editEntry, #newSeries, #owned[aria-pressed=true], #wanted[aria-pressed=true], .choice[aria-pressed=true], .tile-face.active, #nav button[aria-pressed=true] .nav-icon {
  color: var(--light); background: var(--blue); box-shadow: var(--blue-shadow); border-color: #b6cedb;
}
a { color: inherit }
h1, h2, h3, p, dl, dd { margin: 0 }
header { padding: calc(10px + env(safe-area-inset-top)) 16px 0 }
.top { max-width: 620px; margin: auto; display: flex; align-items: center; gap: 8px }
.brand { display: flex; gap: 10px; align-items: center; flex: 1; font: 20px Georgia, "DejaVu Serif", serif; color: #263d51 }
.brand-snowflake::before { content: "❄"; color: #688fa5 }
#logout { box-shadow: none; background: none; border: 0; font-weight: 400; padding-inline: 8px }
#add { width: 44px; padding: 0; font-size: 28px }
main { margin: auto; max-width: 620px; padding: 8px 17px 0 }
#side { display: none }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 11px; min-height: 45px }
.toolbar h1, .toolbar h2 { font: 30px Georgia, "DejaVu Serif", serif; color: #263d51; overflow-wrap: anywhere }
.toolbar.subheading { justify-content: flex-start }
.subheading button { width: 44px; flex: 0 0 44px; padding: 0; font-size: 25px }
.year-chip { min-width: 104px }
#nav { position: fixed; z-index: 3; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom)); width: min(calc(100% - 18px), 604px); display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); padding: 0 2px 3px; border-radius: 23px; border: 1px solid #fff9f0; box-shadow: 0 4px 10px #40567245; background: var(--glass) }
#nav button { background: transparent; border: 0; box-shadow: none; color: var(--ink); font-size: 10.5px; font-weight: 400; display: grid; justify-items: center; align-content: end; gap: 4px; min-height: 64px; padding: 0 1px 1px }
#nav button[aria-pressed=true] { font-weight: 700 }
.nav-icon, .tile-face { display: grid; place-items: center; background: var(--cream); border: 1px solid var(--edge); box-shadow: var(--shadow) }
.nav-icon { width: 50px; max-width: 96%; height: 45px; border-radius: 15px }
.nav-icon img { width: 30px }
.signed-out #nav, .signed-out main, .signed-out #add, .signed-out #logout { display: none }
#auth { margin: 23px auto; width: min(calc(100% - 34px), 456px); padding: 20px }
#auth h2 { font: 28px Georgia, serif; margin-bottom: 165px; position: relative }
#auth h2::after { content: ""; position: absolute; top: 44px; left: 0; right: 0; height: 140px; border-radius: 17px; background: url(cat.jpg) center / cover }
#auth form { display: grid; gap: 10px }
#auth form > button { width: 100% }
label { display: grid; gap: 6px; font-size: 14px; min-width: 0 }
input:not([type=checkbox]), textarea { width: 100%; min-width: 0; border-radius: 12px; min-height: 44px; background: #fffaf1; border: 1px solid #b2bec8; padding: 8px 10px; font-size: 16px }
input[type=checkbox] { accent-color: #5f8196; width: 19px; height: 19px }
textarea { min-height: 76px; resize: vertical }
label:has(>input[type=checkbox]) { display: flex; align-items: center }
.filters { display: flex; gap: 10px; margin: 14px 0 17px }
.filters > * { flex: 1; min-width: 0 }
.diary-filters { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin: 15px 0 18px }
.filter-tile { background: none; border: 0; border-radius: 10px; box-shadow: none; display: grid; justify-items: center; align-content: start; gap: 8px; padding: 0; font-size: 12px; min-height: 80px }
.filter-tile .tile-face { width: 69px; height: 62px; border-radius: 20px }
.filter-tile img { width: 39px }
.open-diary { padding: 5px 5px 10px; border-radius: 22px }
.hero-art, .collections-art, .stats-art { width: 100%; object-fit: cover; border: 1px solid #fff9f2; border-radius: 17px }
.hero-art { height: 109px }
.current-book { background: transparent; box-shadow: none; border: 0; display: flex; width: 100%; align-items: center; gap: 12px; padding: 4px 10px 0; text-align: left; min-height: 104px; overflow-wrap: anywhere }
.current-book:first-of-type .cover { margin-top: -36px; position: relative }
.current-book .cover { flex-shrink: 0; width: 74px }
.current-book strong { font-size: 17px; display: block; margin: 6px 0 }
.current-book small { display: block; font-size: 12px; color: var(--muted) }
.open-book-action { display: inline-block; margin-top: 8px; font-size: 13px }
.cover { display: grid; place-items: center; width: 100%; aspect-ratio: 2/3; border-radius: 6px; background: var(--cover,#859ead); box-shadow: 2px 3px 0 #53677755; overflow: hidden; color:#fff8e9; padding: 4px }
.cover:has(img) { background: transparent; padding: 0 }
.cover img { width: 100%; height: 100%; object-fit: contain; border-radius: 6px; min-height: 0 }
.cover > span { width: 100%; height: 100%; border: 1px solid #f3e8d597; display: grid; align-content: center; justify-items: center; text-align: center; overflow-wrap: anywhere; font-size: 11px; padding: 3px }
.orn { font-size: 18px }
.month { font: 21px Georgia, "DejaVu Serif", serif; margin: 13px 3px 15px; color: #263d51 }
.month small { float: right; font: 13px Arial, sans-serif; color: var(--muted); padding-top: 5px }
.grid { display: grid; gap: 10px }
.book { min-width: 0; padding: 9px 13px; min-height: 77px; display: grid; grid-template-columns: 39px minmax(0,1fr) 12px; column-gap: 12px; align-content: center; align-items: center }
.book-open { display: contents }
.book-open .cover { grid-column: 1; grid-row: 1 / span 3 }
.book-open strong { grid-column: 2; grid-row: 1; font-size: 14px; text-align: left; overflow-wrap: anywhere }
.book-open::after { content: "›"; grid-column: 3; grid-row: 1 / span 3; font-size: 22px; font-weight: 400; align-self: center }
.author-link { background: transparent; border: 0; box-shadow: none; padding: 3px 0; min-height: 24px; font-weight: 400; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; text-align: left }
.book > .author-link, .book > small { grid-column: 2 }
.book > small, .muted, .note { color: var(--muted) }
.book-open:focus-visible strong { outline: 2px solid var(--ink) }
.empty, .panel { padding: 16px }
.collections-art { height: 143px }
.collection-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 15px 0 22px }
.collection-actions button:first-child { color: var(--light); background: var(--blue); box-shadow: var(--blue-shadow) }
.collection-heading { margin-top: 19px }
.collection-heading h3 { font: 20px Georgia, serif }
.goal-panel { display: grid; grid-template-columns: minmax(100px, 40%) minmax(0,1fr); align-items: center; gap: 14px; min-height: 239px }
.goal-panel > .primary { grid-column: 1/-1 }
.goal-dial { display: grid; place-items: center; aspect-ratio: 1; max-width: 123px; border-radius: 50%; background: conic-gradient(#638799 var(--progress),#d4dfe6 0); padding: 10px; width: 100%; margin: auto }
.goal-dial strong { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: #fbefdf; font-size: 20px; text-align: center }
.goal-copy { display: grid; gap: 8px; align-content: center }
.goal-copy strong { font-size: 19px }
.goal-copy small { color: var(--muted) }
.must-read-heading { margin-top: 21px; display: grid; gap: 12px }
.must-read-heading h3 { font: inherit }
.stats-art { height: 135px }
.stats-grid { display: grid; gap: 13px }
.stats-grid > div { min-height: 64px; display: flex; justify-content: space-between; align-items: center; font-weight: 700 }
.stats-grid > div:first-child { background: var(--blue); color: var(--light); box-shadow: var(--blue-shadow) }
.stats-grid dd { font-size: 23px }
.archive-shelf .grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; padding: 12px; background: var(--glass); border-radius: 23px }
.archive-shelf .book { display: flex; flex-direction: column; justify-content: flex-start; text-align: center; background: transparent; box-shadow: none; border: none; padding: 8px 3px; gap: 6px }
.archive-shelf .book-open strong { text-align: center }
.archive-shelf .book-open::after { content: none }
.archive-shelf .cover { max-width: 99px }
.archive-shelf .author-link { text-align: center }
#newSeries { width: 100%; margin-bottom: 20px }
.series-unit { padding: 13px 11px 15px; margin-bottom: 18px; border-radius: 23px; background: var(--glass) }
.series-title { width: 100%; margin-bottom: 14px; overflow-wrap: anywhere }
.series-shelf { display: flex; overflow-x: auto; align-items: stretch }
.shelf-item { flex: 0 0 33.333%; min-width: 97px }
.shelf-book { display: grid; grid-template-rows: 91px auto auto; width: 100%; align-content: start; justify-items: center; background: none; box-shadow: none; border: 0; border-radius: 0; padding: 0 0 5px; gap: 0 }
.shelf-cover { display: grid; align-items: end; justify-items: center; width: 100%; position: relative; border-bottom: 6px solid #8fa9bb; padding-bottom: 4px }
.shelf-cover .cover { width: 66px; height: 81px }
.shelf-book strong { font-size: 12px; line-height: 14px; padding: 6px 3px 0; overflow-wrap: anywhere }
.shelf-book small { font-weight: 400; font-size: 11px; color: var(--muted); margin: 5px 2px 0; overflow-wrap: anywhere }
.read-badge { position: absolute; top: 42px; left: 50%; transform: translate(-50%,-50%); width: 30px; height: 30px; display: grid; place-items: center; background: radial-gradient(at 34% 22%,#d3a9d0,#aa70a6 55%,#754570); border: 1px solid #f2ddee; box-shadow: 0 2px 2px #623f61; border-radius: 50%; color: #fff8ef; font-size: 17px }
.entry-paper { display: grid; gap: 12px }
.entry-heading { padding: 18px 15px 16px; display: grid; grid-template-columns: minmax(74px,34%) minmax(0,1fr); column-gap: 18px }
.entry-heading > .cover { align-self: start }
.entry-author .author-link { font-weight: 700; font-size: 14px }
.entry-meta { display: grid; gap: 3px; color: var(--muted); font-size: 12px }
.entry-meta div { display: flex; flex-wrap: wrap; gap: 4px }
.entry-rating { margin: 10px 0; color: #835848 }
#editEntry { width: 100%; max-width: 210px }
.entry-section { padding: 10px 13px; overflow-wrap: anywhere }
.entry-section h2 { font-size: 15px; margin-bottom: 5px }
.entry-section p { color: var(--muted); font-size: 13px; white-space: pre-wrap }
.image-heading { display: flex; justify-content: space-between; gap: 8px }
.entry-images { display: flex; overflow-x: auto; gap: 6px; padding: 4px 0 }
.entry-images img { flex: 0 0 calc((100% - 12px)/3); width: calc((100% - 12px)/3); height: 77px; object-fit: cover; border-radius: 11px }
.entry-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; font-size: 13px; color: var(--muted) }
.bell-hall { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px 9px }
.bell-door { aspect-ratio: 1; display: grid; place-content: center; justify-items: center; gap: 5px; padding: 6px; font-weight: 400 }
.bell-door:nth-child(odd) { background: var(--blue); color: var(--light); box-shadow: var(--blue-shadow) }
.door-panel { width: 42px; height: 56px; border-radius: 22px 22px 0 0; border: 2px solid #f9eddb; background: #adc0ca; position: relative }
.door-panel::after { content: ""; display: block; position: absolute; top: 54%; right: 5px; border-radius: 50%; background: #6d8491; width: 4px; height: 4px }
.door-base,.door-knob { display: none }
dialog { position: fixed; inset: 0; margin: auto; width: min(calc(100vw - 18px), 525px); max-height: calc(100dvh - 26px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 16px 17px 20px; border-radius: 25px; overflow: auto; overscroll-behavior: contain }
dialog::backdrop { background: #283d535e }
.dialog-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 13px }
.dialog-top h2 { font-size: 21px; overflow-wrap: anywhere }
#close, #close-bell { width: 40px; min-height: 40px; padding: 0; flex: 0 0 40px; font-size: 17px; border-radius: 13px }
#form { display: grid; gap: 10px }
#form select { width: 100%; background: #fffaf1; box-shadow: none; border-color: #b2bec8; border-radius: 12px }
#form #status:empty { display: none }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px }
.formgrid:has(>label:first-child input[name=title]) { grid-template-columns: 1fr }
.choice-grid { display: grid; gap: 7px }
.choice-year,.choice-month { grid-template-columns: repeat(2,minmax(0,1fr)) }
.choice-month .choice:first-child { grid-column: 1/-1 }
.choice { display: flex; align-items: center; justify-content: space-between; gap: 4px; text-align: left; padding-inline: 13px; min-width: 0; overflow-wrap: anywhere }
.choice span { visibility: hidden }
.choice[aria-pressed=true] span { visibility: visible }
.choice-actions { display: grid; grid-template-columns: 125px minmax(0,1fr); gap: 10px; margin-top: 18px }
.picker-row { display: grid !important; grid-template-columns: 22px 42px minmax(0,1fr); align-items: center; gap: 10px; padding: 5px 0 }
.picker-row[hidden] { display: none !important }
.picker-text small, .author-book small { display: block; color: var(--muted); margin-top: 4px }
.author-books, .must-read-options { display: grid; gap: 6px; overflow: auto }
.author-books .author-book { display: grid; grid-template-columns: 46px 1fr; align-items: center; text-align: left; gap: 12px }
.goal-stepper { display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; gap: 10px }
.goal-stepper input { text-align: center }
.rating button { padding: 6px }
.gallery { display: flex; overflow: auto; gap: 9px }
.gallery:empty { display: none }
.edit-image { flex: 0 0 94px }
.edit-image img,.cover-preview { width: 89px; max-height: 130px; object-fit: contain }
.marked-for-removal { opacity: .5 }
#bell-scene { padding: 10px; width: min(calc(100% - 28px), 520px) }
#close-bell { position: absolute; top: 14px; right: 14px }
#bell-image { width: 100%; border-radius: 17px }
@media (min-width: 650px) {
  .bell-hall { grid-template-columns: repeat(5,minmax(0,1fr)) }
}
.header-actions { display: flex; align-items: center; gap: 8px }
dialog { max-width: none }
.current-book:first-of-type .cover { transform: translateY(-17px) }
.book-open { display: grid; grid-column: 1/-1; grid-row: 1/4; grid-template-columns: subgrid; grid-template-rows: subgrid; color: inherit; background: none; box-shadow: none; border: 0; border-radius: 6px; padding: 0; min-height: 0 }
.book > .author-link { grid-row: 2; z-index: 1; justify-self: start }
.book > small { grid-row: 3; z-index: 1; pointer-events: none }
.book > small + small { grid-row: 4 }
.archive-shelf .book-open { display: grid; grid-template-columns: 1fr; grid-template-rows: auto auto; justify-items: center; gap: 8px; width: 100% }
.archive-shelf .book-open .cover, .archive-shelf .book-open strong { grid-row: auto; grid-column: 1 }
.archive-shelf .book > .author-link { justify-self: center }
.image-picker-control { position: relative; display: flex; align-items: center; min-height: 44px; padding: 9px 13px; border: 1px solid var(--edge); border-radius: 15px; background: var(--cream); box-shadow: var(--shadow) }
.image-picker-control input[type=file] { opacity: 0; position: absolute; inset: 0; padding: 0; cursor: pointer }
.image-picker-control:focus-within { outline: 2px solid #405672; outline-offset: 3px }
.image-picker-status:empty { display: none }
html { scrollbar-width: none }
html::-webkit-scrollbar { display: none }
dialog { color: var(--ink) }
body:has(dialog[open]) { overflow: hidden }
.series-unit { min-height: 246px; margin-bottom: 20px }
#newSeries { margin-bottom: 24px }
