/* Books — black and white, plain sans (Inter). Deliberately unlike Otto's dark UI. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/vendor/fonts/inter-latin-400-normal.woff2") format("woff2");
}
:root {
  --paper: #fff;
  --ink: #000;
  --muted: #666;
  --rule: #c8c8c8;
  --sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #000;
    --ink: #fff;
    --muted: #999;
    --rule: #3a3a3a;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); }
a { color: inherit; text-decoration: none; }
h1 { font-weight: 400; margin: 0; }
button, input { font: inherit; color: inherit; }
.label, .meta { color: var(--muted); font-size: .85rem; }

/* login */
body.login { min-height: 100vh; display: grid; place-items: center; }
.card { width: min(340px, calc(100vw - 32px)); padding: 28px 24px; border: 1px solid var(--ink); }
.card h1 { font-size: 1.6rem; margin: 0 0 24px; }
label { display: block; margin-bottom: 6px; color: var(--muted); }
input[type=password], input[type=text] { width: 100%; padding: 8px 0; background: transparent;
  border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; outline: none; }
input:focus { border-bottom-width: 2px; }
.card button { margin-top: 22px; width: 100%; padding: 10px; background: var(--ink); color: var(--paper);
  border: 0; border-radius: 0; cursor: pointer; }
.card button:hover { text-decoration: underline; text-underline-offset: 3px; }
.error { margin: 12px 0 0; }

/* library */
.page { max-width: 1120px; margin: 0 auto; padding: 36px 20px 80px; }

.resume { display: block; padding: 14px 16px; margin-bottom: 24px; border: 1px solid var(--rule);
          border-left: 3px solid var(--ink); }
.resume:hover { border-color: var(--ink); }
.resume-title { display: block; font-size: 1.1rem; }
.resume .meta, .resume .label { display: block; }

.sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.sections a { padding: 24px 18px; border: 1px solid var(--rule); display: flex; flex-direction: column; gap: 2px; }
.sections a:hover { border-color: var(--ink); }
.section-name { font-size: 1.35rem; }

.folders { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.folders a { border-bottom: 1px solid var(--rule); }
.folders a:hover { border-color: var(--ink); }

.shelf { list-style: none; padding: 0; margin: 0; display: grid;
         grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 52px 32px; }
.book { display: flex; flex-direction: column; gap: 6px; }
.cover { position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden; background: var(--rule); }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center;
             border: 0; }
/* The cover is shown; hovering (or keyboard focus) swaps in the page you are currently on. */
.badge { position: absolute; right: 8px; bottom: 8px; z-index: 1; padding: 2px 8px; background: var(--ink);
         color: var(--paper); font-size: .78rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
.cover .now { opacity: 0; transition: opacity .18s; }
.book:hover .cover .now, .book:focus-visible .cover .now { opacity: 1; }
.book:hover .book-title { text-decoration: underline; text-underline-offset: 3px; }
.book-title { margin-top: 12px; line-height: 1.35; height: 4.05em; display: -webkit-box; -webkit-line-clamp: 3;
              -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.book .meta { margin-top: 2px; }
.book progress { margin-top: 6px; }
@media (max-width: 520px) {
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 18px; }
}
progress { width: 100%; height: 3px; appearance: none; border: 0; background: var(--rule); }
progress::-webkit-progress-bar { background: var(--rule); }
progress::-webkit-progress-value { background: var(--ink); }
progress::-moz-progress-bar { background: var(--ink); }

/* picker */
.addlink { display: inline-block; margin-top: 20px; color: var(--muted); border-bottom: 1px solid var(--rule); }
.addlink:hover { color: var(--ink); border-color: var(--ink); }
.notice { color: var(--muted); }
.pick-bar { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; gap: 12px 20px;
            align-items: center; padding: 12px 0; background: var(--paper); border-bottom: 1px solid var(--ink); }
.pick-bar #filter { flex: 1 1 220px; width: auto; }
.pick-bar .dest label { display: inline; margin: 0 10px 0 0; color: var(--ink); }
.pick-bar button { padding: 7px 14px; background: var(--ink); color: var(--paper); border: 0; cursor: pointer; }
.pick-bar button:disabled { background: transparent; color: var(--muted); border: 1px solid var(--rule); cursor: default; }
.group h2 { font-size: .95rem; font-weight: 400; color: var(--muted); margin: 26px 0 6px; overflow-wrap: anywhere; }
.row { display: flex; gap: 12px; align-items: baseline; padding: 5px 0; border-bottom: 1px solid var(--rule); }
.row[hidden], .group[hidden] { display: none; }
.row .n { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.row .meta { white-space: nowrap; }
.row .state, .row .pickbox { flex: 0 0 7em; margin: 0; }
.row .state { font-size: .85rem; }
.row button.link { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; text-decoration: underline; }
.row button.link:hover { color: var(--ink); }
@media (max-width: 520px) { .row { flex-wrap: wrap; } .row .meta { white-space: normal; } }

.filebtn { display: inline-block; margin: 0; padding: 7px 14px; background: var(--ink); color: var(--paper);
           cursor: pointer; }
.filebtn input { display: none; }
#current:empty, #batch:empty { display: none; }
#batch { margin: 12px 0 0; }
body.dragging .pick-bar { outline: 1px dashed var(--ink); outline-offset: 6px; }
#current { margin-top: 8px; }

/* reader: no chrome, no scrolling; the page is fitted inside the whole window */
html:has(body.reader), body.reader { height: 100dvh; overflow: hidden; overscroll-behavior: none; }
.stage { position: fixed; inset: 0; display: grid; place-items: center; overflow: hidden;
         touch-action: none; user-select: none; }
.stage canvas { display: block; background: #fff; }
.sheet { position: relative; }

/* Invisible, selectable text laid exactly over the page image (pdf.js text layer). */
.textLayer { position: absolute; left: 0; top: 0; overflow: clip; line-height: 1; text-align: initial;
             -webkit-text-size-adjust: none; text-size-adjust: none; forced-color-adjust: none; transform-origin: 0 0;
             user-select: text; -webkit-user-select: text; }
.textLayer :is(span, br) { color: transparent; -webkit-text-fill-color: transparent; position: absolute; white-space: pre; cursor: text;
                           transform-origin: 0% 0%; user-select: text; -webkit-user-select: text; }
.textLayer span.markedContent { top: 0; height: 0; }
.textLayer ::selection { background: rgba(0, 0, 0, .28); color: transparent; -webkit-text-fill-color: transparent; }
.textLayer br::selection { background: transparent; }
.hiddenCanvasElement { display: none; }
.msg { color: var(--muted); }
.corner { position: fixed; right: 12px; bottom: 8px; z-index: 2; transition: opacity .4s;
          font-size: .8rem; font-variant-numeric: tabular-nums; }
.corner .pos, .corner .jump { background: none; border: 0; padding: 0; text-align: right;
                              color: var(--muted); cursor: pointer; }
.corner .jump { width: 7ch; border-bottom: 1px solid var(--ink); color: var(--ink); cursor: text; }
body.idle .corner { opacity: 0; }
