/* Bookshelf — editorial dark theme.
   Deliberately not the default SaaS look: warm ink palette instead of cold
   blue-grey, a serif for anything that is a book's own words, squared corners,
   and covers treated as physical objects rather than cards in a grid. */

:root {
  /* warm ink, not blue-grey */
  --bg:         #131211;
  --bg-2:       #171615;
  --panel:      #1b1a18;
  --panel-2:    #232120;
  --line:       #2a2725;
  --line-strong:#3a3633;

  --fg:         #ebe6dd;
  --fg-dim:     #a49b8e;
  --fg-faint:   #6f6860;

  --accent:     #d29a4f;   /* brass */
  --accent-dim: #8a6530;
  --accent-fg:  #1a1512;
  --danger:     #cf7b6b;

  /* Literata is vendored (see literata.css) so every reader gets the same
     typography offline, instead of falling back to whatever serif they have. */
  --serif: "Literata", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --shelf: 0 10px 18px -10px rgba(0, 0, 0, 0.85);
}

/* literata.css is linked from the page head, not @imported: an @import after
   any rule is ignored, and a separate link loads in parallel. */

* { box-sizing: border-box; }

html, body { height: 100%; }

/* Thin dark scrollbars; the default light ones tear a hole in a dark page. */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #4d4744; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

/* Keyboard focus must be visible; mouse clicks should not draw a ring. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 1px;
}
:focus:not(:focus-visible) { outline: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #e8b972; }

::selection { background: var(--accent-dim); color: #fff; }

/* ---------------------------------------------------------------- chrome */

header.top {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 24px;
  height: 56px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
header.top .brand {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--fg);
}
header.top .brand:hover { color: var(--fg); text-decoration: none; }
header.top nav { display: flex; gap: 2px; margin-left: 10px; }
header.top nav a {
  padding: 6px 11px;
  color: var(--fg-dim);
  font-size: 13px;
  letter-spacing: 0.01em;
  border-radius: 2px;
}
header.top nav a:hover { background: var(--panel-2); color: var(--fg); }
header.top nav a.on { color: var(--fg); background: var(--panel-2); }
header.top .spacer { flex: 1; }
/* Never uppercase a person's name -- it mangles capitalisation. */
header.top .who { color: var(--fg-faint); font-size: 13px; }

/* Hover menu under a nav item. The gap between the trigger and the panel is
   bridged by padding-top so the menu does not vanish while crossing to it. */
.navdrop { position: relative; display: inline-flex; }
.navdrop-menu {
  position: absolute;
  top: 100%;
  left: 0;
  padding-top: 9px;
  min-width: 168px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.13s ease, transform 0.13s ease;
  z-index: 70;
}
.navdrop:hover .navdrop-menu,
.navdrop:focus-within .navdrop-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.navdrop-menu a {
  display: block;
  padding: 8px 13px;
  font-size: 13px;
  color: var(--fg-dim);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-bottom: 0;
}
.navdrop-menu a:first-child { border-radius: 2px 2px 0 0; }
.navdrop-menu a:last-child { border-bottom: 1px solid var(--line-strong); border-radius: 0 0 2px 2px; }
.navdrop-menu a:hover { background: var(--panel-2); color: var(--fg); text-decoration: none; }

main { max-width: 1340px; margin: 0 auto; padding: 30px 24px 80px; }

h1 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
h2 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--fg-faint);
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
h2:first-child { margin-top: 0; }

/* ---------------------------------------------------------------- forms */

input[type=text], input[type=password], input[type=search], select, textarea {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  color: var(--fg);
  padding: 8px 11px;
  border-radius: 2px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent-dim);
}
label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--fg-faint);
  margin: 18px 0 6px;
}

button, .btn {
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  color: var(--fg);
  padding: 8px 15px;
  border-radius: 2px;
  font-size: 13px;
  font-family: inherit;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: inline-block;
  transition: background 0.1s, border-color 0.1s;
}
button:hover, .btn:hover { background: #2c2927; border-color: #4a4542; text-decoration: none; }
button.primary, .btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
}
button.primary:hover, .btn.primary:hover { background: #dfa85c; border-color: #dfa85c; }
button.danger { color: var(--danger); }
button.danger:hover { border-color: var(--danger); }

.err {
  background: #2e1e1b;
  border-left: 2px solid var(--danger);
  color: #f0c3ba;
  padding: 10px 13px;
  font-size: 13.5px;
  margin-bottom: 10px;
}
.note {
  background: var(--panel);
  border-left: 2px solid var(--line-strong);
  padding: 10px 13px;
  font-size: 13.5px;
  color: var(--fg-dim);
}

/* ---------------------------------------------------------------- auth */

.auth-wrap { max-width: 370px; margin: 14vh auto; padding: 0 20px; }
.auth-card { background: var(--panel); border: 1px solid var(--line); padding: 30px 28px; }
.auth-card h1 { margin-bottom: 22px; }
.auth-card button { width: 100%; margin-top: 24px; padding: 10px; }

/* ---------------------------------------------------------------- tokens */

/* The code is the whole point of the page it appears on: make it the
   largest, most copyable thing there. */
.token-input {
  font-family: var(--mono);
  font-size: 26px;
  letter-spacing: 0.34em;
  text-align: center;
  text-transform: uppercase;
  padding: 13px 10px 13px 18px;
}

.token-card {
  display: flex;
  gap: 34px;
  flex-wrap: wrap;
  align-items: flex-start;
  padding: 20px 22px;
  margin-bottom: 20px;
  background: var(--panel);
  border: 1px solid var(--accent-dim);
  border-left: 3px solid var(--accent);
}
.token-card .lbl {
  display: block;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-faint);
  font-family: var(--mono);
  margin-bottom: 9px;
}
.token-big {
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--accent);
  user-select: all;
  line-height: 1;
}
.token-side { min-width: 240px; }
.token-url {
  font-size: 13px;
  color: var(--fg-dim);
  margin-bottom: 10px;
  word-break: break-all;
  user-select: all;
}

