@font-face {
  font-family: "Mavora Pilcrow";
  src: url("/assets/fonts/mavora-semi-expanded-light.ttf") format("truetype");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Mavora Pilcrow";
  src: url("/assets/fonts/mavora-semi-expanded-semibold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Mavora Pilcrow";
  src: url("/assets/fonts/mavora-semi-expanded-bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Mavora Pilcrow";
  src: url("/assets/fonts/mavora-semi-expanded-extrabold.ttf") format("truetype");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "Rosseti Pilcrow";
  src: url("/assets/fonts/rosseti-light.otf") format("opentype");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Inter Pilcrow";
  src: url("/assets/fonts/inter-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Inter Pilcrow";
  src: url("/assets/fonts/inter-medium.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Inter Pilcrow";
  src: url("/assets/fonts/inter-semibold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  --ink: #151515;
  --paper: #ebe7dc;
  --coral: #ff6c4b;
  --violet: #7a5dff;
  --lime: #c8f542;
  --panel: #3d3d3d;
  --muted: #717171;
  --line: #505050;
  --white: #d9d9d9;
  --display: "Mavora Pilcrow", "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --body: "Inter Pilcrow", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --wordmark: "Rosseti Pilcrow", "Bodoni 72 Smallcaps", Georgia, serif;
  --header-top: max(43px, calc(env(safe-area-inset-top) + 7px));
  background: var(--ink);
  color: var(--white);
  color-scheme: dark;
  font-family: var(--body);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; overscroll-behavior: none; }
body { min-height: 100dvh; background: var(--ink); }
button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.pilcrow-app {
  position: relative;
  width: 100%;
  min-height: max(100dvh, 844px);
  overflow: hidden;
  background: var(--ink);
}

.reader-app { overflow-y: auto; }

.pilcrow-header {
  display: grid;
  grid-template-columns: 58px 187.367px 33px;
  align-items: start;
  justify-content: space-between;
  height: calc(var(--header-top) + 60px);
  padding: var(--header-top) 25px 0 18px;
}

.wordmark {
  width: 58px;
  height: 20px;
  margin: 0;
  padding-left: 8.43px;
  overflow: hidden;
  color: #fff;
  font-family: var(--wordmark);
  font-size: 25.476px;
  font-weight: 300;
  letter-spacing: -.764px;
  line-height: 17.833px;
  white-space: nowrap;
}

.space-switcher {
  display: grid;
  grid-template-columns: 100px 75px;
  gap: 3px;
  width: 187.367px;
  height: 33px;
  padding: 3px;
  border-radius: 23.797px;
  background: var(--panel);
  transform: translateX(-1.55px);
}

.switcher-choice {
  display: grid;
  height: 27px;
  place-items: center;
  border-radius: 23.797px;
  color: #fff;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 300;
  letter-spacing: -.12px;
  line-height: .83;
}

.switcher-choice.is-active { color: var(--ink); background: var(--coral); }
.avatar-mark { position: relative; justify-self: end; width: 33px; height: 33px; }
.avatar-ring, .avatar-user { position: absolute; inset: 0; width: 100%; height: 100%; }
.avatar-user { inset: 7.33px; width: 18.333px; height: 18.333px; }
.bookspace-app .space-switcher { transform: translateX(-8.55px); }

.bookspace-hero {
  position: relative;
  padding: 181px 41px 60px;
}

.bookspace-hero h1,
.reader-library h1 {
  margin: 0;
  color: var(--white);
  font-family: var(--display);
  font-size: 47.598px;
  font-weight: 800;
  letter-spacing: -.476px;
  line-height: .83;
}

.bookspace-hero h1 { width: 309px; max-width: 100%; }
.bookspace-hero p {
  width: 260px;
  max-width: 100%;
  margin: 15px 0 0;
  color: rgb(217 217 217 / 50%);
  font-size: 14px;
  line-height: 1.45;
}
.bookspace-heart { position: absolute; top: 87.2px; right: 54.5px; width: 72.87px; height: 65.799px; }
.bookspace-underline { width: 115.025px; height: 16.691px; margin: 2.5px 0 0 -1px; }

.library-screen { display: flex; min-height: max(100dvh, 844px); flex-direction: column; }
.reader-library { flex: 0 0 auto; padding: 5px 26px 0 32px; }
.reader-library h1 { width: 341px; max-width: 100%; }

.library-filters {
  display: grid;
  grid-template-columns: 83fr 99fr 63fr 63fr;
  gap: 8px;
  width: 332px;
  max-width: 100%;
  height: 27px;
  margin: 15px 0 0;
}

.library-filters button {
  min-width: 0;
  height: 27px;
  padding: 0 4px;
  overflow: hidden;
  border: 0;
  border-radius: 25.962px;
  background: var(--panel);
  color: var(--white);
  font-size: 11.423px;
  font-weight: 400;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-filters button.is-active { background: var(--violet); color: var(--ink); }

.reader-intro {
  width: 233px;
  min-height: 41px;
  margin: 14px 5px 14px;
  color: rgb(217 217 217 / 50%);
  font-size: 14px;
  line-height: 1.45;
}
.reader-intro strong { color: var(--violet); font-weight: 700; }
.reader-intro span { color: inherit; }

#current-book,
.library-list { width: 324px; max-width: calc(100vw - 66px); margin-left: 1px; }

.featured-book-card {
  position: relative;
  display: grid;
  grid-template-columns: 95.538px minmax(0, 1fr);
  column-gap: 14.846px;
  width: 324px;
  max-width: 100%;
  height: 158.885px;
  padding: 15.577px 15.615px 15.577px 16.615px;
  border: 1.038px solid rgb(91 91 91 / 65%);
  border-radius: 14.538px;
  background: var(--panel);
  color: var(--white);
  text-align: left;
}

.featured-book-card > .book-open { position: absolute; inset: 0; z-index: 0; border: 0; border-radius: inherit; background: transparent; }
.book-cover, .cover-fallback { position: relative; z-index: 1; width: 95.538px; height: 127.731px; border-radius: 7.269px; object-fit: cover; background: #717171; }
.cover-fallback { display: grid; place-items: center; color: var(--white); font-size: 9px; font-weight: 700; letter-spacing: .12em; }

.featured-book-copy {
  position: relative;
  z-index: 1;
  display: block;
  min-width: 0;
  height: 127.731px;
  pointer-events: none;
}

.featured-book-copy h2 {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--white);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.2px;
  line-height: 1.08;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.featured-book-copy > p {
  overflow: hidden;
  margin: 7px 0 0;
  color: rgb(217 217 217 / 56%);
  font-family: var(--display);
  font-size: 10px;
  font-weight: 300;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-meta { position: absolute; inset: 0; pointer-events: auto; }
.book-status-chip {
  position: absolute;
  right: 0;
  bottom: 1.3px;
  width: 83px;
  height: 27px;
  padding: 0 7px;
  overflow: hidden;
  border: 0;
  border-radius: 25.962px;
  background: var(--violet);
  color: var(--ink);
  font-size: 11.423px;
  font-weight: 400;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: capitalize;
  white-space: nowrap;
}
.book-status-chip[data-status="want"] { background: var(--violet); color: var(--ink); }
.book-status-chip[data-status="finished"] { background: var(--violet); color: var(--ink); }
.book-percent { position: absolute; bottom: 5px; left: 0; color: #969696; font-size: 14.696px; font-weight: 400; line-height: 1; }

.status-menu {
  position: absolute;
  z-index: 8;
  top: 109px;
  right: 9px;
  display: grid;
  width: 117px;
  height: 139px;
  gap: 4px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--ink);
  box-shadow: 0 14px 30px rgb(0 0 0 / 30%);
}

.status-menu button {
  width: 100px;
  height: 27px;
  min-height: 0;
  padding: 0 6px;
  border: 0;
  border-radius: 25.962px;
  background: var(--panel);
  color: var(--white);
  font-size: 11.423px;
  font-weight: 400;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}
.status-menu button.is-active { background: var(--violet); color: var(--ink); }
.status-menu .remove-book { margin: 0; color: var(--white); }

.library-list { display: grid; gap: 10px; margin-top: 14px; }
.library-card {
  display: grid;
  grid-template-columns: 47.438px minmax(0, 1fr) 83px;
  align-items: center;
  gap: 10.562px;
  width: 324px;
  max-width: 100%;
  height: 84px;
  padding: 10px 12px;
  border: 1.038px solid rgb(91 91 91 / 65%);
  border-radius: 14.538px;
  background: #252525;
}
.library-card .book-cover, .library-card .cover-fallback { width: 47.438px; height: 63.423px; border-radius: 3.609px; }
.library-card-copy { align-self: stretch; min-width: 0; padding-top: 0; }
.library-card-copy h2 { overflow: hidden; margin: 0; color: var(--white); font-family: var(--display); font-size: 14px; font-weight: 700; line-height: 20px; text-overflow: ellipsis; white-space: nowrap; }
.library-card-copy p { overflow: hidden; margin: 2px 0 0; color: rgb(217 217 217 / 56%); font-family: var(--display); font-size: 10px; font-weight: 300; line-height: 12px; text-overflow: ellipsis; white-space: nowrap; }
.library-card-copy .library-card-progress { margin-top: 18px; }
.library-card > button { width: 83px; height: 27px; min-height: 0; padding: 0 8px; border: 0; border-radius: 25.962px; background: var(--coral); color: var(--ink); font-size: 11.423px; font-weight: 400; }
.library-empty { margin: 18px 1px 0; color: var(--muted); font-size: 13px; }
.library-empty p { margin: 0; }
.current-placeholder { min-height: 70px; margin: 0; padding: 24px 16px; border: 1px solid var(--line); border-radius: 14.538px; color: var(--muted); font-size: 13px; }

.reader-footer { display: grid; gap: 16px; margin-top: auto; padding: 30px 26px 69px; text-align: center; }
.add-book-button { width: 342px; max-width: 100%; height: 56px; border: 0; border-radius: 28px; background: var(--coral); color: var(--ink); font-family: var(--display); font-size: 21.176px; font-weight: 600; letter-spacing: 0; line-height: 1; }
.reader-footer p { margin: 0; color: rgb(217 217 217 / 36%); font-size: 11px; line-height: 13px; }

.reader-shell {
  --reader-paper: #f1e2c9;
  --reader-ink: #151515;
  --reader-muted: #77736b;
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  overflow: hidden;
  background: var(--reader-paper);
  color: var(--reader-ink);
  transition: background .18s ease, color .18s ease;
}
.reader-shell[data-theme="light"] { --reader-paper: #fffcf4; --reader-ink: #151515; --reader-muted: #77736b; }
.reader-shell[data-theme="black"] { --reader-paper: #121212; --reader-ink: #f4f0e7; --reader-muted: #b6b1a9; color-scheme: dark; }

.reading-header {
  position: relative;
  z-index: 5;
  display: block;
  flex: 0 0 91px;
  width: 100%;
  height: 91px;
  min-height: 91px;
  padding: 0;
  border-radius: 0 0 27px 27px;
  background: var(--ink);
  color: var(--white);
  transition: height .16s ease, min-height .16s ease, flex-basis .16s ease, opacity .16s ease;
}
.reading-back { position: absolute; top: 49px; left: 36px; display: grid; width: 28px; height: 28px; padding: 0; border: 0; place-items: center; background: transparent; }
.reading-back img { width: 28px; height: 28px; }
.reading-title { position: absolute; top: 55px; right: 90px; left: 72px; overflow: hidden; margin: 0; color: var(--white); font-family: var(--display); font-size: 15.165px; font-weight: 700; letter-spacing: 0; line-height: 18.535px; text-overflow: ellipsis; white-space: nowrap; }
.reading-percent { position: absolute; top: 47px; right: 24px; margin: 0; color: var(--white); font-family: var(--display); font-size: 25.367px; font-weight: 700; letter-spacing: 0; line-height: 31.005px; }
.reading-author { display: none !important; }
.reading-header::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; content: ""; background: var(--ink); pointer-events: none; }
.reader-controls-hidden .reading-header { flex-basis: 0; height: 0; min-height: 0; overflow: hidden; opacity: 0; pointer-events: none; }

.reader-stage { position: relative; min-height: 0; flex: 1; overflow: hidden; isolation: isolate; background: var(--reader-paper); }
.reader-stage > foliate-view, .reader-stage > .epub-reader { display: block; width: 100%; height: 100%; min-height: 100%; background: var(--reader-paper); }
.reader-stage > foliate-view { contain: layout paint; }
.epub-reader iframe { border: 0; }
.epub-reader .epub-container { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; }
.epub-reader[data-mode="pages"] .epub-container { overflow: hidden !important; touch-action: pan-x; }
.fb2-reader { width: 100%; height: 100%; overflow-y: auto; padding: 12px 44px 110px; color: var(--reader-ink); background: var(--reader-paper); font: 20px/1.62 var(--body); -webkit-overflow-scrolling: touch; }
.fb2-reader p { margin: 0 0 1em; }
.reader-loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--reader-muted); font-size: 14px; pointer-events: none; }
.page-mode-hint { position: absolute; z-index: 2; right: 50%; bottom: 9px; width: max-content; max-width: calc(100% - 30px); margin: 0; padding: 6px 10px; border-radius: 14px; transform: translateX(50%); background: rgb(0 0 0 / 14%); color: var(--reader-muted); font-size: 11px; pointer-events: none; }
.page-turn-zones { position: absolute; z-index: 3; inset: 0; display: grid; grid-template-columns: 1fr .9fr 1fr; }
.page-turn-zones button { min-width: 0; padding: 0; border: 0; background: transparent; touch-action: none; -webkit-tap-highlight-color: transparent; }
.reader-center-tap-zone { position: absolute; z-index: 4; top: 31%; left: 50%; width: min(44%, 180px); height: 38%; padding: 0; border: 0; transform: translateX(-50%); background: transparent; touch-action: none; -webkit-tap-highlight-color: transparent; }

.reader-homebar {
  position: relative;
  z-index: 5;
  display: block;
  flex: 0 0 149px;
  width: 100%;
  height: 149px;
  padding: 0;
  border-radius: 27px 27px 0 0;
  background: var(--ink);
  color: var(--white);
  transition: height .16s ease, flex-basis .16s ease, opacity .16s ease;
}
.reader-homebar::before { position: absolute; top: -1px; right: 0; left: 0; height: 2px; content: ""; background: var(--ink); pointer-events: none; }
.reader-page-meta { position: absolute; top: 14px; right: 24px; left: 24px; display: grid; justify-items: center; gap: 3px; min-width: 0; }
.reader-page-meta strong { color: var(--white); font-family: var(--display); font-size: 15.165px; font-weight: 700; line-height: 18.535px; }
.reader-page-meta span { overflow: hidden; max-width: 100%; color: var(--white); font-family: var(--display); font-size: 15.165px; font-weight: 300; line-height: 18.535px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.reader-homebar > button { position: absolute; top: 71px; width: 119.889px; height: 39px; min-height: 0; padding: 0 10px; border: 0; border-radius: 37.5px; background: var(--coral); color: var(--ink); font-size: 16.5px; font-weight: 400; }
#reader-contents-button { left: calc(50% - 127.5px); }
#reader-settings-button { right: calc(50% - 127.5px); }
.reader-homebar button:hover, .reader-homebar button:focus-visible { outline: 0; filter: brightness(.94); }
.reader-controls-hidden .reader-homebar { flex-basis: 0; height: 0; overflow: hidden; opacity: 0; pointer-events: none; }

.reader-sheet-layer { position: absolute; z-index: 6; inset: 0; display: flex; align-items: flex-end; }
.reader-sheet-backdrop { position: absolute; inset: 0; border: 0; background: rgb(0 0 0 / 20%); }
.reader-sheet { position: relative; width: 100%; overflow-y: auto; border: 1px solid var(--line); border-bottom: 0; background: var(--ink); color: var(--white); -webkit-overflow-scrolling: touch; }
.reader-sheet-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.reader-sheet-kicker { display: none; }
.reader-sheet h2 { margin: 0; color: var(--white); font-family: var(--body); font-weight: 600; }
.reader-sheet-close { display: grid; width: 28px; height: 28px; padding: 0; border: 1px solid #747474; border-radius: 50%; place-items: center; background: transparent; color: var(--white); font-size: 20px; font-weight: 300; line-height: 1; }

#contents-sheet .reader-sheet { display: flex; height: min(366px, 48dvh); max-height: none; flex-direction: column; overflow: hidden; padding: 16px 24px 24px; border-radius: 32px 32px 0 0; }
#contents-sheet .reader-sheet-heading { flex: 0 0 auto; justify-content: center; margin-bottom: 16px; }
#contents-sheet .reader-sheet h2 { font-family: var(--display); font-size: 22px; line-height: 1.32; }
#contents-sheet .reader-sheet-close { display: none; }
.contents-list { display: grid; min-height: 0; flex: 1; gap: 9px; overflow-y: auto; padding: 0 1px 10px 0; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.contents-list p { margin: 0; color: #a6a6a0; font-size: 14px; line-height: 1.45; }
.contents-list button { width: 100%; min-height: 48px; padding: 10px 20px; border: 1px solid rgb(61 61 61 / 35%); border-radius: 14px; background: #5d5d5d; color: var(--white); font-size: 15px; font-weight: 500; line-height: 1.32; text-align: left; }
.contents-list button[data-level="1"] { padding-left: 32px; color: var(--white); font-size: 14px; }
.contents-list button[data-level="2"] { padding-left: 44px; color: #c9c8c2; font-size: 13px; }

#settings-sheet .reader-sheet {
  max-height: min(50dvh, 480px);
  padding: 21px 24px 32px;
  border-radius: 26px 26px 0 0;
}
#settings-sheet .reader-sheet-heading { position: sticky; z-index: 2; top: -21px; margin: -21px -1px 28px; padding: 21px 1px 8px; background: var(--ink); }
#settings-sheet .reader-sheet h2 { font-size: 24px; line-height: 30px; }
.settings-group { margin: 0 0 18px; }
.settings-group:first-of-type { padding-bottom: 15px; border-bottom: 1px solid #5b5b5b; }
.settings-label, .settings-field > span, .settings-range > span { display: block; margin: 0 0 10px; color: var(--white); font-size: 14px; font-weight: 600; line-height: 19px; }
.theme-options { display: grid; grid-template-columns: 102fr 100fr 110fr; gap: 13px; }
.theme-options button { height: 42px; min-height: 0; border: 1px solid #747474; border-radius: 22px; background: #3d3d3d; color: var(--white); font-size: 14px; font-weight: 500; }
.theme-options button[data-reader-theme="warm"] { border-color: rgb(255 108 75 / 65%); background: #f1e2c9; color: var(--ink); }
.theme-options button[data-reader-theme="light"] { border-color: rgb(255 255 255 / 65%); background: #fffcf4; color: var(--ink); }
.theme-options button[data-reader-theme="black"] { border-color: rgb(116 116 116 / 65%); background: #121212; color: var(--white); }
.theme-options button.is-active { outline: 2px solid var(--coral); outline-offset: 1px; }
.mode-options { display: grid; grid-template-columns: 162fr 164fr; gap: 13px; }
.mode-options button { height: 42px; min-height: 0; border: 1px solid rgb(116 116 116 / 65%); border-radius: 21px; background: var(--panel); color: var(--white); font-size: 14px; font-weight: 500; }
.mode-options button span { margin-left: 5px; color: rgb(217 217 217 / 52%); font-size: 11px; }
.mode-options button.is-active { border-color: var(--coral); background: var(--coral); color: var(--ink); }
.mode-options button.is-active span { color: rgb(21 21 21 / 55%); }
.settings-field, .settings-range { display: grid; margin: 0 0 22px; }
.settings-field select { width: 100%; height: 48px; padding: 0 17px; border: 1px solid rgb(116 116 116 / 65%); border-radius: 12px; background: var(--panel); color: rgb(217 217 217 / 90%); font-size: 15px; }
.settings-range { grid-template-columns: 1fr auto; gap: 0 10px; }
.settings-range output { color: rgb(217 217 217 / 70%); font-size: 13px; font-weight: 500; }
.settings-range input { grid-column: 1 / -1; width: 100%; height: 24px; margin: 0; accent-color: var(--coral); }
.settings-range:nth-of-type(3) input { accent-color: var(--lime); }
.settings-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 4px 0 24px; padding: 15px 0; border-top: 1px solid #5b5b5b; }
.settings-switch-row p { margin: 0 0 3px; color: var(--white); font-size: 14px; font-weight: 600; }
.settings-switch-row > div > span { color: rgb(217 217 217 / 55%); font-size: 12px; }
.settings-switch { width: 52px; height: 32px; padding: 4px; border: 0; border-radius: 16px; background: #616161; transition: background .16s ease; }
.settings-switch span { display: block; width: 24px; height: 24px; border-radius: 50%; background: var(--white); transition: transform .16s ease; }
.settings-switch[aria-checked="true"] { background: var(--coral); }
.settings-switch[aria-checked="true"] span { transform: translateX(20px); }
.reset-settings { width: 100%; min-height: 42px; border: 1px solid #656565; border-radius: 21px; background: transparent; color: var(--white); font-size: 14px; }

.import-dialog { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; padding: 26px; }
.import-backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / 79%); }
.import-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 102.153px minmax(0, 1fr);
  gap: 10.527px;
  width: min(100%, 346.431px);
  height: 169.885px;
  padding: 16.655px 17.77px;
  border: 1.11px solid rgb(91 91 91 / 65%);
  border-radius: 15.545px;
  transform: translateY(12px);
  background: var(--panel);
  color: var(--white);
}
.import-cover .book-cover, .import-cover .cover-fallback { width: 102.153px; height: 136.574px; border-radius: 7.772px; }
.import-copy { display: flex; min-width: 0; flex-direction: column; padding-top: 11.145px; }
.import-copy h2 { overflow: hidden; margin: 0; font-family: var(--display); font-size: 25.367px; font-weight: 700; letter-spacing: 0; line-height: 31.005px; text-overflow: ellipsis; white-space: nowrap; }
.import-copy p { overflow: hidden; margin: -1px 0 0; color: rgb(217 217 217 / 56%); font-family: var(--display); font-size: 15.545px; font-weight: 300; line-height: 22.207px; text-overflow: ellipsis; white-space: nowrap; }
.import-read { align-self: flex-end; width: 83px; height: 27px; min-height: 0; margin-top: auto; border: 0; border-radius: 25.962px; background: var(--coral); color: var(--ink); font-size: 11.423px; font-weight: 400; }
.import-close { position: absolute; z-index: 2; top: 4px; right: 5px; width: 28px; height: 28px; padding: 0; border: 0; background: transparent; color: var(--white); font-size: 20px; font-weight: 300; line-height: 1; }

.reader-toast { position: fixed; z-index: 20; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 14px); width: max-content; max-width: calc(100% - 40px); margin: 0; padding: 9px 14px; border-radius: 20px; transform: translateX(-50%); background: rgb(21 21 21 / 92%); color: var(--white); font-size: 12px; line-height: 1.25; text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.reader-toast.is-visible { opacity: 1; }
.reader-toast[data-kind="error"] { color: #ffb0a0; }

@media (min-width: 720px) {
  body { padding: 22px; }
  .pilcrow-app { width: 390px; min-height: 844px; margin: 0 auto; border-radius: 32px; box-shadow: 0 20px 80px rgb(0 0 0 / 35%); }
  .library-screen, .reader-shell { min-height: 844px; }
  .reader-shell { position: absolute; }
  .import-dialog { position: absolute; border-radius: 32px; }
}

/* v38 — definitive final layer. Keep this at EOF: it resolves the earlier
   prototype cascade where base Figma rules were silently undoing fixes. */
#space-root,
#space-root + .reader-app { will-change: opacity, transform; }
.world-enter { opacity: 0; transform: translateX(12px); }
.world-exit { pointer-events: none; }
.world-exit-active { opacity: 0; transform: translateX(-12px); }

.space-bottom-nav-items { padding: 36px 12px 0 !important; }
.reader-main-nav { padding: 30px 12px 0 !important; }
.reader-main-library-icon img,
.reader-main-nav .is-active .reader-main-library-icon img {
  filter: none !important;
  opacity: 1 !important;
}
.reader-main-nav button.is-active { color: #7a5dff !important; }

.reader-shell { display: block !important; overscroll-behavior-x: none; }
.reader-stage { position: absolute !important; inset: 0 !important; height: 100% !important; }
.reading-header {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  left: 0 !important;
  transition: opacity .32s ease, transform .48s cubic-bezier(.2,.75,.2,1) !important;
}
.reader-homebar {
  position: absolute !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  transition: opacity .32s ease, transform .48s cubic-bezier(.2,.75,.2,1) !important;
}
.reader-controls-hidden .reading-header {
  height: 91px !important;
  min-height: 91px !important;
  flex-basis: 91px !important;
  overflow: visible !important;
  opacity: 0 !important;
  transform: translateY(-108%) !important;
}
.reader-controls-hidden .reader-homebar {
  height: 149px !important;
  flex-basis: 149px !important;
  overflow: visible !important;
  opacity: 0 !important;
  transform: translateY(108%) !important;
}
.library-screen { overscroll-behavior-x: none; }

@media (max-width: 383px) {
  .pilcrow-header { grid-template-columns: 52px minmax(170px, 187px) 33px; gap: 8px; padding-right: 18px; }
  .wordmark { width: 52px; padding-left: 0; font-size: 23px; }
  .space-switcher { width: 100%; grid-template-columns: 57% 43%; }
  .space-switcher, .bookspace-app .space-switcher { transform: none; }
  .reader-library { padding-right: 21px; padding-left: 25px; }
  #current-book, .library-list { max-width: calc(100vw - 52px); }
  .featured-book-card { grid-template-columns: 84px minmax(0, 1fr); column-gap: 12px; padding-right: 13px; padding-left: 13px; }
  .featured-book-card > .book-cover, .featured-book-card > .cover-fallback { width: 84px; height: 128px; }
  .library-card { grid-template-columns: 47px minmax(0, 1fr) 72px; gap: 8px; }
  .library-card > button { width: 72px; }
  .bookspace-hero { padding-right: 32px; padding-left: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* v32 — Space/Reader interaction pass */
.pilcrow-app { opacity: 1; transform: translateY(0); transition: opacity .24s ease, transform .24s cubic-bezier(.2,.7,.2,1); }
html.app-enter .pilcrow-app { opacity: 0; transform: translateY(8px); }
html.app-leave .pilcrow-app { opacity: 0; transform: translateY(-7px); }

/* Fresh Space / Home reference: the world switch is larger and slightly lower. */
.space-logo-button { top: 62.75px; }
.space-world-switch { top: 49.75px; right: 24px; width: 138px; height: 37.13px; padding: 3.27px; border-radius: 13.47px; }
.space-world-switch > * { border-radius: 11.1px; font-size: 10.9px; }

.space-reading-card { overflow: visible; }
.space-reading-card-open { position: absolute; z-index: 0; inset: 0; padding: 0; border: 0; border-radius: inherit; background: transparent; }
.space-reading-card .space-cover, .space-reading-copy { z-index: 1; }
.space-reading-copy { pointer-events: none; }
.space-reading-copy > strong, .space-reading-copy > span:not(.space-reading-status), .space-reading-copy > em { pointer-events: none; }
.space-reading-status { top: 92.73px; bottom: auto; z-index: 3; margin: 0 !important; overflow: visible; color: inherit !important; }
.space-reading-status > i { pointer-events: none; }
.space-reading-status > button { display: grid; width: 98px; height: 28px; padding: 0 7px; border: 0; border-radius: 13.29px; place-items: center; background: var(--space-peach); color: var(--space-black); font-family: inherit; font-size: 9.6px; font-weight: 300; white-space: nowrap; }
.space-status-menu { position: absolute; top: 39px; right: 0; display: grid; width: 197px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; padding: 7px; border-radius: 14px; background: var(--space-black); box-shadow: 0 14px 30px rgb(0 0 0 / 28%); animation: status-menu-in .18s .04s both; }
.space-status-menu button { width: 100%; height: 26px; padding: 0 5px; border: 0; border-radius: 13px; background: var(--space-panel); color: var(--space-cream); font-family: inherit; font-size: 8.8px; font-weight: 300; line-height: 1; white-space: nowrap; }
.space-reading-card.is-status-open { z-index: 7; }

/* Reader/Main has a real flex column: its tab panel now stays at Figma's bottom position. */
.library-screen { display: flex; min-height: max(100dvh, 844px); flex-direction: column; }
.reader-main-header { flex: 0 0 102px; height: 102px; }
.reader-world-switch { top: 49.75px; right: 24px; width: 138px; height: 37.13px; padding: 3.27px; border-radius: 13.47px; }
.reader-world-switch > * { font-size: 10.9px; }
.library-filters { overflow-y: hidden; overscroll-behavior-x: contain; touch-action: pan-x; }
.reader-footer { margin-top: auto; }
.reader-main-nav { margin-top: 0; }

.featured-book-card { position: relative; }
.book-status-panel { top: 92.73px; bottom: auto; overflow: visible; }
.book-percent { top: 62px; bottom: auto; left: 0; }
.featured-book-card.is-status-open { margin-bottom: 78px; }
.featured-book-card.is-status-open .book-status-chip { width: 98px; }

/* Reader panels move as panels, not as a sudden layout cut. */
.reading-header { transition: height .42s cubic-bezier(.2,.7,.2,1), min-height .42s cubic-bezier(.2,.7,.2,1), flex-basis .42s cubic-bezier(.2,.7,.2,1), opacity .28s ease, transform .42s cubic-bezier(.2,.7,.2,1); will-change: height, opacity, transform; }
.reader-homebar { transition: height .42s cubic-bezier(.2,.7,.2,1), flex-basis .42s cubic-bezier(.2,.7,.2,1), opacity .28s ease, transform .42s cubic-bezier(.2,.7,.2,1); will-change: height, opacity, transform; }
.reader-controls-hidden .reading-header { transform: translateY(-18px); }
.reader-controls-hidden .reader-homebar { transform: translateY(18px); }
.reading-header::after { bottom: -2px; height: 4px; background: #151515; }

/* v37 final interaction layer — this must stay after every Figma/base layer. */
/* The two worlds use the same document. Reader is warmed in the background,
   then both surfaces cross-fade instead of flashing through a new page. */
#space-root,
#space-root + .reader-app {
  will-change: opacity, transform;
}
.world-enter { opacity: 0; transform: translateX(12px); }
.world-exit { pointer-events: none; }
.world-exit-active { opacity: 0; transform: translateX(-12px); }

/* Figma-aligned lower navigation: these declarations intentionally override
   the earlier prototype defaults. */
.space-bottom-nav-items { padding: 36px 12px 0; }
.reader-main-nav { padding: 30px 12px 0; }
.reader-main-library-icon img,
.reader-main-nav .is-active .reader-main-library-icon img {
  filter: none;
  opacity: 1;
}
.reader-main-nav button.is-active { color: #7a5dff; }

/* Reader controls are true overlays. Showing them must never resize EPUB,
   which was the source of the white seam and the text jumping underneath it. */
.reader-shell { display: block; overscroll-behavior-x: none; }
.reader-stage { position: absolute; inset: 0; height: 100%; }
.reading-header {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  transition: opacity .32s ease, transform .48s cubic-bezier(.2,.75,.2,1);
}
.reader-homebar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  transition: opacity .32s ease, transform .48s cubic-bezier(.2,.75,.2,1);
}
.reader-controls-hidden .reading-header {
  height: 91px;
  min-height: 91px;
  flex-basis: 91px;
  overflow: visible;
  opacity: 0;
  transform: translateY(-108%);
}
.reader-controls-hidden .reader-homebar {
  height: 149px;
  flex-basis: 149px;
  overflow: visible;
  opacity: 0;
  transform: translateY(108%);
}
.library-screen { overscroll-behavior-x: none; }

/* v33 — real in-page Space/Reader tabs and Reader stability pass. */
#space-root + .reader-app { position: absolute; z-index: 4; inset: 0; }
.world-enter { opacity: 0; transform: translateX(12px); }
.world-exit { pointer-events: none; }
.world-exit-active { opacity: 0; transform: translateX(-12px); }

.space-reading-copy { pointer-events: auto; }
.space-reading-copy > strong, .space-reading-copy > em, .space-reading-copy > span:not(.space-reading-status) { pointer-events: none; }
.space-bottom-nav-items { padding-top: 36px; }
.reader-main-nav { padding-top: 30px; }
.reader-main-library-icon img, .reader-main-nav .is-active .reader-main-library-icon img { filter: none; opacity: 1; }
.reader-main-nav button.is-active { color: #7a5dff; }

/* Reader controls are overlays now. The EPUB viewport never resizes when they appear. */
.reader-shell { display: block; }
.reader-stage { position: absolute; inset: 0; height: 100%; }
.reading-header { position: absolute; top: 0; right: 0; left: 0; transition: opacity .32s ease, transform .48s cubic-bezier(.2,.75,.2,1); }
.reader-homebar { position: absolute; right: 0; bottom: 0; left: 0; transition: opacity .32s ease, transform .48s cubic-bezier(.2,.75,.2,1); }
.reader-controls-hidden .reading-header { height: 91px; min-height: 91px; flex-basis: 91px; overflow: visible; opacity: 0; transform: translateY(-108%); }
.reader-controls-hidden .reader-homebar { height: 149px; flex-basis: 149px; overflow: visible; opacity: 0; transform: translateY(108%); }

/* Space · Alpha Prototype [03] */
@font-face {
  font-family: "Geologica Pilcrow";
  src: url("/assets/space/geologica-variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

.space-app {
  --space-black: #151515;
  --space-panel: #2b2b2b;
  --space-grey: #707070;
  --space-cream: #ffeed7;
  --space-peach: #fbd096;
  --space-purple: #7a5dff;
  --space-lime: #c8f542;
  --space-coral: #ff6c4b;
  min-height: max(100dvh, 844px);
  background: var(--space-black);
  color: var(--space-cream);
  font-family: "Geologica Pilcrow", var(--body);
  font-variation-settings: "CRSV" 0, "SHRP" 0;
  isolation: isolate;
}

.space-header { position: absolute; z-index: 5; inset: 0 0 auto; height: 88px; }
.space-logo-button { position: absolute; top: 52.68px; left: 34px; width: 63.75px; height: 18.73px; padding: 0; border: 0; background: transparent; }
.space-logo { width: 100%; height: 100%; }
.space-world-switch { position: absolute; top: 45.75px; right: 19.75px; display: grid; grid-template-columns: 1fr 1fr; width: 101px; height: 27px; padding: 2.38px; border-radius: 13.47px; background: var(--space-panel); }
.space-world-switch > * { display: grid; min-width: 0; padding: 0; border: 0; border-radius: 11.1px; place-items: center; background: transparent; color: var(--space-grey); font-family: inherit; font-size: 7.93px; font-weight: 200; line-height: 1; }
.space-world-switch .is-active { background: var(--space-purple); color: var(--space-black); }

.space-view { position: relative; min-height: 844px; padding-bottom: 150px; overflow: hidden; }
.space-view h1 { margin: 0; color: var(--space-peach); font-size: 39.83px; font-weight: 900; letter-spacing: -.4px; line-height: .9; }
.space-intro { margin: 0; color: var(--space-grey); font-size: 14px; font-weight: 300; line-height: 1.05; }

.space-view--home h1 { position: absolute; top: 96.75px; left: 41px; width: 296.5px; height: 120.5px; }
.space-view--home .space-intro { position: absolute; top: 193.25px; left: 44px; width: 293.5px; }
.space-home-heart { position: absolute; top: 148.25px; left: 243px; width: 37px; height: 33.41px; }
.space-home-underline { position: absolute; top: 263.75px; left: 133px; width: 115.03px; height: 16.69px; }

.space-cover { position: relative; display: grid; flex: 0 0 auto; overflow: hidden; border-radius: 7.27px; place-items: center; background: #727272; }
.space-cover > img:first-child { width: 14%; height: auto; }
.space-cover > .space-cover-lines { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .92; }
.space-cover > span { position: relative; z-index: 1; color: #efefef; font-size: 7px; font-weight: 700; letter-spacing: .6px; }

.space-reading-card { position: absolute; top: 301.75px; left: 28.5px; display: grid; grid-template-columns: 95.54px minmax(0, 1fr); column-gap: 15px; width: 324px; height: 158.88px; padding: 15.58px 16.62px; overflow: hidden; border: 0; border-radius: 14.54px; background: var(--space-panel); color: var(--space-cream); text-align: left; }
.space-reading-card .space-cover { width: 95.54px; height: 127.73px; }
.space-reading-copy { position: relative; display: block; min-width: 0; }
.space-reading-copy > strong, .space-reading-copy > span, .space-reading-copy > em { display: block; overflow: hidden; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.space-reading-copy > strong { margin-top: 1px; font-size: 23.73px; font-weight: 700; line-height: 1.22; }
.space-reading-copy > span { margin-top: 1px; color: var(--space-grey); font-size: 15px; font-weight: 300; line-height: 1.38; }
.space-reading-copy > em { margin-top: 14px; color: var(--space-grey); font-size: 12.5px; font-weight: 400; }
.space-reading-status { position: absolute; right: 0; bottom: 0; left: -8px; display: flex !important; width: 189px; height: 35px; align-items: center; padding: 3.5px; border-radius: 16.75px; background: var(--space-black); }
.space-reading-status i { flex: 1; padding-left: 20.5px; color: rgb(217 217 217 / 56%); font-size: 9.6px; font-style: normal; font-weight: 300; }
.space-reading-status b { display: grid; width: 98px; height: 28px; border-radius: 13.29px; place-items: center; background: var(--space-peach); color: var(--space-black); font-size: 9.6px; font-weight: 300; }

.space-view--explore h1 { position: absolute; top: 96.75px; left: 41px; }
.space-view--explore .space-intro { position: absolute; top: 193.25px; left: 44px; width: 293.5px; }
.space-search { position: absolute; top: 260.75px; left: 21.5px; display: flex; width: 349px; height: 49.86px; align-items: center; padding: 0 18px; border-radius: 24.93px; background: var(--space-panel); }
.space-search i { position: relative; width: 18px; height: 18px; margin-right: 14px; border: 1.8px solid var(--space-grey); border-radius: 50%; }
.space-search i::after { position: absolute; right: -4px; bottom: -3px; width: 7px; height: 1.8px; content: ""; transform: rotate(45deg); transform-origin: left center; background: var(--space-grey); }
.space-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--space-cream); font-family: inherit; font-size: 12px; font-weight: 300; }
.space-search input::placeholder { color: var(--space-grey); opacity: 1; }
.space-browse-cards { position: absolute; top: 334.75px; left: 21.5px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; width: 350px; }
.space-browse-card { height: 100px; padding: 15.5px 16px; border: 0; border-radius: 14px; text-align: left; }
.space-browse-card strong { display: block; color: var(--space-black); font-size: 24px; font-weight: 700; line-height: .91; }
.space-browse-card span { display: block; margin-top: 12px; color: var(--space-black); font-size: 10px; font-weight: 300; }
.space-browse-card--country { background: var(--space-peach); }
.space-browse-card--mood { background: var(--space-purple); }
.space-browse-card--mood strong, .space-browse-card--mood span { color: var(--space-cream); }
.space-search-results { position: absolute; z-index: 2; top: 447px; right: 21.5px; left: 21.5px; padding: 12px; border-radius: 14px; background: var(--space-panel); }
.space-search-results button { display: block; width: 100%; padding: 10px 0; border: 0; border-bottom: 1px solid rgb(255 238 215 / 12%); background: transparent; color: var(--space-cream); text-align: left; }
.space-search-results button:last-child { border-bottom: 0; }
.space-search-results button span { display: block; margin-top: 2px; color: var(--space-grey); font-size: 11px; }
.space-search-results p { margin: 3px; color: var(--space-grey); font-size: 12px; }

.space-view--tops h1 { position: absolute; top: 96.75px; left: 41px; }
.space-view--tops .space-intro { position: absolute; top: 188.25px; left: 44px; width: 293px; }
.space-top-tabs { position: absolute; top: 262.75px; left: 78.5px; display: grid; grid-template-columns: 1fr 1fr; gap: 0; width: 250px; height: 32px; }
.space-top-tabs button { min-width: 0; border: 0; border-radius: 20px; background: transparent; color: var(--space-cream); font-family: inherit; font-size: 13px; font-weight: 400; }
.space-top-tabs button.is-active { background: var(--space-lime); color: var(--space-black); }
.space-genre-filter { position: absolute; top: 315.75px; left: 21.5px; display: flex; width: 349px; height: 49.86px; align-items: center; gap: 13px; padding: 0 27px; border: 0; border-radius: 24.93px; background: var(--space-panel); color: var(--space-cream); font-family: inherit; font-size: 12px; font-weight: 400; }
.space-genre-filter span { font-size: 21px; }
.space-genre-menu { position: absolute; z-index: 5; top: 371px; left: 21.5px; display: grid; width: 349px; gap: 4px; padding: 8px; border-radius: 18px; background: var(--space-panel); box-shadow: 0 16px 30px rgb(0 0 0 / 30%); }
.space-genre-menu button { height: 34px; padding: 0 14px; border: 0; border-radius: 13px; background: transparent; color: var(--space-cream); font-family: inherit; font-size: 12px; font-weight: 300; text-align: left; }
.space-genre-menu button.is-active { background: var(--space-lime); color: var(--space-black); }
.space-ranking-list { position: absolute; top: 382.25px; left: 42px; display: grid; gap: 14px; width: 306px; }
.space-ranking-card { position: relative; display: grid; grid-template-columns: 47.8px minmax(0, 1fr); column-gap: 11px; width: 306px; height: 94px; padding: 10px 13px; border: 0; border-radius: 14px; background: var(--space-panel); color: var(--space-cream); text-align: left; }
.space-ranking-card .space-cover { width: 47.8px; height: 64px; }
.space-ranking-card > span { min-width: 0; padding-top: 4px; }
.space-ranking-card strong, .space-ranking-card em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.space-ranking-card strong { font-size: 13px; font-weight: 700; }
.space-ranking-card em { margin-top: 2px; color: var(--space-grey); font-size: 10px; font-style: normal; font-weight: 300; }
.space-ranking-card > i { position: absolute; top: 7px; right: 18px; color: var(--space-grey); font-size: 10px; font-style: normal; letter-spacing: 2px; }
.space-ranking-card > b { position: absolute; right: 13px; bottom: 12px; display: grid; width: 78px; height: 24px; border-radius: 12px; place-items: center; background: var(--space-lime); color: var(--space-black); font-size: 9px; font-weight: 400; }
.space-collection-list { position: absolute; top: 323.25px; left: 18.5px; display: grid; gap: 20px; width: 350px; }
.space-collection { height: 170px; padding: 20px 18px; border: 0; border-radius: 22px; text-align: left; }
.space-collection small, .space-collection strong, .space-collection span { display: block; }
.space-collection small { font-size: 10px; font-weight: 700; }
.space-collection strong { margin-top: 18px; font-size: 24px; font-weight: 700; line-height: 1.06; }
.space-collection span { margin-top: 8px; font-size: 11px; font-weight: 300; }
.space-collection--purple { background: var(--space-purple); color: var(--space-cream); }
.space-collection--purple small { color: var(--space-lime); }
.space-collection--cream { height: 130px; background: var(--space-peach); color: var(--space-black); }
.space-collection--cream strong { margin-top: 18px; font-size: 21px; }

.space-profile-banner { position: absolute; top: 102.5px; left: 0; display: flex; width: 100%; height: 105.5px; align-items: center; gap: 18px; padding: 15px 25px; background: var(--space-purple); color: var(--space-cream); }
.space-profile-avatar { display: grid; width: 76px; height: 76px; flex: 0 0 auto; border-radius: 50%; place-items: center; background: var(--space-peach); color: var(--space-black); font-size: 33px; font-weight: 700; }
.space-profile-banner h1 { color: var(--space-cream); font-size: 30px; line-height: 1; }
.space-profile-banner p { margin: 6px 0 0; font-size: 13px; font-weight: 300; }
.space-profile-banner strong { display: block; margin-top: 8px; color: var(--space-lime); font-size: 11px; font-weight: 400; }
.space-profile-metric { position: absolute; top: 235px; left: 20px; width: 350px; max-width: calc(100% - 40px); height: 161px; padding: 20px; overflow: hidden; border: 0; border-radius: 25px; background: var(--space-coral); color: var(--space-black); text-align: left; }
.space-profile-metric small, .space-profile-metric strong, .space-profile-metric span { display: block; }
.space-profile-metric small { font-size: 10px; font-weight: 700; }
.space-profile-metric > strong { margin-top: 20px; font-size: 52px; font-weight: 800; line-height: .7; }
.space-profile-metric > span { margin-top: 18px; font-size: 12px; font-weight: 400; }
.space-profile-metric i { position: absolute; top: 31px; right: 31px; display: grid; width: 50px; height: 50px; border-radius: 50%; place-items: center; background: var(--space-black); color: var(--space-cream); font-size: 9px; font-style: normal; font-weight: 300; line-height: .9; text-align: center; }
.space-profile-metric i b { font-size: 17px; font-weight: 700; }

.space-entity-banner { position: absolute; top: 97.75px; left: 0; width: 100%; height: 170px; }
.space-book-banner { display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 17px; padding: 46.5px 20px 12.5px; background: var(--space-purple); }
.space-book-banner .space-cover { width: 64px; height: 88px; }
.space-book-banner > div { min-width: 0; }
.space-book-banner h1 { color: var(--space-cream); font-size: 30px; line-height: 1.05; white-space: nowrap; }
.space-entity-link { display: block; margin-top: 9px; padding: 0; border: 0; background: transparent; color: var(--space-cream); font-family: inherit; font-size: 14px; font-weight: 300; }
.space-book-banner p { margin: 17px 0 0; color: var(--space-cream); font-size: 11px; font-weight: 300; }
.space-back { position: absolute; top: 12.75px; left: 20px; padding: 0; border: 0; background: transparent; color: inherit; font-family: inherit; font-size: 12px; font-weight: 300; }
.space-author-banner { padding: 38.75px 34px; background: var(--space-cream); color: var(--space-black); }
.space-author-banner h1 { color: var(--space-panel); font-size: 30px; line-height: 1.05; }
.space-author-banner p { margin: 16px 0 0; font-size: 12px; font-weight: 600; }
.space-author-portrait { position: absolute; top: 16.75px; right: 20px; width: 99.5px; height: 136.5px; border-radius: 8px; background: var(--space-peach); }
.space-author-banner .space-back { color: var(--space-black); }
.space-placeholder-copy { position: absolute; top: 442.25px; left: 193.5px; margin: 0; color: var(--space-grey); font-size: 14px; font-weight: 300; line-height: 1.05; }
.space-view--profile .space-placeholder-copy { top: 538px; left: 122.5px; }

.space-bottom-nav { position: absolute; z-index: 6; right: 0; bottom: 0; left: 0; height: 128px; overflow: hidden; border-radius: 24px 24px 0 0; background: var(--space-panel); }
.space-bottom-nav-items { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; height: 98px; padding: 15px 12px 0; }
.space-bottom-nav-items button { display: flex; min-width: 0; flex-direction: column; align-items: center; gap: 5px; padding: 0; border: 0; background: transparent; color: var(--space-cream); font-family: inherit; font-size: 10.7px; font-weight: 300; }
.space-bottom-nav-items button.is-active { color: var(--space-purple); }
.space-nav-icon { position: relative; display: block; width: 21.44px; height: 21.44px; color: currentColor; }
.space-nav-icon::before, .space-nav-icon::after { position: absolute; content: ""; background: currentColor; }
.space-nav-icon--home::before { inset: 0; -webkit-mask: url("/assets/space/nav-home.svg") center / contain no-repeat; mask: url("/assets/space/nav-home.svg") center / contain no-repeat; }
.space-nav-icon--home::after { width: 8.57px; height: 12.86px; right: 6.44px; bottom: 0; -webkit-mask: url("/assets/space/nav-home-door.svg") center / contain no-repeat; mask: url("/assets/space/nav-home-door.svg") center / contain no-repeat; }
.space-nav-icon--explore::before { width: 19.29px; height: 19.29px; top: 1px; left: 0; -webkit-mask: url("/assets/space/nav-search.svg") center / contain no-repeat; mask: url("/assets/space/nav-search.svg") center / contain no-repeat; }
.space-nav-icon--explore::after { width: 7px; height: 7px; right: 0; bottom: 0; -webkit-mask: url("/assets/space/nav-search-handle.svg") center / contain no-repeat; mask: url("/assets/space/nav-search-handle.svg") center / contain no-repeat; }
.space-nav-icon--tops::before { inset: 0; -webkit-mask: url("/assets/space/nav-tops.svg") center / contain no-repeat; mask: url("/assets/space/nav-tops.svg") center / contain no-repeat; }
.space-nav-icon--profile::before { width: 19px; height: 8.5px; right: 1.1px; bottom: 0; -webkit-mask: url("/assets/space/nav-user-body.svg") center / contain no-repeat; mask: url("/assets/space/nav-user-body.svg") center / contain no-repeat; }
.space-nav-icon--profile::after { width: 10.7px; height: 10.7px; top: 0; left: 5.3px; -webkit-mask: url("/assets/space/nav-user-head.svg") center / contain no-repeat; mask: url("/assets/space/nav-user-head.svg") center / contain no-repeat; }
.space-home-indicator { position: absolute; bottom: 8px; left: 50%; width: 134px; height: 5px; border-radius: 100px; transform: translateX(-50%); background: var(--space-grey); }

@media (min-width: 720px) {
  .space-app { height: 844px; min-height: 844px; }
}

/* Reader/Main · Alpha Prototype [03] */
.reader-app { overflow: hidden; font-family: "Geologica Pilcrow", var(--body); }
.library-screen { min-height: max(100dvh, 844px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.reader-main-header { position: relative; height: 92px; flex: 0 0 92px; }
.reader-main-logo { position: absolute; top: 52.93px; left: 26px; width: 63.75px; height: 18.73px; }
.reader-world-switch { position: absolute; top: 46px; right: 27.75px; display: grid; grid-template-columns: 1fr 1fr; width: 100px; height: 27px; padding: 2.38px; border-radius: 13.47px; background: #2b2b2b; }
.reader-world-switch > * { display: grid; min-width: 0; border-radius: 11.1px; place-items: center; color: #707070; font-family: inherit; font-size: 7.93px; font-weight: 200; line-height: 1; }
.reader-world-switch .is-active { background: #ff6c4b; color: #151515; }
.reader-library { flex: 0 0 auto; padding: 5px 30px 0 32.5px; }
.reader-library h1 { width: 341px; max-width: 100%; color: #fbd096; font-family: "Geologica Pilcrow", var(--display); font-size: 39.83px; font-weight: 900; letter-spacing: -.4px; line-height: .9; }
.library-filters { display: flex; width: calc(100% + 30px); max-width: none; height: 28.27px; gap: 6.64px; margin: 22px 0 0 -2.5px; padding: 0 30px 1px 0; overflow-x: auto; scrollbar-width: none; }
.library-filters::-webkit-scrollbar { display: none; }
.library-filters button { width: max-content; min-width: max-content; height: 28.27px; padding: 0 11.07px; border-radius: 13.29px; background: #2b2b2b; color: #ffeed7; font-family: inherit; font-size: 9.6px; font-weight: 300; }
.library-filters button.is-active { background: #fbd096; color: #151515; }
.reader-intro { width: 231px; min-height: 29px; margin: 16px 0 22px -2.5px; color: #707070; font-family: inherit; font-size: 14px; font-weight: 300; line-height: 1.05; }
.reader-intro strong { color: #7a5dff; font-weight: 700; }
#current-book, .library-list { width: 324px; max-width: calc(100vw - 65px); margin-left: .5px; }
.featured-book-card { grid-template-columns: 95.54px minmax(0, 1fr); column-gap: 15px; width: 324px; height: 158.88px; padding: 15.58px 16.62px; overflow: visible; border: 0; border-radius: 14.54px; background: #2b2b2b; transition: margin-bottom .28s ease; }
.featured-book-card > .book-cover, .featured-book-card > .cover-fallback { width: 95.54px; height: 127.73px; border-radius: 7.27px; }
.featured-book-copy { height: 127.73px; }
.featured-book-copy h2 { margin-top: 1px; font-family: "Geologica Pilcrow", var(--display); font-size: 23.73px; font-weight: 700; letter-spacing: -.22px; line-height: 1.22; }
.featured-book-copy > p { margin-top: 1px; font-family: inherit; font-size: 15px; line-height: 1.38; }
.book-meta { z-index: 2; }
.book-percent { bottom: 35px; left: 20.5px; color: #707070; font-family: inherit; font-size: 12.5px; font-weight: 300; }
.book-status-panel { position: absolute; right: 0; bottom: 0; display: block; width: 189px; height: 35px; padding: 3.5px; overflow: hidden; border-radius: 16.75px; background: #151515; transition: width .26s cubic-bezier(.2,.8,.2,1), height .28s cubic-bezier(.2,.8,.2,1), border-radius .28s ease, box-shadow .28s ease; }
.book-status-caption { position: absolute; top: 11px; left: 20.5px; color: rgb(217 217 217 / 56%); font-family: inherit; font-size: 9.6px; font-weight: 300; line-height: 1; }
.book-status-chip { position: absolute; top: 3.5px; right: 3.5px; bottom: auto; width: 98px; height: 28px; padding: 0 9px; border-radius: 13.29px; background: #fbd096; color: #151515; font-family: inherit; font-size: 9.6px; font-weight: 300; text-transform: none; transition: width .24s ease, background .18s ease; }
.book-status-chip[data-status="want"], .book-status-chip[data-status="finished"] { background: #fbd096; color: #151515; }
.featured-book-card.is-status-open { z-index: 4; }
.featured-book-card.is-status-open .book-status-panel { width: 197px; height: 113px; border-radius: 14.21px; box-shadow: 0 14px 30px rgb(0 0 0 / 28%); }
.featured-book-card.is-status-open .book-status-chip { width: 79px; }
.status-menu { position: absolute; top: 39px; right: 7px; left: 7px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; width: auto; height: auto; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; opacity: 0; transform: translateY(-5px); animation: status-menu-in .18s .08s forwards; }
.status-menu-choice { display: flex; width: 100%; height: 26px; min-height: 0; align-items: center; justify-content: center; gap: 4px; padding: 0 5px; border: 0; border-radius: 13px; background: #2b2b2b; color: #ffeed7; font-family: inherit; font-size: 8.8px; font-weight: 300; line-height: 1; white-space: nowrap; }
.status-menu-choice--dropped { justify-self: stretch; }
.status-menu-choice img { width: 10px; height: 10px; }
@keyframes status-menu-in { to { opacity: 1; transform: translateY(0); } }
.library-list { gap: 10px; margin-top: 10px; }
.library-card { grid-template-columns: 47.44px minmax(0, 1fr) 78px; gap: 11px; width: 324px; height: 84px; padding: 10px 12px; border: 0; border-radius: 14.54px; background: #2b2b2b; }
.library-card .book-cover, .library-card .cover-fallback { width: 47.44px; height: 63.42px; border-radius: 3.61px; }
.library-card-copy h2 { font-family: "Geologica Pilcrow", var(--display); font-size: 13px; line-height: 17px; }
.library-card-copy p { font-family: inherit; font-size: 10px; line-height: 12px; }
.library-card-copy .library-card-progress { margin-top: 15px; }
.library-card > button { width: 78px; height: 24px; border-radius: 12px; background: #c8f542; color: #151515; font-family: inherit; font-size: 9px; font-weight: 300; }
.reader-footer { display: grid; gap: 11px; margin-top: auto; padding: 28px 24px 15px; justify-items: center; text-align: center; }
.add-book-button { width: 251px; height: 40px; border-radius: 20px; background: #ff6c4b; font-family: "Geologica Pilcrow", var(--display); font-size: 14px; font-weight: 300; }
.reader-footer p { color: rgb(217 217 217 / 36%); font-family: inherit; font-size: 11px; line-height: 13px; }
.reader-main-nav { display: flex; height: 86px; flex: 0 0 86px; align-items: flex-start; justify-content: center; gap: 10px; padding: 15px 12px 0; border-radius: 24px 24px 0 0; background: #2b2b2b; }
.reader-main-nav button { display: flex; width: 58.77px; flex-direction: column; align-items: center; gap: 5px; padding: 0; border: 0; background: transparent; color: #ffeed7; font-family: inherit; font-size: 10.7px; font-weight: 300; }
.reader-main-nav button.is-active { color: #7a5dff; }
.reader-main-library-icon { position: relative; display: block; width: 21px; height: 21px; }
.reader-main-library-icon img { position: absolute; width: 100%; height: 100%; object-fit: contain; filter: grayscale(1) brightness(0) invert(1); opacity: .9; }
.reader-main-nav .is-active .reader-main-library-icon img { filter: invert(41%) sepia(93%) saturate(2284%) hue-rotate(232deg) brightness(103%) contrast(101%); opacity: 1; }
.reader-main-book-icon { width: 21px; height: 21px; filter: grayscale(1) brightness(0) invert(1); opacity: .9; }
.reader-main-nav .is-active .reader-main-book-icon { filter: invert(41%) sepia(93%) saturate(2284%) hue-rotate(232deg) brightness(103%) contrast(101%); opacity: 1; }

@media (max-width: 383px) {
  .reader-library { padding-right: 22px; padding-left: 25px; }
  #current-book, .library-list { max-width: calc(100vw - 50px); }
  .featured-book-card { grid-template-columns: 84px minmax(0, 1fr); column-gap: 12px; padding-right: 13px; padding-left: 13px; }
  .featured-book-card > .book-cover, .featured-book-card > .cover-fallback { width: 84px; height: 127.73px; }
}

/* v32 final overrides — kept after the Alpha Prototype layers above. */
.pilcrow-app { opacity: 1; transform: translateY(0); transition: opacity .24s ease, transform .24s cubic-bezier(.2,.7,.2,1); }
html.app-enter .pilcrow-app { opacity: 0; transform: translateY(8px); }
html.app-leave .pilcrow-app { opacity: 0; transform: translateY(-7px); }

.space-logo-button { top: 62.75px; }
.space-world-switch { top: 49.75px; right: 24px; width: 138px; height: 37.13px; padding: 3.27px; border-radius: 13.47px; }
.space-world-switch > * { border-radius: 11.1px; font-size: 10.9px; }
.space-reading-card { overflow: visible; }
.space-reading-card-open { position: absolute; z-index: 0; inset: 0; padding: 0; border: 0; border-radius: inherit; background: transparent; }
.space-reading-card .space-cover, .space-reading-copy { z-index: 1; }
.space-reading-copy { pointer-events: none; }
.space-reading-status { top: 92.73px; bottom: auto; z-index: 3; margin: 0 !important; overflow: visible; color: inherit !important; pointer-events: auto; }
.space-reading-status > i { pointer-events: none; }
.space-reading-status > button { display: grid; width: 98px; height: 28px; padding: 0 7px; border: 0; border-radius: 13.29px; place-items: center; background: var(--space-peach); color: var(--space-black); font-family: inherit; font-size: 9.6px; font-weight: 300; white-space: nowrap; }
.space-status-menu { position: absolute; top: 39px; right: 0; display: grid; width: 197px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; padding: 7px; border-radius: 14px; background: var(--space-black); box-shadow: 0 14px 30px rgb(0 0 0 / 28%); animation: status-menu-in .18s .04s both; }
.space-status-menu button { width: 100%; height: 26px; padding: 0 5px; border: 0; border-radius: 13px; background: var(--space-panel); color: var(--space-cream); font-family: inherit; font-size: 8.8px; font-weight: 300; line-height: 1; white-space: nowrap; }
.space-reading-card.is-status-open { z-index: 7; }

.library-screen { display: flex; min-height: max(100dvh, 844px); flex-direction: column; }
.reader-main-header { flex: 0 0 102px; height: 102px; }
.reader-world-switch { top: 49.75px; right: 24px; width: 138px; height: 37.13px; padding: 3.27px; border-radius: 13.47px; }
.reader-world-switch > * { font-size: 10.9px; }
.library-filters { overflow-y: hidden; overscroll-behavior-x: contain; touch-action: pan-x; }
.reader-footer { margin-top: auto; }
.reader-main-nav { margin-top: 0; }

.featured-book-card { position: relative; }
.book-status-panel { top: 92.73px; bottom: auto; overflow: visible; }
.book-percent { top: 62px; bottom: auto; left: 0; }
.featured-book-card.is-status-open { margin-bottom: 78px; }
.featured-book-card.is-status-open .book-status-chip { width: 98px; }

.reading-header { transition: height .42s cubic-bezier(.2,.7,.2,1), min-height .42s cubic-bezier(.2,.7,.2,1), flex-basis .42s cubic-bezier(.2,.7,.2,1), opacity .28s ease, transform .42s cubic-bezier(.2,.7,.2,1); will-change: height, opacity, transform; }
.reader-homebar { transition: height .42s cubic-bezier(.2,.7,.2,1), flex-basis .42s cubic-bezier(.2,.7,.2,1), opacity .28s ease, transform .42s cubic-bezier(.2,.7,.2,1); will-change: height, opacity, transform; }
.reader-controls-hidden .reading-header { transform: translateY(-18px); }
.reader-controls-hidden .reader-homebar { transform: translateY(18px); }
.reading-header::after { bottom: -2px; height: 4px; background: #151515; }
