:root {
  color-scheme: light;
  --paper: #f8faf7;
  --surface: #fff;
  --ink: #27352e;
  --muted: #5b6b61;
  --line: #dce4dc;
  --forest: #285642;
  --leaf: #e9f1e8;
  --rust: #9a462f;
  --amber: #865622;
  --serif: Georgia, 'Times New Roman', serif;
}
* { box-sizing: border-box; letter-spacing: 0; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #739a80; outline-offset: 3px; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { overflow-wrap: anywhere; }
h1 { font: 700 43px/1.15 var(--serif); }
h2 { font: 700 24px/1.2 var(--serif); }
.muted { color: var(--muted); overflow-wrap: anywhere; }
.icon { width: 17px; height: 17px; flex: 0 0 17px; vertical-align: middle; }
.wrap { width: min(100% - 64px, 1192px); margin-inline: auto; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 70px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 11px; font: 700 24px/1 var(--serif); }
.brand-icon { display: grid; place-items: center; width: 36px; height: 36px; background: var(--forest); border-radius: 7px; }
.brand-icon .icon, .primary .icon, .destructive .icon { filter: invert(1); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.demo-label { font-size: 12px; color: var(--muted); }
.icon-button { width: 40px; height: 40px; display: inline-grid; place-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; flex: 0 0 40px; }
.icon-button:hover, .outline:hover { background: var(--leaf); }
.workspace { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 36px; }
.sidebar { min-height: calc(100vh - 71px); padding: 42px 18px 30px 0; border-right: 1px solid var(--line); }
.rail-label, .eyebrow { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.rail-selected { display: flex; gap: 10px; align-items: center; min-height: 43px; margin: 13px 0 31px; padding: 8px 11px; border-radius: 6px; background: var(--leaf); color: var(--forest); font-weight: 650; }
.rail-links { border-top: 1px solid var(--line); padding: 18px 0 0; }
.rail-links h2 { font: 650 12px/1.4 system-ui, sans-serif; margin: 0 0 8px; }
.rail-links a, .mobile-links a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; color: var(--muted); font-size: 13px; }
.rail-links a:hover, .mobile-links a:hover { color: var(--forest); text-decoration: underline; }
.rail-links .icon, .mobile-links .icon { width: 13px; height: 13px; flex-basis: 13px; opacity: .6; }
.mobile-links { display: none; }
.shelf { padding: 36px 0 48px; min-width: 0; }
.heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.heading .eyebrow { margin-bottom: 6px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 43px; padding: 9px 14px; border: 1px solid transparent; border-radius: 6px; font-size: 13px; font-weight: 650; text-align: center; max-width: 100%; }
.primary { background: var(--forest); color: white; }
.primary:hover { background: #1f4634; }
.outline { border-color: var(--line); background: var(--surface); }
.destructive { background: var(--rust); color: white; }
.counts { margin: 21px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block: 1px solid var(--line); }
.counts > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 54px; padding: 8px 16px; border-left: 1px solid var(--line); }
.counts > div:first-child { padding-left: 0; border-left: 0; }
.counts dt { font-size: 12px; color: var(--muted); }
.counts dd { order: -1; font: 700 22px/1 var(--serif); }
.current { margin-top: 21px; padding: 16px 19px; display: grid; grid-template-columns: 79px minmax(0,1fr) auto; align-items: center; gap: 17px; background: #eef4ed; border-left: 3px solid #719881; }
.cover { display: block; width: 70px; height: 102px; object-fit: cover; border-radius: 3px; background: #e2e9df; box-shadow: 0 2px 6px #26372d24; }
.current .cover { width: 79px; height: 114px; }
.current-copy h2 { margin: 5px 0 2px; }
.current-copy .muted { font-size: 13px; }
.cover-placeholder { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: #365948; color: white; font: 700 32px/1 var(--serif); }
.cover-asset { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-placeholder .icon { filter: invert(1); opacity: .75; }
.shade-1 { background: #845440; }.shade-2 { background: #425b73; }.shade-3 { background: #6b5370; }
.books { margin-top: 28px; }
.collection-heading { display: flex; align-items: center; justify-content: space-between; gap: 13px; }
.search { display: flex; min-width: 0; width: min(100%, 265px); align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.search input { min-width: 0; width: 100%; height: 39px; padding: 7px 10px; background: transparent; border: 0; font-size: 13px; }
.search .icon-button { border: 0; height: 39px; }
.tabs { display: flex; flex-wrap: wrap; gap: 5px 17px; margin: 11px 0 15px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 7px 2px 9px; color: var(--muted); font-size: 13px; border-bottom: 2px solid transparent; }
.tabs a[aria-current] { color: var(--forest); border-color: var(--forest); font-weight: 700; }
.tabs span { margin-left: 2px; font-size: 11px; }
.book-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.book-card { display: grid; grid-template-columns: 70px minmax(0,1fr) 16px; align-items: start; gap: 13px; min-height: 130px; padding: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.book-card:hover { border-color: #93ad9a; background: #fcfefb; }
.book-card > .icon { width: 15px; height: 15px; opacity: .45; }
.book-meta { min-width: 0; }
.book-meta h3 { font: 700 18px/1.19 var(--serif); margin: 7px 0 2px; }
.book-meta .muted { font-size: 12px; }
.status { display: inline-block; background: #f5ede4; color: #815026; border-radius: 4px; padding: 2px 6px; font-size: 10px; font-weight: 700; }
.status.reading { background: #e4efe6; color: #2a6145; }
.status.finished { background: #e9edf5; color: #3f5674; }
.status.abandoned { background: #eeeaf0; color: #655269; }
.book-caption { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 7px; color: var(--muted); font-size: 11px; }
.book-caption .icon { width: 13px; height: 13px; flex-basis: 13px; opacity: .64; }
.rating { margin-left: 4px; color: var(--amber); white-space: nowrap; font-weight: 700; }
.empty { text-align: center; padding: 38px 12px; border-bottom: 1px solid var(--line); color: var(--muted); }
.empty > .icon { width: 28px; height: 28px; opacity: .58; }
.empty h3 { margin: 8px 0 13px; }
.narrow { max-width: 690px; padding: 27px 0 55px; }
.narrow h1 { font-size: 35px; }
.narrow .eyebrow { margin-bottom: 7px; }
.login { max-width: 360px; padding-top: 60px; }
.back { display: inline-flex; gap: 7px; align-items: center; min-height: 33px; margin-bottom: 13px; color: var(--muted); font-size: 13px; }
.back:hover { text-decoration: underline; }
.editor { margin-top: 23px; }
.editor label { display: block; font-size: 13px; font-weight: 650; margin-bottom: 15px; min-width: 0; }
.editor input, .editor select, .editor textarea { display: block; width: 100%; margin-top: 5px; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid #c8d5cb; border-radius: 6px; background: white; font-size: 16px; font-weight: 400; }
.editor textarea { resize: vertical; }
.editor [hidden], .cover [hidden] { display: none; }
.title-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: end; }
.title-search .catalog-search { margin-bottom: 15px; min-height: 44px; }
.catalog-feedback { font-size: 13px; margin: -5px 0 12px; }
.catalog-results { list-style: none; padding: 0; margin: 0 0 16px; border-block: 1px solid var(--line); }
.catalog-results li + li { border-top: 1px solid var(--line); }
.catalog-result { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; align-items: center; padding: 9px 8px; width: 100%; text-align: left; border: 0; background: transparent; }
.catalog-result:hover, .catalog-result:focus-visible { background: var(--leaf); }
.catalog-thumb { position: relative; display: grid; place-items: center; width: 42px; height: 59px; border-radius: 3px; overflow: hidden; background: var(--leaf); font: 700 21px var(--serif); color: var(--forest); }
.catalog-result strong, .catalog-result small { display: block; overflow-wrap: anywhere; }
.catalog-result small { color: var(--muted); }
.chosen-cover { display: flex; align-items: center; gap: 10px; margin: 0 0 13px; }
.preview-cover { width: 44px; height: 62px; object-fit: cover; border-radius: 3px; }
.fields { display: grid; gap: 13px; }
.fields.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.form-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.book-detail { display: grid; grid-template-columns: 106px minmax(0,1fr); align-items: start; gap: 20px; }
.book-detail .cover { width: 106px; height: 153px; }
.book-detail h1 { margin: 6px 0 3px; }
.reading-date { margin-top: 6px; font-size: 12px; }
.detail-actions { margin: 17px 0 22px; }
.detail-actions .danger { border-color: var(--line); width: 43px; }
.detail-band { padding: 20px 0; border-top: 1px solid var(--line); }
.detail-band h2 { margin-bottom: 9px; font-size: 21px; }
.note-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.delete-title { margin: 14px 0 3px; font-weight: 650; overflow-wrap: anywhere; }
.flash, .error-note { display: flex; align-items: center; gap: 8px; padding: 10px 13px; margin: 14px 0; border-radius: 6px; background: var(--leaf); }
.error-note { background: #f8e8e4; color: #823921; }
.error-back { margin-top: 20px; }
@media (max-width: 960px) {
  .wrap { width: min(100% - 36px, 1192px); }
  .workspace { grid-template-columns: 162px minmax(0,1fr); gap: 20px; }
  .sidebar { padding-right: 11px; }
  .book-card { grid-template-columns: 59px minmax(0,1fr); gap: 10px; }
  .book-card > .icon { display: none; }
  .book-card .cover { width: 59px; height: 88px; }
}
@media (max-width: 680px) {
  .wrap { width: calc(100% - 28px); }
  .topbar-inner { min-height: 60px; }
  .brand { font-size: 22px; }
  .workspace { display: block; }
  .sidebar { display: none; }
  .shelf { padding: 23px 0 30px; }
  h1 { font-size: 34px; }
  .heading .button { padding: 8px 9px; }
  .heading .button .wide-label { display: none; }
  .shelf-heading h1 { white-space: nowrap; }
  .counts { margin-top: 15px; }
  .counts > div { gap: 3px 8px; padding-inline: 8px; }
  .counts dd { font-size: 20px; }
  .current { padding: 12px; margin-top: 15px; gap: 8px 12px; grid-template-columns: 58px minmax(0,1fr); }
  .current .cover { width: 58px; height: 87px; grid-row: 1 / span 2; }
  .current-copy h2 { font-size: 20px; }
  .current-edit { justify-self: start; min-height: 36px; padding: 5px 9px; }
  .books { margin-top: 20px; }
  .collection-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .collection-heading h2 { font-size: 22px; }
  .search { width: 100%; }
  .tabs { gap: 2px 11px; }
  .tabs a { font-size: 12px; }
  .book-grid { grid-template-columns: 1fr; gap: 8px; }
  .book-card { min-height: 112px; padding: 11px; grid-template-columns: 59px minmax(0,1fr) 15px; }
  .book-card > .icon { display: block; }
  .mobile-links { display: block; margin-top: 21px; padding: 13px 0; border-top: 1px solid var(--line); }
  .mobile-links summary { cursor: pointer; font-size: 13px; font-weight: 650; }
  .narrow h1 { font-size: 29px; }
  .book-detail { grid-template-columns: 76px minmax(0,1fr); gap: 13px; }
  .book-detail .cover { width: 76px; height: 110px; }
}
@media (max-width: 360px) {
  .heading { gap: 9px; }
  h1 { font-size: 29px; }
  .heading .button { font-size: 12px; }
  .fields.two { grid-template-columns: 1fr; gap: 0; }
}