/* ---------------------------------------------------------------- toolbar */

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.tabs { display: flex; border: 1px solid var(--line-strong); border-radius: 2px; overflow: hidden; }
.tabs a {
  padding: 6px 14px;
  font-size: 12.5px;
  color: var(--fg-dim);
  border-right: 1px solid var(--line-strong);
  background: var(--panel);
  letter-spacing: 0.01em;
}
.tabs a:last-child { border-right: 0; }
.tabs a:hover { background: var(--panel-2); color: var(--fg); text-decoration: none; }
.tabs a.on { background: var(--accent); color: var(--accent-fg); font-weight: 600; }
.tabs .n {
  margin-left: 6px;
  opacity: 0.65;
  font-family: var(--mono);
  font-size: 11px;
}
/* Three identical pill clusters in a row read as one long undifferentiated
   strip. A hairline between them shows they answer different questions. */
.toolbar .tabs + .tabs {
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

/* Filters live in a drawer so the main bar stays one line at laptop widths. */
.toolbar .search { margin-left: auto; width: 230px; }
.toolbar .search input { padding: 6px 10px; font-size: 12.5px; }

.filter-toggle { position: relative; }
.filter-toggle .badge-n {
  display: inline-block; margin-left: 6px; min-width: 15px; padding: 0 4px;
  background: var(--accent); color: var(--accent-fg); border-radius: 8px;
  font-size: 10px; font-family: var(--mono); line-height: 15px; text-align: center;
}

.filter-drawer {
  display: none;
  gap: 18px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 16px 18px 18px;
  margin: -10px 0 20px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-top: 0;
}
.filter-drawer.open { display: flex; }

.filter-drawer .field { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.filter-drawer .lbl {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-faint);
  font-family: var(--mono);
}

/* Native selects look like they came from another application. Strip the
   platform chrome and draw our own chevron so they match everything else. */
.filter-drawer select {
  appearance: none;
  -webkit-appearance: none;
  width: 236px;
  padding: 8px 30px 8px 11px;
  font-size: 13px;
  font-family: inherit;
  color: var(--fg);
  background-color: var(--bg);
  background-image:
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239e968b' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  cursor: pointer;
  text-overflow: ellipsis;
}
.filter-drawer .field.narrow select { width: 152px; }
.filter-drawer select:hover { border-color: #4d4744; }
/* An applied filter should be obvious at a glance. */
.filter-drawer select.set {
  border-color: var(--accent-dim);
  color: var(--accent);
  background-color: rgba(210, 154, 79, 0.07);
}
.filter-drawer option { background: var(--panel); color: var(--fg); }

.drawer-clear {
  margin-left: auto;
  align-self: flex-end;
  padding-bottom: 9px;
  font-size: 12px;
  color: var(--fg-faint);
}
.drawer-clear:hover { color: var(--danger); }
.toolbar form { margin-left: auto; width: 250px; }
.count-note {
  color: var(--fg-faint);
  font-size: 11px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
}

/* ---------------------------------------------------------------- shelf grid */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 34px 22px;
}

.card { display: block; color: inherit; }
.card:hover { text-decoration: none; }

/* The cover is treated as an object sitting on a shelf: a hard shadow beneath,
   a hairline spine on the left, and a lift on hover. No card chrome. */
.card .art {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  background: var(--panel-2);
  overflow: hidden;
  box-shadow: var(--shelf);
  transition: transform 0.13s ease, box-shadow 0.13s ease;
}
.card .art::after {
  content: "";
  position: absolute; inset: 0;
  /* spine highlight + inner edge, sells it as a physical book */
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.14) 0px, rgba(255,255,255,0.03) 3px,
    rgba(0,0,0,0) 8px, rgba(0,0,0,0) 92%, rgba(0,0,0,0.22) 100%
  );
  pointer-events: none;
}
.card:hover .art { transform: translateY(-3px); box-shadow: 0 16px 24px -12px rgba(0,0,0,0.9); }
.card .art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .art .ph {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--fg-faint);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.card .t {
  display: -webkit-box;
  margin-top: 11px;
  font-family: var(--serif);
  font-size: 14.5px;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: var(--fg);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card:hover .t { color: var(--accent); }
.card .a {
  font-size: 11.5px;
  color: var(--fg-faint);
  margin-top: 3px;
  letter-spacing: 0.01em;
}

.badge {
  position: absolute;
  top: 0; right: 0;
  background: rgba(10, 9, 8, 0.82);
  backdrop-filter: blur(3px);
  color: var(--fg-dim);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 6px;
  z-index: 2;
}
.badge.done { background: rgba(210, 154, 79, 0.92); color: var(--accent-fg); font-weight: 700; }

.bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 3px; background: rgba(0, 0, 0, 0.65); z-index: 2;
}
.bar > i { display: block; height: 100%; background: var(--accent); }

