#kindle-button, #calibre-fallback, #save-word { display: none !important; }

.portal {
  --paper: #f7f4ec;
  --ink: #29372c;
  --muted: #545d50;
  --rule: #c2c8ba;
  --accent: #355a43;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.5 system-ui, sans-serif;
}
.portal *, .portal *::after { box-sizing: border-box; }
.portal a { color: var(--accent); }
.portal-header { border-bottom: 1px solid var(--rule); padding: .7rem clamp(1.1rem, 5vw, 4rem); }
.portal-header a { font: 600 1.5rem Georgia, serif; text-decoration: none; }
.portal main { max-width: 78rem; margin: 0 auto; padding: clamp(1.1rem, 5vw, 3rem); }
.portal h1, .portal h2 { margin: 0 0 .8rem; font-family: Georgia, serif; line-height: 1.12; font-weight: 500; }
.portal h1 { font-size: clamp(2rem, 6vw, 3.4rem); }
.portal h2 { font-size: 1.5rem; }
.portal p { margin: 0 0 1rem; }
.portal .filters { display: grid; grid-template-columns: minmax(12rem, 2fr) repeat(2, minmax(9rem, 1fr)); gap: .75rem; margin: 1.5rem 0 1rem; }
.portal label { display: block; font-size: .88rem; font-weight: 600; }
.portal label[hidden] { display: none; }
.portal input, .portal select, .portal textarea {
  display: block; width: 100%; font: inherit; font-size: 1rem; font-weight: 400; color: var(--ink);
  background: #fffcf6; border: 1px solid #8b9988; border-radius: .4rem; min-height: 2.75rem; margin-top: .3rem; padding: .5rem;
}
.portal .count, .portal .books span, .portal .authors { color: var(--muted); }
.portal .books { padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr)); gap: 1.5rem 1rem; }
.portal .books a { display: block; text-decoration: none; }
.portal .books a:hover strong { text-decoration: underline; }
.portal .jacket { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: contain; border-radius: .35rem; background: #e7e5d7; }
.portal .placeholder { display: grid; place-items: center; padding: .6rem; text-align: center; color: #354739; font: 1rem Georgia, serif; overflow-wrap: anywhere; }
.portal .books strong { display: block; margin-top: .5rem; color: var(--ink); line-height: 1.3; overflow-wrap: anywhere; }
.portal .books span { display: block; margin-top: .2rem; font-size: .9rem; }
.portal .back-link { display: inline-block; margin-bottom: 1rem; }
.portal .book-heading { display: grid; grid-template-columns: minmax(6rem, 13rem) minmax(0, 1fr); align-items: start; gap: clamp(.9rem, 4vw, 2.5rem); }
.portal .book-heading h1 { overflow-wrap: anywhere; }
.portal .actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.portal .button, .portal button { display: inline-flex; align-items: center; min-height: 2.75rem; border: 1px solid var(--accent); border-radius: .4rem; padding: .5rem .85rem; font: inherit; cursor: pointer; text-decoration: none; background: transparent; color: var(--accent); }
.portal .primary, .portal button { background: var(--accent); color: white; }
.portal .description { margin: 1.5rem 0; max-width: 68ch; white-space: pre-wrap; }
.portal .personal { display: grid; grid-template-columns: 1fr 1.4fr; gap: 1.2rem; margin-top: 1.5rem; }
.portal form, .portal .diary { border-top: 1px solid var(--rule); padding-top: 1.1rem; }
.portal form label, .portal form button { margin-bottom: .65rem; }
.portal .diary { margin-top: 2rem; }
.portal .diary h3 { font-size: .95rem; margin-bottom: .25rem; }
.portal .diary p { white-space: pre-wrap; }
.portal :focus-visible { outline: 2px solid #226b50; outline-offset: 3px; }

@media (max-width: 34rem) {
  .portal .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal .filters label:first-child { grid-column: 1 / -1; }
  .portal .books { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal .book-heading { grid-template-columns: 5.5rem minmax(0, 1fr); }
  .portal .personal { grid-template-columns: 1fr; }
}