.empty {
  border: 1px solid var(--line);
  border-left: 2px solid var(--line-strong);
  padding: 44px 26px;
  color: var(--fg-faint);
  font-size: 14px;
}
.empty code { font-family: var(--mono); color: var(--fg-dim); }

/* ---------------------------------------------------------------- shelf view

   Books stood on their ends, seen spine-on. Each spine draws its own segment
   of shelf board via ::after, so the boards join up across a row and wrap
   correctly without needing a row wrapper element. */

.shelf {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  column-gap: 2px;
  row-gap: 64px;
  padding: 40px 0 30px;
  /* 3D scene: books turn toward the reader rather than just sliding up. */
  perspective: 1700px;
  perspective-origin: 50% 45%;
}

/* The flex item reserves only the spine's thickness; the book itself is an
   absolutely positioned 3D object inside it, so turning a book does not
   reflow the shelf. */
.spine {
  position: relative;
  width: var(--sw, 34px);
  height: 300px;
  flex: 0 0 auto;
  color: inherit;
}
.spine:hover { z-index: 30; text-decoration: none; }

/* The book is modelled cover-forward, then parked at 90deg about its left
   edge so the spine is what faces the shelf. Hover unwinds that rotation. */
.book3d {
  position: absolute;
  top: 0;
  left: 0;
  width: 196px;
  height: 100%;
  transform-style: preserve-3d;
  transform-origin: left center;
  transform: rotateY(90deg);
  transition: transform 0.46s cubic-bezier(0.22, 0.68, 0.24, 1);
  will-change: transform;
}
/* pulled off the shelf: lifted, brought forward, and turned to face you */
.spine:hover .book3d,
.spine:focus-visible .book3d {
  transform: translateY(-28px) translateZ(60px) rotateY(11deg);
}

/* --- front cover: the book's own plane ------------------------------ */

.spine .cface {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--sc, #3a3633);
  box-shadow: 0 18px 34px -14px rgba(0, 0, 0, 0.95);
  backface-visibility: hidden;
}
.spine .cface img { width: 100%; height: 100%; object-fit: cover; display: block; }
.spine .cface .cph {
  display: flex; align-items: center; justify-content: center;
  height: 100%; padding: 16px; text-align: center;
  font-family: var(--serif); font-size: 14px; line-height: 1.3;
  color: rgba(255, 255, 255, 0.9);
}
/* sheen, so the cover reads as a surface catching light */
.spine .cface::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(105deg,
    rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.02) 28%,
    rgba(0, 0, 0, 0) 58%, rgba(0, 0, 0, 0.26) 100%);
  pointer-events: none;
}

/* --- spine face: hinged back 90deg along the cover's left edge ------- */

.spine .sface {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--sw, 34px);
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: left center;
  transform: rotateY(-90deg);
  background:
    linear-gradient(90deg,
      rgba(0, 0, 0, 0.50) 0%,
      rgba(255, 255, 255, 0.13) 20%,
      rgba(255, 255, 255, 0.02) 52%,
      rgba(0, 0, 0, 0.18) 78%,
      rgba(0, 0, 0, 0.42) 100%),
    var(--sc, #3a3633);
  box-shadow: 0 6px 12px -6px rgba(0, 0, 0, 0.9);
}

/* Fore-edge pages, faked as a 2D strip on the cover itself. A real 3D panel
   here kept rendering toward the viewer instead of receding, so this trades
   geometric honesty for something that cannot break. */
.spine .cface::before {
  content: "";
  position: absolute;
  top: 3px; bottom: 3px; right: 0;
  width: 7px;
  background: repeating-linear-gradient(to right,
    rgba(245, 240, 228, 0.92) 0 1px, rgba(198, 189, 172, 0.92) 1px 2px);
  box-shadow: inset 2px 0 5px rgba(0, 0, 0, 0.4);
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s ease 0.12s;
  pointer-events: none;
}
.spine:hover .cface::before { opacity: 1; }

/* --- caption beneath a book that has been pulled out ---------------- */

.spine .slabel {
  position: absolute;
  top: calc(100% + 20px);
  left: 0;
  width: 210px;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--fg-dim);
  opacity: 0;
  transition: opacity 0.24s ease 0.14s;
  pointer-events: none;
}
.spine:hover .slabel { opacity: 1; }

/* the shelf board */
.spine::after {
  content: "";
  position: absolute;
  left: -2px; right: -2px; bottom: -16px;
  height: 13px;
  background: linear-gradient(#4a3728 0 1px, #34261c 1px, #1e1610 100%);
  box-shadow: 0 5px 10px -4px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  transform: translateZ(0);
}

/* cloth binding bands top and bottom */
.spine .band {
  position: absolute; left: 0; right: 0; height: 15px;
  background: rgba(0, 0, 0, 0.30);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.spine .band.top { top: 16px; }
.spine .band.bot { bottom: 20px; }

.spine .stitle {
  writing-mode: vertical-rl;
  font-family: var(--serif);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  margin-top: 42px;
  max-height: 200px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.spine .sauthor {
  writing-mode: vertical-rl;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
  margin-top: auto;
  margin-bottom: 42px;
  max-height: 78px;
  overflow: hidden;
  white-space: nowrap;
}

/* reading progress shown as a bookmark ribbon down the spine edge */
.spine .ribbon {
  position: absolute; top: 0; right: 3px; width: 3px;
  background: var(--accent);
  box-shadow: 0 0 5px rgba(210, 154, 79, 0.6);
}

@media (max-width: 640px) {
  .spine { height: 230px; }
  .spine .stitle { margin-top: 32px; max-height: 140px; font-size: 11.5px; }
  .book3d { width: 150px; }
}

/* A turning book is decorative; honour a request for less motion. */
@media (prefers-reduced-motion: reduce) {
  .book3d { transition: none; }
  .spine:hover .book3d { transform: translateY(-14px) rotateY(90deg); }
  .spine:hover .cface::before { opacity: 0; }
  /* the featured book is already turned out, so keep it turned, just still */
  .myshelf .spine.featured .book3d,
  .myshelf .spine.featured:hover .book3d {
    transform: translateY(-28px) translateZ(60px) rotateY(11deg);
  }
  .spine.featured:hover .pagemark { animation: none; transform: translateY(-10px); }
  .bmk:not(.locked):hover .bmk-body { transform: none; }
}

/* ---------------------------------------------------------------- weekly picks */

.picks-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 10px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.picks {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  margin-bottom: 8px;
}
.pick { display: block; color: inherit; }
.pick:hover { text-decoration: none; }
.pick-art {
  position: relative;
  display: flex;
  aspect-ratio: 2 / 3;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--panel-2);
  box-shadow: var(--shelf);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pick:hover .pick-art {
  transform: translateY(-4px);
  box-shadow: 0 18px 26px -12px rgba(0, 0, 0, 0.9);
}
.pick-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick-art .ph {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--fg-faint);
}
.pick-meta { display: block; margin-top: 11px; }
.pick-meta b {
  display: -webkit-box;
  font-family: var(--serif);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.28;
  color: var(--fg);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pick:hover .pick-meta b { color: var(--accent); }
.pick-meta i {
  display: block; font-style: normal; font-size: 11.5px;
  color: var(--fg-faint); margin-top: 3px;
}
.pick-meta u {
  display: inline-block; margin-top: 5px; text-decoration: none;
  font-family: var(--mono); font-size: 10px; color: var(--fg-faint);
}

@media (max-width: 1000px) { .picks { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px)  { .picks { grid-template-columns: repeat(2, 1fr); } }

/* ---------------------------------------------------------------- your shelf */

.myshelf {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  column-gap: 2px;
  row-gap: 78px;
  /* The featured book's caption is absolutely positioned and always visible,
     so it needs reserved space or it collides with the next section. */
  padding: 56px 0 76px;
  perspective: 1700px;
  perspective-origin: 50% 45%;
}

/* The current read stays turned out; it reserves the cover's full width so
   it does not sit on top of its neighbours. */
.myshelf .spine.featured { width: 208px; margin-right: 20px; }
.myshelf .spine.featured .book3d {
  transform: translateY(-28px) translateZ(60px) rotateY(11deg);
}
/* Reaching for the current read should be obvious: it lifts clear of the
   shelf, turns square to you, and the bookmark rides up with it. The previous
   11deg -> 6deg nudge was too small to read as anything happening. */
.myshelf .spine.featured:hover .book3d,
.myshelf .spine.featured:focus-visible .book3d {
  transform: translateY(-46px) translateZ(96px) rotateY(-2deg) scale(1.02);
}
.myshelf .spine.featured .cface::before { opacity: 1; }
.myshelf .spine.featured .slabel { opacity: 1; }
.myshelf .spine.featured .slabel em {
  display: block; font-style: normal; color: var(--fg-faint); margin-top: 2px;
}

/* An earned bookmark, slipped between the pages. It is painted *behind* the
   cover so only its head shows above the top edge, the way a real one does. */
.pagemark {
  position: absolute;
  top: -54px;
  /* Tucked near the fore-edge corner. Sat mid-page it would slide straight
     out, and it reads wrong. */
  left: 82%;
  width: 24px;
  height: 150px;
  background: var(--rc, var(--accent));
  border-radius: 3px 3px 0 0;
  z-index: 0;
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
  transform-origin: 50% 100%;
  transition: transform 0.34s cubic-bezier(0.34, 1.42, 0.5, 1),
              box-shadow 0.34s ease;
}

/* Reach for the book and the bookmark lifts and tilts, as though it is being
   tugged out with it. The overshoot in the easing gives it a bit of weight. */
.spine.featured:hover .pagemark,
.spine.featured:focus-visible .pagemark {
  transform: translateY(-16px) rotate(-4deg);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.7);
  animation: mark-sway 2.6s ease-in-out 0.34s infinite;
}

@keyframes mark-sway {
  0%, 100% { transform: translateY(-16px) rotate(-4deg); }
  50%      { transform: translateY(-18px) rotate(-1.5deg); }
}
/* a paler band across the head, like printed card */
.pagemark::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 12px;
  height: 15px;
  background: rgba(255, 255, 255, 0.32);
}
/* cloth sheen down the length */
.pagemark::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg,
    rgba(0, 0, 0, 0.26) 0%, rgba(255, 255, 255, 0.24) 40%,
    rgba(255, 255, 255, 0.05) 62%, rgba(0, 0, 0, 0.22) 100%);
}
/* the cover must paint over the lower part of the bookmark */
.spine .cface { z-index: 1; }

.fav-dot {
  position: absolute;
  top: -20px; left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--accent);
  z-index: 12;
}

/* ---------------------------------------------------------------- bookmarks */

/* Each achievement is drawn as the bookmark you actually win. Tier decides
   how elaborate it is: t1 a plain paper slip, t5 gilt-edged with a tassel. */
.marks { display: flex; flex-wrap: wrap; gap: 22px 18px; padding-top: 14px; }

.bmk {
  position: relative;
  width: 96px;
  cursor: pointer;
  display: block;
}
.bmk input { position: absolute; opacity: 0; pointer-events: none; }

.bmk-body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  height: 214px;
  padding: 22px 8px 26px;
  background: var(--rc, var(--accent));
  /* the classic notched tail */
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 86%, 0 100%);
  box-shadow: 0 8px 16px -8px rgba(0, 0, 0, 0.9);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.bmk:not(.locked):hover .bmk-body { transform: translateY(-6px); }

.bmk-glyph {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(0, 0, 0, 0.62);
  padding: 5px 0 7px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.22);
  width: 46px;
  text-align: center;
}
.bmk-name {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: rgba(20, 14, 8, 0.9);
  margin-top: 4px;
}
.bmk-tier {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(20, 14, 8, 0.5);
  margin-top: auto;
}
.bmk-prog {
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(20, 14, 8, 0.72);
  background: rgba(255, 255, 255, 0.35);
  padding: 1px 6px;
}
.bmk-inuse {
  display: block;
  margin-top: 9px;
  text-align: center;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rc, var(--accent));
}

/* --- tier 1: plain paper, no shine ---------------------------------- */
.bmk.t1 .bmk-body {
  background: var(--rc);
  clip-path: none;
  box-shadow: 0 5px 11px -7px rgba(0, 0, 0, 0.85);
}

/* --- tier 2: printed card, a band across the head ------------------- */
.bmk.t2 .bmk-body::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 11px; height: 6px;
  background: rgba(255, 255, 255, 0.4);
}

/* --- tier 3: notched, with a sheen ---------------------------------- */
.bmk.t3 .bmk-body::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(112deg,
    rgba(255,255,255,0.34) 0%, rgba(255,255,255,0.06) 34%,
    rgba(0,0,0,0) 60%, rgba(0,0,0,0.16) 100%);
  pointer-events: none;
}

/* --- tier 4: tasselled ---------------------------------------------- */
.bmk.t4 .bmk-body {
  border: 1px solid rgba(255, 255, 255, 0.45);
}
.bmk.t4 .tassel, .bmk.t5 .tassel {
  position: absolute;
  top: -17px; left: 50%; transform: translateX(-50%);
  width: 3px; height: 17px;
  background: rgba(232, 222, 200, 0.9);
}
.bmk.t4 .tassel::after, .bmk.t5 .tassel::after {
  content: "";
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  width: 13px; height: 13px;
  border: 2.5px solid rgba(232, 222, 200, 0.9);
  border-radius: 50%;
}

/* --- tier 5: gilt, foil edge and a slow shimmer --------------------- */
.bmk.t5 .bmk-body {
  background:
    linear-gradient(135deg,
      rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 26%,
      rgba(0,0,0,0.12) 54%, rgba(255,255,255,0.42) 78%, rgba(0,0,0,0.16) 100%),
    var(--rc);
  border: 2px solid rgba(255, 244, 200, 0.75);
  box-shadow: 0 10px 22px -8px rgba(0, 0, 0, 0.95),
              0 0 22px -6px var(--rc);
}
.bmk.t5 .bmk-glyph { border-bottom-color: rgba(0, 0, 0, 0.34); }

/* --- locked --------------------------------------------------------- */
.bmk.locked { cursor: default; }
.bmk.locked .bmk-body {
  background: repeating-linear-gradient(45deg,
    #1e1c1a 0 6px, #232120 6px 12px);
  border: 1px dashed var(--line-strong);
  box-shadow: none;
}
.bmk.locked .tassel { display: none; }
.bmk.locked .bmk-glyph { color: var(--fg-faint); border-bottom-color: var(--line-strong); }
.bmk.locked .bmk-name { color: var(--fg-dim); }
.bmk.locked .bmk-tier { color: var(--fg-faint); }
.bmk.locked .bmk-prog { color: var(--fg-dim); background: rgba(255,255,255,0.06); }
.bmk.locked .bmk-body::after { display: none; }

/* --- chosen --------------------------------------------------------- */
.bmk.chosen .bmk-body {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
  transform: translateY(-6px);
}

/* ---------------------------------------------------------------- suggestions */

.suggest-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.suggest-form .field { display: flex; flex-direction: column; gap: 6px; }
.suggest-form .field input { width: 230px; }
.suggest-form .field.grow input { width: 320px; }
.suggest-form .lbl {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--fg-faint); font-family: var(--mono);
}

.status {
  display: inline-block; padding: 2px 8px; border-radius: 2px;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em;
  font-family: var(--mono); border: 1px solid var(--line-strong); color: var(--fg-dim);
}
.status.open { border-color: var(--accent-dim); color: var(--accent); }
.status.wanted { border-color: #6f7fc9; color: #97a6e8; }
.status.ordered { border-color: #8f6fc9; color: #b596e0; }
.status.added { border-color: #4a7f52; color: #7fc98a; }
.status.declined { border-color: #6b3b40; color: var(--danger); }

/* ---------------------------------------------------------------- chips */

.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -6px 0 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel-2); border: 1px solid var(--line-strong);
  padding: 4px 9px; font-size: 12px; color: var(--fg-dim); border-radius: 2px;
}
.chip b { font-weight: 500; color: var(--fg); }
.chip .k {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--fg-faint); font-family: var(--mono);
}
.chip a { color: var(--fg-faint); font-size: 14px; line-height: 1; }
.chip a:hover { color: var(--danger); }
.chips .clear { font-size: 12px; color: var(--fg-faint); margin-left: 4px; }

.taglist { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.taglist a {
  font-size: 11.5px; padding: 4px 10px; border-radius: 2px;
  background: transparent; border: 1px solid var(--line-strong); color: var(--fg-dim);
  letter-spacing: 0.01em;
}
.taglist a:hover { border-color: var(--accent-dim); color: var(--accent); }

button.pill {
  font-size: 11.5px; padding: 4px 10px; border-radius: 2px;
  background: transparent; border: 1px solid var(--line-strong); color: var(--fg-dim);
}
button.pill:hover { border-color: var(--accent-dim); color: var(--accent); background: transparent; }
button.pill.on { background: var(--accent-dim); border-color: var(--accent-dim); color: #fff; }

/* ---------------------------------------------------------------- detail */

.detail { display: grid; grid-template-columns: 250px 1fr; gap: 40px; align-items: start; }
.detail .art { position: relative; box-shadow: var(--shelf); }
.detail .art img { width: 100%; display: block; }
.detail .art .ph {
  aspect-ratio: 2/3; background: var(--panel-2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; color: var(--fg-faint);
  letter-spacing: 0.12em; text-transform: uppercase;
}
.detail h1 { font-size: 32px; max-width: 22ch; }
.detail .byline { color: var(--fg-dim); font-size: 15px; margin-bottom: 4px; }
.detail .byline a { color: var(--fg-dim); border-bottom: 1px solid var(--line-strong); }
.detail .byline a:hover { color: var(--accent); border-color: var(--accent-dim); }
.detail .actions { display: flex; gap: 8px; margin: 26px 0 26px; flex-wrap: wrap; align-items: center; }
.detail .actions form { display: inline; }
.detail .desc {
  color: var(--fg-dim);
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.65;
  max-width: 64ch;
}

table.meta { border-collapse: collapse; font-size: 13px; margin-top: 26px; }
table.meta td { padding: 5px 24px 5px 0; vertical-align: top; }
table.meta td:first-child {
  color: var(--fg-faint);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.09em;
  white-space: nowrap;
  padding-top: 7px;
}
table.meta td:last-child { font-family: var(--mono); font-size: 12.5px; }

/* ---------------------------------------------------------------- tables */

table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--fg-faint);
  font-weight: 600;
  padding: 0 14px 9px 0;
  border-bottom: 1px solid var(--line-strong);
}
table.data td { padding: 10px 14px 10px 0; border-bottom: 1px solid var(--line); }
table.data td.mono, table.data td .mono { font-family: var(--mono); font-size: 12.5px; }
table.data tr:hover td { background: var(--panel); }

/* ---------------------------------------------------------------- readers */

.reader-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 48px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 60;
}
.reader-bar .title {
  font-family: var(--serif);
  font-size: 15px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.reader-bar .spacer { flex: 1; }
.reader-bar .pos { font-family: var(--mono); font-size: 11px; color: var(--fg-faint); }
.reader-bar button { padding: 5px 11px; font-size: 12.5px; }
.reader-bar .grp { display: flex; gap: 4px; align-items: center; }
.reader-bar .icon {
  width: 30px; height: 28px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1;
}
.reader-bar .sep { width: 1px; height: 20px; background: var(--line-strong); }
.reader-bar button.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}

.reader-body { display: flex; height: calc(100vh - 48px); }

.toc-drawer {
  width: 0; flex: 0 0 auto; overflow: hidden;
  background: var(--bg-2); border-right: 1px solid var(--line);
  transition: width 0.14s ease;
}
.toc-drawer.open { width: 300px; }
.toc-inner { width: 300px; height: 100%; overflow-y: auto; padding: 18px 0; }
.toc-inner h3 {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.11em;
  color: var(--fg-faint); margin: 0 18px 12px; font-weight: 600;
}
.toc-inner a {
  display: block; padding: 8px 18px; font-size: 13px; line-height: 1.35;
  color: var(--fg-dim); border-left: 2px solid transparent;
}
.toc-inner a:hover { background: var(--panel); color: var(--fg); }
.toc-inner a.on { color: var(--accent); border-left-color: var(--accent); background: var(--panel); }
.toc-inner a.sub { padding-left: 34px; font-size: 12.5px; color: var(--fg-faint); }
.toc-inner .none { padding: 0 18px; color: var(--fg-faint); font-size: 13px; }

.reader-main { flex: 1; position: relative; min-width: 0; }
#viewer { height: 100%; width: 100%; background: transparent; }
.reader-main.theme-light { background: #ffffff; }
.reader-main.theme-sepia { background: #f4ecd8; }
.reader-main.theme-dark  { background: #17161a; }

.page-zone {
  position: absolute; top: 0; bottom: 36px; width: 13%;
  border: 0; background: transparent; cursor: pointer; padding: 0; z-index: 5;
}
.page-zone:hover { background: rgba(127, 127, 127, 0.05); }
.page-zone.prev { left: 0; }
.page-zone.next { right: 0; }

.reader-foot {
  position: absolute; left: 0; right: 0; bottom: 0; height: 36px;
  display: flex; align-items: center; gap: 14px; padding: 0 18px;
  font-size: 11px; font-family: var(--mono); letter-spacing: 0.03em;
  color: var(--fg-faint); background: var(--bg-2); border-top: 1px solid var(--line);
  z-index: 6;
}
.reader-foot .track { flex: 1; height: 2px; background: var(--line-strong); }
.reader-foot .track > i { display: block; height: 100%; background: var(--accent); }

.pop {
  position: absolute; right: 12px; top: 56px; z-index: 80;
  width: 268px; background: var(--panel); border: 1px solid var(--line-strong);
  padding: 16px; display: none;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6);
}
.pop.open { display: block; }
.pop h4 {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--fg-faint); margin: 0 0 8px; font-weight: 600;
}
.pop .row { display: flex; gap: 6px; margin-bottom: 16px; }
.pop .row:last-child { margin-bottom: 0; }
.pop .row button { flex: 1; padding: 7px 0; font-size: 12px; }
.pop .row button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); font-weight: 600; }
.pop .sw { width: 28px; height: 28px; flex: 0 0 auto; }
.pop .sw.light { background: #fff; }
.pop .sw.sepia { background: #f4ecd8; }
.pop .sw.dark  { background: #17161a; }

/* ---------------------------------------------------------------- canvas stage */

.stage {
  position: absolute; inset: 0 0 36px 0;
  overflow: auto; background: #0e0d0c;
  display: flex; justify-content: center; align-items: flex-start;
  padding: 20px 0;
}
.stage.dim { background: #0a0908; }
.stage canvas, .stage img {
  display: block; max-width: 100%; height: auto;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.7);
  background: #fff;
}
.stage.invert canvas, .stage.invert img { filter: invert(1) hue-rotate(180deg); }
.stage.fitw canvas, .stage.fitw img { max-width: 100%; width: 100%; }
.stage .spread { display: flex; gap: 12px; align-items: flex-start; }

.pagebox {
  width: 58px; text-align: center; padding: 2px 5px; font-size: 11.5px;
  font-family: var(--mono); background: var(--bg);
  border: 1px solid var(--line-strong); color: var(--fg); border-radius: 2px;
}

.busy {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-family: var(--mono); font-size: 12px; color: var(--fg-dim);
  background: var(--panel); border: 1px solid var(--line-strong);
  padding: 10px 16px; z-index: 9; letter-spacing: 0.04em;
}

/* legacy comic stage (kept until the comic reader moves to .stage) */
.comic-stage {
  height: calc(100vh - 48px); background: #0e0d0c;
  display: flex; align-items: center; justify-content: center;
  overflow: auto; position: relative;
}
.comic-stage img { max-width: 100%; max-height: 100%; display: block; }
.comic-stage.fit-width img { max-width: 100%; max-height: none; }
.comic-nav {
  position: absolute; top: 0; bottom: 0; width: 20%;
  cursor: pointer; border: 0; background: transparent; padding: 0;
}
.comic-nav:hover { background: rgba(255, 255, 255, 0.03); }
.comic-nav.prev { left: 0; }
.comic-nav.next { right: 0; }

.pdf-frame { width: 100%; height: calc(100vh - 48px); border: 0; background: #525659; }

/* ---------------------------------------------------------------- player */

.player { max-width: 780px; margin: 0 auto; }
.player .head { display: flex; gap: 26px; margin-bottom: 30px; }
.player .head img, .player .head .ph {
  width: 168px; height: 168px; object-fit: cover;
  box-shadow: var(--shelf); background: var(--panel-2); flex: 0 0 auto;
}
.player .head .ph {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 10px; color: var(--fg-faint);
  letter-spacing: 0.14em; text-transform: uppercase;
}
.player audio { width: 100%; margin: 10px 0 4px; }
.player .times {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 11.5px; color: var(--fg-faint);
}
.player .controls { display: flex; gap: 8px; align-items: center; margin: 18px 0; flex-wrap: wrap; }
.player .controls label { margin: 0; }
.tracklist { margin-top: 12px; }
.tracklist button {
  display: flex; width: 100%; text-align: left; gap: 14px;
  background: none; border: 0; border-bottom: 1px solid var(--line);
  padding: 10px 4px; color: var(--fg-dim); font-size: 13px; border-radius: 0;
}
.tracklist button:hover { background: var(--panel); }
.tracklist button.on { color: var(--accent); }
.tracklist .n { font-family: var(--mono); color: var(--fg-faint); min-width: 26px; font-size: 12px; }
.tracklist .d { margin-left: auto; font-family: var(--mono); color: var(--fg-faint); font-size: 12px; }

/* ---------------------------------------------------------------- stats */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 8px;
}
.tile { background: var(--panel); padding: 18px 18px 16px; }
.tile b {
  display: block;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.tile b em { font-style: normal; font-size: 15px; color: var(--fg-dim); margin-left: 2px; }
.tile span {
  display: block;
  margin-top: 7px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--fg-faint);
}

.meter { display: block; height: 4px; background: var(--line); }
.meter > i { display: block; height: 100%; background: var(--accent-dim); }

.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }

.bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 150px;
  padding-top: 8px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line-strong);
}
.bar-col {
  /* Cap the width: with only a handful of decades, flex:1 alone produces
     enormous slabs rather than a readable chart. */
  flex: 0 1 64px;
  max-width: 64px;
  min-width: 26px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}
.bar-col:hover { text-decoration: none; }
.bar-n { font-family: var(--mono); font-size: 10px; color: var(--fg-faint); }
.bar-col:hover .bar-n { color: var(--accent); }
.bar-fill {
  display: block; width: 100%; background: var(--accent-dim); min-height: 2px;
}
.bar-col:hover .bar-fill { background: var(--accent); }
.bar-lab {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--fg-faint);
  transform: translateY(15px);
  white-space: nowrap;
}

/* stacked mini-covers for a collection tile */
.art.stackart { display: flex; flex-wrap: wrap; overflow: hidden; }
.art.stackart img { width: 50%; height: 50%; object-fit: cover; }
.art.stackart img:only-child { width: 100%; height: 100%; }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 860px) {
  .detail { grid-template-columns: 190px 1fr; gap: 26px; }
  .detail h1 { font-size: 26px; }
}
@media (max-width: 640px) {
  main { padding: 22px 16px 60px; }
  .detail { grid-template-columns: 1fr; }
  .detail .art { max-width: 190px; }
  .toolbar form { margin-left: 0; width: 100%; }
  .player .head { flex-direction: column; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 26px 16px; }
}
@media (max-width: 720px) {
  .toc-drawer.open { width: 100%; position: absolute; z-index: 70; height: 100%; }
  .page-zone { width: 20%; }
}
