:root {
  color-scheme: light;
  --ink: #241a15;
  --muted: #6d5b4e;
  --paper: #f7f0e4;
  --panel: #fffaf2;
  --line: #dfd1bf;
  --shelf-bg: var(--paper);
  --wall-cover-width: 100%;
  --wall-cover-ratio: 2 / 3;
  --wall-cover-gap: 4px;
  --red: #8c2f28;
  --red-dark: #5c201d;
  --teal: #1f6f68;
  --gold: #bd8f45;
  --shadow: 0 18px 40px rgba(45, 29, 18, 0.16);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  overflow-x: clip;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.82), rgba(247, 240, 228, 0.96)),
    radial-gradient(circle at top right, rgba(31, 111, 104, 0.16), transparent 34%),
    var(--paper);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hero {
  position: relative;
  min-height: min(760px, 92vh);
  display: grid;
  grid-template-rows: auto 1fr;
  background-image: url("assets/reading-room-hero.png");
  background-position: center;
  background-size: cover;
  color: #fff8ed;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 17vh;
  background: linear-gradient(0deg, var(--paper), transparent);
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(24, 15, 12, 0.9), rgba(24, 15, 12, 0.58) 42%, rgba(24, 15, 12, 0.2)),
    linear-gradient(0deg, rgba(24, 15, 12, 0.72), rgba(24, 15, 12, 0.12) 44%);
}

.topbar,
.hero__content {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  font-weight: 760;
}

.brand__logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex: 0 0 auto;
}

.topbar .brand__logo {
  filter: grayscale(1) brightness(0) invert(1);
}

.brand__logo--full {
  width: 72px;
  height: 72px;
}

.topbar__menu {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
}

.menu-toggle {
  display: none;
}

.topbar__links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar__links a {
  color: rgba(255, 248, 237, 0.78);
  font-weight: 760;
  text-decoration: none;
}

.topbar__links a[aria-current="page"] {
  color: #fff8ed;
  text-decoration: underline;
  text-underline-offset: 6px;
}

.topbar__stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  color: rgba(255, 248, 237, 0.86);
}

.topbar__stats span {
  padding: 8px 12px;
  border: 1px solid rgba(255, 248, 237, 0.28);
  background: rgba(24, 15, 12, 0.28);
  border-radius: 999px;
}

.hero__content {
  align-self: center;
  padding: 76px 0 150px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 820px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 7vw, 6.9rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.hero__copy {
  max-width: 630px;
  margin: 26px 0 0;
  color: rgba(255, 248, 237, 0.86);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.55;
}

main {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 40px));
  margin: -64px auto 80px;
}

.collection-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(220px, 0.8fr);
  gap: 28px;
  margin: 0 0 18px;
  padding: 28px;
  background: rgba(255, 250, 242, 0.96);
  border: 1px solid rgba(223, 209, 191, 0.92);
  box-shadow: var(--shadow);
}

.collection-intro h2 {
  margin: 0 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.collection-intro p:not(.eyebrow) {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.collection-intro__links {
  display: grid;
  align-content: center;
  gap: 10px;
}

.collection-intro__links a {
  color: var(--red-dark);
  font-weight: 780;
  text-underline-offset: 4px;
}

.controls {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) repeat(4, minmax(132px, 1fr)) auto;
  gap: 12px;
  padding: 16px;
  background: rgba(255, 250, 242, 0.95);
  border: 1px solid rgba(223, 209, 191, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.newsletter-popup {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 70;
  width: min(440px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid rgba(169, 147, 123, 0.62);
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(36, 26, 21, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
}

.newsletter-popup[data-open="true"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.newsletter-popup__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(92, 32, 29, 0.22);
  border-radius: 50%;
  background: rgba(255, 250, 242, 0.94);
  color: var(--red-dark);
  font-size: 1.5rem;
  line-height: 1;
}

.newsletter-popup__close:hover,
.newsletter-popup__close:focus-visible {
  border-color: var(--red-dark);
  outline: 2px solid rgba(31, 111, 104, 0.45);
  outline-offset: 2px;
}

.newsletter-popup__content {
  padding: 32px;
}

.newsletter-popup__content h2 {
  margin: 0 42px 10px 0;
  font-size: clamp(1.7rem, 5vw, 2.25rem);
}

.newsletter-popup__content > p:not(.eyebrow) {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.55;
}

@media (prefers-reduced-motion: reduce) {
  .newsletter-popup {
    transition: none;
  }
}

.more-filters {
  grid-column: 1 / -1;
  color: var(--muted);
}

.more-filters summary {
  width: fit-content;
  cursor: pointer;
  font-weight: 760;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.more-filters__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.cover-admin-filter {
  display: none;
}

.search,
.field,
.note-field {
  display: grid;
  gap: 7px;
}

label,
.label,
.note-field span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  outline: none;
}

input,
select {
  min-height: 46px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  min-height: 92px;
  padding: 11px 12px;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(31, 111, 104, 0.14);
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 12px;
  margin: 18px 0 24px;
}

.dashboard article {
  min-height: 92px;
  padding: 17px 15px;
  border-top: 3px solid var(--red);
  background: rgba(255, 250, 242, 0.76);
  box-shadow: 0 9px 24px rgba(45, 29, 18, 0.08);
}

.stat {
  display: block;
  color: var(--red-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
}

.auth-panel,
.achievements-panel {
  margin: 0 0 28px;
  padding: 18px 0;
  border-top: 1px solid rgba(223, 209, 191, 0.82);
  border-bottom: 1px solid rgba(223, 209, 191, 0.54);
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.auth-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

#savedState {
  margin-top: 5px;
  color: var(--teal);
  font-size: 0.9rem;
  font-weight: 720;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.auth-actions input {
  width: min(280px, 62vw);
}

.auth-actions button,
.favorite-toggle {
  min-height: 36px;
  border: 1px solid rgba(109, 91, 78, 0.26);
  background: transparent;
  color: var(--ink);
  font-weight: 760;
}

.auth-actions button {
  padding: 0 13px;
  border-radius: 999px;
}

.achievements-panel {
  margin-bottom: 44px;
}

.achievements {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.achievement {
  width: min(100%, 220px);
  min-height: 80px;
  padding: 13px 14px;
  border: 1px solid rgba(223, 209, 191, 0.76);
  color: rgba(109, 91, 78, 0.58);
  background: rgba(255, 250, 242, 0.52);
}

.achievement strong,
.achievement span {
  display: block;
}

.achievement strong {
  margin-bottom: 5px;
  color: inherit;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
}

.achievement span {
  font-size: 0.82rem;
  line-height: 1.35;
}

.achievement--unlocked {
  border-color: rgba(140, 47, 40, 0.35);
  color: var(--red-dark);
  background: rgba(255, 250, 242, 0.9);
}

.library-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.8rem);
  letter-spacing: 0;
}

.clear-filters,
.status-chip {
  border: 1px solid rgba(109, 91, 78, 0.26);
  background: transparent;
  color: var(--ink);
  font-weight: 760;
}

.clear-filters {
  align-self: end;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--red-dark);
  background: rgba(255, 250, 242, 0.7);
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
  margin: 12px 0 18px;
}

.active-filters button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(223, 209, 191, 0.9);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.64);
  color: var(--muted);
  font-size: 0.78rem;
}

.shelf-rail {
  position: fixed;
  z-index: 40;
  top: clamp(72px, 10vh, 118px);
  bottom: 28px;
  left: 0;
  width: min(306px, calc(100vw - 22px));
  pointer-events: none;
  transform: translateX(calc(-100% + 14px));
  transition: transform 260ms cubic-bezier(.22, 1, .36, 1);
}

.shelf-rail[data-open="true"],
.shelf-rail[data-pinned="true"] {
  pointer-events: auto;
  transform: translateX(0);
}

.shelf-rail__affordance {
  position: absolute;
  top: 42%;
  right: -18px;
  display: grid;
  place-items: center;
  gap: 5px;
  width: 36px;
  min-height: 118px;
  border: 1px solid rgba(140, 47, 40, 0.18);
  border-left: 0;
  border-radius: 0 14px 14px 0;
  background: rgba(247, 240, 228, 0.8);
  color: var(--red-dark);
  box-shadow: 8px 12px 26px rgba(36, 26, 21, 0.08);
  pointer-events: auto;
}

.shelf-rail__affordance-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.68rem;
  font-weight: 820;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.shelf-rail__count {
  display: grid;
  place-items: center;
  min-width: 18px;
  min-height: 18px;
  border-radius: 999px;
  background: var(--teal);
  color: #fffaf2;
  font-size: 0.66rem;
  font-weight: 820;
}

.shelf-rail__panel {
  height: 100%;
  padding: 18px;
  overflow: auto;
  border-right: 1px solid rgba(223, 209, 191, 0.78);
  background: rgba(255, 250, 242, 0.82);
  backdrop-filter: blur(18px);
  box-shadow: 18px 0 38px rgba(36, 26, 21, 0.12);
  opacity: 0;
  transition: opacity 230ms ease;
}

.shelf-rail[data-open="true"] .shelf-rail__panel,
.shelf-rail[data-pinned="true"] .shelf-rail__panel {
  opacity: 1;
}

.shelf-rail__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(223, 209, 191, 0.72);
}

.shelf-rail__head h2 {
  margin: 2px 0 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  line-height: 1;
}

.shelf-rail__status,
.shelf-rail__empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.shelf-rail__actions {
  display: flex;
  gap: 6px;
}

.shelf-rail__actions button,
.shelf-rail__tabs button {
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid rgba(223, 209, 191, 0.9);
  border-radius: 999px;
  background: rgba(247, 240, 228, 0.55);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 780;
}

.shelf-rail__actions button[aria-pressed="true"],
.shelf-rail__tabs button[aria-selected="true"] {
  border-color: rgba(31, 111, 104, 0.36);
  color: var(--teal);
  background: rgba(31, 111, 104, 0.08);
}

.shelf-rail__tabs {
  display: flex;
  gap: 8px;
  margin: 16px 0 14px;
}

.shelf-rail__sections {
  display: grid;
  gap: 4px;
}

.shelf-rail-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 38px;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid rgba(223, 209, 191, 0.5);
  background: transparent;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  text-align: left;
}

.shelf-rail-section strong {
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.72rem;
}

.shelf-rail-section[data-current="true"] {
  color: var(--red-dark);
}

.shelf-rail-section[data-current="true"]::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.shelf-rail__filters,
.shelf-rail__filters details {
  display: grid;
  gap: 11px;
}

.shelf-rail__filters label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 780;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.shelf-rail__filters input,
.shelf-rail__filters select {
  min-height: 36px;
  width: 100%;
  border: 1px solid rgba(223, 209, 191, 0.92);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.74);
  color: var(--ink);
  font-size: 0.86rem;
  letter-spacing: 0;
  text-transform: none;
}

.shelf-rail__filters summary {
  width: fit-content;
  color: var(--teal);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 780;
}

.library-subtitle {
  max-width: 560px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.shelf-wall {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-top: 44px;
  overflow: clip;
  background: transparent;
}

.book-grid {
  display: flex;
  flex-direction: column;
  row-gap: clamp(34px, 4vw, 64px);
}

.shelf-wall__track {
  width: 100%;
  margin-left: 0;
  padding-block: 14px 28px;
  background: transparent;
}

.shelf-row {
  position: relative;
  display: block;
  align-items: start;
  width: 100%;
  background: transparent;
}

.shelf-row__center {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: start;
  width: 100%;
  column-gap: var(--wall-cover-gap);
}

.book-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  transition: opacity 620ms cubic-bezier(.22, 1, .36, 1), transform 620ms cubic-bezier(.22, 1, .36, 1);
}

.book-card.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.book-card:hover,
.book-card:focus-within {
  z-index: 6;
}

.book-cover-link {
  position: relative;
  display: block;
  z-index: 1;
  width: var(--wall-cover-width);
  max-width: 100%;
  margin: 0 auto;
  color: inherit;
  text-decoration: none;
  outline: none;
}

.book-cover-link::before {
  content: "";
  position: absolute;
  inset: 10% -12% -8%;
  background: radial-gradient(circle, rgba(189, 143, 69, 0.18), transparent 58%);
  opacity: 0;
  transition: opacity 220ms ease;
}

.cover-stage,
.book-cover {
  position: relative;
  display: block;
  overflow: visible;
  width: 100%;
  aspect-ratio: var(--wall-cover-ratio);
  background: transparent;
}

.book-cover {
  min-height: 0;
  transform-origin: 50% 90%;
  overflow: hidden;
  background: transparent;
  box-shadow:
    0 24px 34px rgba(36, 26, 21, 0.13),
    0 7px 14px rgba(36, 26, 21, 0.09);
  isolation: isolate;
  transition: box-shadow 230ms ease, transform 230ms ease;
}

.book-cover::before {
  content: "";
  position: absolute;
  inset: -10%;
  z-index: 0;
  background-image: var(--cover-image);
  background-position: center;
  background-size: cover;
  filter: blur(22px) saturate(0.8);
  opacity: 0;
  transform: scale(1.08);
}

.book-cover img {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 12px rgba(36, 26, 21, 0.11));
}

.book-cover--loaded::before {
  opacity: 0.22;
}

.book-cover--loaded img,
.drawer-cover .book-cover img,
.map-panel__hero .book-cover img {
  background: transparent;
}

.book-card .book-cover--loaded img {
  mix-blend-mode: multiply;
}

.book-cover-link:hover .book-cover,
.book-cover-link:focus-visible .book-cover {
  transform: translateY(-6px) rotate(-0.35deg);
  z-index: 4;
  box-shadow:
    0 31px 44px rgba(36, 26, 21, 0.18),
    0 9px 18px rgba(36, 26, 21, 0.11);
}

.book-cover-link:hover .book-cover img,
.book-cover-link:focus-visible .book-cover img,
.book-cover-link:hover .placeholder-title,
.book-cover-link:focus-visible .placeholder-title {
  filter: drop-shadow(0 13px 16px rgba(36, 26, 21, 0.13));
}

.book-cover-link:hover::before,
.book-cover-link:focus-visible::before {
  opacity: 1;
}

.book-cover-link:focus-visible {
  border-radius: 4px;
  box-shadow: 0 0 0 3px rgba(31, 111, 104, 0.28);
}

.book-overlay {
  position: absolute;
  inset: auto 0 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: clamp(78px, 12vw, 110px) 22px 20px;
  color: #fffaf2;
  background:
    linear-gradient(
      to top,
      rgba(20, 14, 11, 0.93),
      rgba(20, 14, 11, 0.64) 58%,
      rgba(20, 14, 11, 0)
    );
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.46);
  transform: translateY(12px);
  transition: opacity 230ms ease, transform 230ms ease;
}

.book-cover-link:hover .book-overlay,
.book-cover-link:focus-visible .book-overlay {
  opacity: 1;
  transform: translateY(0);
}

.book-overlay__meta,
.book-overlay__author,
.book-overlay__action,
.book-overlay__controls {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.book-overlay__author {
  color: rgba(255, 250, 242, 0.78);
  letter-spacing: 0;
  text-transform: none;
}

.book-overlay__title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 1.6vw, 1.9rem);
  font-weight: 700;
  line-height: 1.02;
}

.book-overlay__summary {
  display: -webkit-box;
  overflow: hidden;
  max-width: 28ch;
  margin-top: 5px;
  color: rgba(255, 250, 242, 0.9);
  font-size: 0.86rem;
  line-height: 1.38;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.book-overlay__action {
  width: fit-content;
  margin-top: 8px;
  color: #d7f0ed;
  letter-spacing: 0;
  text-transform: none;
}

.book-overlay__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  color: rgba(255, 250, 242, 0.86);
  letter-spacing: 0;
  text-transform: none;
}

.placeholder-title {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  color: var(--red-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 2.2vw, 2.25rem);
  line-height: 1.1;
  text-align: center;
  padding: 30px;
  min-height: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.44), rgba(126, 111, 88, 0.06)),
    var(--paper);
  box-shadow: none;
}

.book-cover--loaded {
  background: transparent;
}

.book-cover--loaded .placeholder-title {
  display: none;
}

.book-cover--reduced {
  min-height: 0;
  padding: 0;
  background: transparent;
}

.book-cover--reduced img,
.book-cover--manuscript img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.book-cover--manuscript img {
  mix-blend-mode: multiply;
}

.book-cover--generated {
  min-height: 0;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.54), rgba(140, 47, 40, 0.08)),
    var(--paper);
}

.book-cover--generated .placeholder-title {
  position: absolute;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: clamp(20px, 2.4vw, 34px);
  color: var(--red-dark);
  font-size: clamp(1.45rem, 2vw, 2.2rem);
}

.book-cover--generated .placeholder-title[data-variant="1"] {
  background:
    linear-gradient(160deg, rgba(31, 111, 104, 0.1), transparent 44%),
    linear-gradient(180deg, rgba(255, 250, 242, 0.5), rgba(126, 111, 88, 0.08)),
    var(--paper);
}

.book-cover--generated .placeholder-title[data-variant="2"] {
  color: #1f4f4b;
  background:
    linear-gradient(90deg, rgba(189, 143, 69, 0.14) 0 13%, transparent 13%),
    linear-gradient(180deg, rgba(255, 250, 242, 0.48), rgba(140, 47, 40, 0.06)),
    var(--paper);
}

.book-cover--generated .placeholder-title[data-variant="3"] {
  background:
    radial-gradient(circle at 50% 24%, rgba(189, 143, 69, 0.13), transparent 28%),
    linear-gradient(180deg, rgba(255, 250, 242, 0.5), rgba(126, 111, 88, 0.08)),
    var(--paper);
}

.book-cover--generated .placeholder-title[data-variant="4"] {
  color: #6f2f2b;
  background:
    linear-gradient(180deg, transparent 0 8%, rgba(140, 47, 40, 0.08) 8% 8.8%, transparent 8.8%),
    linear-gradient(180deg, rgba(255, 250, 242, 0.5), rgba(126, 111, 88, 0.08)),
    var(--paper);
}

.book-cover--generated .placeholder-title[data-variant="5"] {
  background:
    linear-gradient(90deg, transparent, rgba(31, 111, 104, 0.08), transparent),
    linear-gradient(180deg, rgba(255, 250, 242, 0.5), rgba(126, 111, 88, 0.08)),
    var(--paper);
}

.book-cover--generated .placeholder-title::before {
  content: "";
  position: absolute;
  inset: 12px auto 12px 12px;
  width: 4px;
  border-radius: 999px;
  background: rgba(140, 47, 40, 0.22);
}

.book-cover--generated .placeholder-title::after {
  content: attr(data-author);
  display: block;
  margin-top: 16px;
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 640;
  line-height: 1.35;
}

.book-card__meta,
.book-card__author,
.book-card__secondary {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.book-card__meta {
  display: none;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin-top: 4px;
  font-size: 0.78rem;
}

.book-title-row {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.book-title-row h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 1.15vw, 1.22rem);
  line-height: 1.12;
  letter-spacing: 0;
  color: #1c130f;
  cursor: pointer;
}

.book-card__author {
  margin-top: 0;
  font-size: 0.78rem;
}

.status-chip {
  width: fit-content;
  min-height: 0;
  margin-top: 3px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 720;
  text-align: left;
}

.status-chip::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: currentColor;
}

.favorite-toggle {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  min-height: 32px;
  width: 32px;
  overflow: hidden;
  border-radius: 50%;
  color: var(--ink);
  font-size: 0;
  background: rgba(255, 250, 242, 0.72);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.book-card:hover .favorite-toggle,
.book-card:focus-within .favorite-toggle,
.favorite-toggle[data-favorite="true"] {
  opacity: 1;
  transform: translateY(0);
}

.favorite-toggle::before {
  content: "\2606";
  font-size: 1rem;
  line-height: 1;
}

.favorite-toggle[data-favorite="true"] {
  border-color: rgba(140, 47, 40, 0.42);
  color: var(--red);
}

.favorite-toggle[data-favorite="true"]::before {
  content: "\2605";
}

.status-chip:focus-visible,
.favorite-toggle:focus-visible,
.auth-actions button:focus-visible,
.clear-filters:focus-visible,
.source-link:focus-visible,
.book-details summary:focus-visible,
.shelf-rail button:focus-visible,
.shelf-rail input:focus-visible,
.shelf-rail select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(31, 111, 104, 0.26);
  outline-offset: 3px;
}

.book-card__summary {
  margin: 0;
  color: #46382f;
  line-height: 1.58;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.progress-line {
  min-height: 4px;
  margin: 0;
  color: var(--teal);
  font-size: 0.88rem;
  font-weight: 720;
}

@media (hover: hover) and (pointer: fine) {
  .book-title-row,
  .book-card__author,
  .status-chip,
  .progress-line {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .status-chip {
    z-index: 5;
    bottom: 16px;
    left: 18px;
    width: auto;
    height: auto;
    clip: auto;
    clip-path: none;
    padding: 0;
    color: rgba(255, 250, 242, 0.86);
    opacity: 0;
    pointer-events: none;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
    transition: opacity 220ms ease;
  }

  .book-card:hover .status-chip,
  .book-card:focus-within .status-chip {
    opacity: 1;
    pointer-events: auto;
  }

  .book-grid:hover .book-card:not(:hover):not(:focus-within) {
    opacity: 0.86;
  }
}

@media (max-width: 1100px) {
  :root {
    --wall-cover-width: min(42vw, 320px);
    --wall-cover-gap: clamp(22px, 4vw, 40px);
  }

  .shelf-wall {
    width: auto;
    margin-left: 0;
    overflow: visible;
  }

  .shelf-wall__track {
    width: auto;
    margin-left: 0;
    padding-block: 10px 22px;
  }

  .book-grid {
    row-gap: 50px;
  }

  .shelf-row {
    display: block;
  }

  .shelf-row__center {
    grid-template-columns: repeat(2, var(--wall-cover-width));
    justify-content: center;
    gap: 50px var(--wall-cover-gap);
  }

  .book-title-row,
  .book-card__author,
  .status-chip,
  .progress-line {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    clip-path: none;
    white-space: normal;
  }

  .status-chip {
    opacity: 1;
    pointer-events: auto;
    color: var(--muted);
    text-shadow: none;
  }

  .book-cover-link {
    margin: 0 auto 12px;
  }

  .placeholder-title {
    min-height: 0;
  }
}

.progress-line span {
  display: block;
  height: 4px;
  margin-bottom: 5px;
  background: var(--teal);
}

.book-card__summary,
.book-card__secondary,
.source-link,
.book-details {
  display: none;
}

.note-field {
  margin-top: 14px;
}

.source-link {
  color: var(--teal);
  font-size: 0.92rem;
  font-weight: 760;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.book-details {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.book-details summary {
  width: fit-content;
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}

.reader-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 0;
}

.reader-detail-grid label {
  display: grid;
  gap: 7px;
}

.reader-detail-grid input {
  min-height: 40px;
}

.note-status {
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 720;
  text-transform: uppercase;
}

.book-details:not([open]) > :not(summary) {
  display: none;
}

.detail-list {
  display: grid;
  grid-template-columns: minmax(96px, auto) 1fr;
  gap: 8px 14px;
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(223, 209, 191, 0.78);
}

.detail-list dt {
  color: var(--red-dark);
  font-weight: 760;
}

.detail-list dd {
  margin: 0;
}

.loading {
  grid-column: 1 / -1;
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(255, 250, 242, 0.72);
}

.empty-state {
  padding: 44px 0 80px;
  color: var(--muted);
  font-size: 1.1rem;
  text-align: center;
}

.scroll-sentinel {
  height: 120px;
}

.book-drawer[aria-hidden="true"] {
  display: none;
}

.book-drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.book-drawer__scrim {
  position: absolute;
  inset: 0;
  background: rgba(36, 26, 21, 0.24);
}

.book-drawer__panel {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(720px, 100%);
  overflow: auto;
  padding: 28px;
  background: var(--panel);
  box-shadow: -24px 0 60px rgba(36, 26, 21, 0.18);
  outline: none;
}

.drawer-close {
  float: right;
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 5px;
}

.drawer-book {
  display: grid;
  grid-template-columns: minmax(160px, 240px) minmax(0, 1fr);
  gap: 28px;
  clear: both;
}

.drawer-cover .book-cover {
  width: 100%;
}

.drawer-cover .book-cover::before,
.map-panel__hero .book-cover::before {
  display: none;
}

.drawer-main h2 {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.96;
}

.drawer-author,
.drawer-summary {
  color: var(--muted);
  line-height: 1.6;
}

.drawer-summary {
  color: #46382f;
}

.drawer-links,
.drawer-neighborhood,
.drawer-nav {
  margin-top: 20px;
}

body[data-editorial="true"] main > :not(#editorialView) {
  display: none !important;
}

.editorial-view,
.guided-lists,
.newsletter,
.commerce-panel,
.site-footer {
  color: var(--ink);
}

.guided-lists {
  margin: 34px 0 58px;
  padding: 32px 0;
  border-top: 1px solid rgba(223, 209, 191, 0.84);
  border-bottom: 1px solid rgba(223, 209, 191, 0.84);
}

.guided-lists__head,
.page-intro,
.reading-list-page__head {
  max-width: 760px;
}

.guided-lists__head > p:last-child,
.page-intro > p:last-child,
.reading-list-page__head > p {
  color: var(--muted);
  line-height: 1.65;
}

.reading-list-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 26px 0 22px;
}

.reading-list-cards--all {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reading-list-card {
  min-height: 250px;
  padding: 24px;
  border: 1px solid rgba(169, 147, 123, 0.48);
  background: rgba(255, 250, 242, 0.76);
  box-shadow: 0 16px 34px rgba(36, 26, 21, 0.07);
}

.reading-list-card h3,
.reading-list-page h2,
.commerce-panel h3,
.commerce-panel h4,
.commerce-panel h5,
.newsletter h2,
.disclosure-page h2,
.disclosure-page h3 {
  font-family: Georgia, "Times New Roman", serif;
}

.reading-list-card h3 {
  margin: 0 0 12px;
  font-size: 1.7rem;
}

.reading-list-card > p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.55;
}

.reading-list-card__meta,
.reading-list-commitment {
  font-size: 0.84rem;
  font-weight: 760;
}

.reading-list-card a,
.text-link {
  color: var(--red-dark);
  font-weight: 800;
  text-underline-offset: 4px;
}

.reading-lists-page,
.reading-list-page,
.disclosure-page {
  padding: 36px 0 72px;
}

.page-intro h2,
.reading-list-page__head h2,
.disclosure-page h2 {
  margin: 0 0 18px;
  font-size: clamp(2.7rem, 6vw, 5.5rem);
  line-height: 0.98;
}

.reading-list-description {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
}

.start-list-button {
  min-height: 46px;
  margin-top: 10px;
  padding: 0 18px;
  border: 1px solid var(--red);
  border-radius: 999px;
  background: var(--red-dark);
  color: #fffaf2;
  font-weight: 800;
}

.reading-list-sequence {
  padding: 0;
  margin: 46px 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.reading-list-work {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 18px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.reading-list-work__number {
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 1.7rem;
}

.reading-list-work h3 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 1.45rem;
}

.reading-list-work h3 a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.reading-list-work__author {
  margin: 5px 0;
  color: var(--muted);
}

.reading-list-work__indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.reading-list-work__indicators span {
  padding: 5px 8px;
  border: 1px solid rgba(31, 111, 104, 0.26);
  border-radius: 999px;
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 760;
}

.commerce-panel {
  grid-column: 1 / -1;
  margin-top: 30px;
  padding: 28px;
  border: 1px solid rgba(169, 147, 123, 0.5);
  background: rgba(247, 240, 228, 0.62);
}

.commerce-panel__head h3 {
  margin: 0;
  font-size: 2rem;
}

.commerce-section {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid rgba(169, 147, 123, 0.42);
}

.commerce-section h4 {
  margin: 0 0 12px;
  font-size: 1.35rem;
}

.commerce-section h5 {
  margin: 4px 0 8px;
  font-size: 1.25rem;
}

.commerce-meta,
.edition-meta {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.copyright-disclaimer,
.affiliate-disclosure {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.public-domain-status[data-status="yes"] h4 {
  color: var(--teal);
}

.public-domain-status[data-status="no"] h4,
.public-domain-status[data-status="uncertain"] h4 {
  color: var(--red-dark);
}

.free-access-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.free-access-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(31, 111, 104, 0.28);
  background: rgba(255, 250, 242, 0.72);
  color: var(--ink);
  text-decoration: none;
}

.free-access-links a span {
  color: var(--teal);
  font-size: 0.8rem;
  font-weight: 800;
}

.edition-grid {
  display: grid;
  gap: 14px;
}

.edition-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  padding: 20px;
  background: rgba(255, 250, 242, 0.72);
}

.edition-card > img {
  width: 92px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.edition-label {
  margin: 0;
  color: var(--red-dark);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.edition-subtitle,
.edition-reason,
.edition-best-for,
.collection-recommendation > p {
  line-height: 1.55;
}

.retailer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

.retailer-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(140, 47, 40, 0.34);
  border-radius: 999px;
  color: var(--red-dark);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.retailer-link--primary {
  background: var(--red-dark);
  color: #fffaf2;
}

.newsletter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 48px;
  margin: 58px 0;
  padding: 34px;
  border-top: 3px solid var(--teal);
  background: rgba(255, 250, 242, 0.78);
  box-shadow: 0 18px 40px rgba(36, 26, 21, 0.08);
}

.newsletter--inline {
  width: min(1180px, calc(100vw - 48px));
  margin: 8px auto;
}

.newsletter h2 {
  margin: 0 0 12px;
  font-size: 2rem;
}

.newsletter > div > p:last-child {
  color: var(--muted);
  line-height: 1.55;
}

.newsletter-form {
  display: grid;
  gap: 12px;
}

.newsletter-form label {
  display: grid;
  gap: 6px;
}

.newsletter-form button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--teal);
  color: white;
  font-weight: 800;
}

.newsletter-form button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.newsletter-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.newsletter-honeypot {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
}

.disclosure-page {
  max-width: 760px;
}

.disclosure-page h3 {
  margin-top: 32px;
  font-size: 1.5rem;
}

.disclosure-page p {
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.7;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 36px;
  padding: 42px max(24px, calc((100vw - 1180px) / 2));
  border-top: 1px solid var(--line);
  background: #efe4d4;
}

.site-footer p {
  max-width: 480px;
  color: var(--muted);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: 18px;
}

.site-footer a {
  color: var(--red-dark);
}

.brand--footer {
  color: var(--ink) !important;
}

@media (max-width: 760px) {
  .newsletter-popup {
    right: 14px;
    bottom: 14px;
    width: calc(100vw - 28px);
    max-height: calc(100vh - 28px);
  }

  .newsletter-popup__content {
    padding: 26px 22px 22px;
  }

  .newsletter--inline {
    width: calc(100vw - 28px);
  }

  .collection-intro {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .reading-list-cards,
  .reading-list-cards--all,
  .newsletter {
    grid-template-columns: 1fr;
  }

  .free-access-links {
    grid-template-columns: 1fr;
  }

  .commerce-panel,
  .newsletter {
    padding: 22px;
  }

  .edition-card {
    grid-template-columns: 1fr;
  }

  .reading-list-work {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
  }

  .site-footer {
    flex-direction: column;
  }
}

.drawer-neighborhood {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.drawer-neighborhood .eyebrow {
  flex-basis: 100%;
}

.drawer-neighborhood button,
.drawer-nav button,
.drawer-favorite button {
  min-height: 34px;
  border: 1px solid rgba(109, 91, 78, 0.24);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
}

.drawer-nav {
  display: flex;
  gap: 10px;
}

.map-view {
  margin-top: 40px;
}

.map-toolbar {
  margin-bottom: 22px;
}

.map-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1.25fr) repeat(3, minmax(120px, 0.75fr));
  gap: 10px;
  align-items: end;
}

.map-controls label {
  min-width: 0;
}

.map-controls span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map-controls input,
.map-controls select {
  width: 100%;
  min-height: 42px;
  margin-top: 5px;
  border: 1px solid rgba(169, 147, 123, 0.48);
  border-radius: 6px;
  background: rgba(255, 250, 242, 0.76);
  color: var(--ink);
}

.map-search {
  grid-column: span 2;
}

.map-reset {
  min-height: 42px;
  align-self: end;
  border-color: rgba(169, 147, 123, 0.48);
  background: transparent;
  color: var(--muted);
}

.map-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
  align-items: stretch;
}

.canon-map {
  position: relative;
  min-height: 700px;
  border: 1px solid rgba(32, 45, 62, 0.9);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 44%, rgba(42, 61, 84, 0.7), transparent 60%),
    linear-gradient(145deg, #111b29, #080d15 74%);
  box-shadow: 0 24px 70px rgba(21, 16, 13, 0.2);
  overflow: hidden;
}

.map-status {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(223, 209, 191, 0.62);
  background: rgba(8, 13, 21, 0.84);
  color: #edf3fb;
  font-size: 0.84rem;
  font-weight: 800;
}

.map-status span {
  color: #9fb0c4;
  font-weight: 700;
}

.map-gateways {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 58px;
  padding: 12px 150px 12px 14px;
  border-bottom: 1px solid rgba(173, 194, 219, 0.14);
  background: rgba(8, 13, 21, 0.56);
}

.map-gateways p {
  margin: 0 8px 0 0;
  color: #b7c4d3;
  font-size: 0.86rem;
}

.map-gateways button,
.map-panel__gateways button {
  min-height: 32px;
  padding: 0 10px;
  border-color: rgba(169, 147, 123, 0.48);
  background: rgba(255, 250, 242, 0.68);
  color: var(--ink);
}

.canon-map .map-gateways button {
  border-color: rgba(173, 194, 219, 0.32);
  background: rgba(19, 30, 44, 0.84);
  color: #edf3fb;
}

.map-zoom-controls {
  position: absolute;
  top: 66px;
  right: 14px;
  z-index: 4;
  display: flex;
  overflow: hidden;
  border: 1px solid rgba(173, 194, 219, 0.28);
  border-radius: 8px;
  background: rgba(8, 13, 21, 0.78);
}

.map-zoom-controls button {
  min-width: 38px;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-right: 1px solid rgba(173, 194, 219, 0.2);
  border-radius: 0;
  background: transparent;
  color: #edf3fb;
}

.map-zoom-controls button:last-child {
  border-right: 0;
}

.map-canvas {
  display: block;
  width: 100%;
  min-width: 0;
  cursor: grab;
  touch-action: none;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 0 14px 14px;
  position: absolute;
  right: 14px;
  bottom: 12px;
  left: 14px;
  color: #b7c4d3;
  pointer-events: none;
  font-size: 0.78rem;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.map-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.map-panel {
  min-height: 700px;
  padding: 22px 0 22px 22px;
  border-left: 1px solid rgba(223, 209, 191, 0.78);
}

.map-panel h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
  line-height: 1.05;
}

.map-panel h4 {
  margin: 22px 0 10px;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map-panel p {
  color: var(--muted);
  line-height: 1.55;
}

.map-panel__hero {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 14px;
  align-items: end;
  margin: 12px 0 16px;
}

.map-panel__hero .book-cover {
  width: 78px;
  min-height: 0;
}

.map-panel__hero .book-cover img,
.map-panel__hero .placeholder-title {
  box-shadow:
    0 10px 18px rgba(36, 26, 21, 0.14),
    0 2px 6px rgba(36, 26, 21, 0.1);
}

.map-panel__hero .placeholder-title {
  min-height: 112px;
  width: 78px;
  padding: 10px;
  font-size: 0.82rem;
}

.map-panel__status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.map-panel__status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.map-neighbors {
  display: grid;
  gap: 8px;
}

.map-neighbors button {
  justify-content: flex-start;
  min-height: 0;
  padding: 10px 0;
  border: 0;
  border-top: 1px solid rgba(223, 209, 191, 0.64);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.map-neighbors strong,
.map-neighbors span {
  display: block;
}

.map-neighbors span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.35;
}

.map-open-book {
  margin-top: 18px;
}

.map-panel__gateways,
.map-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.map-panel__actions .source-link {
  display: inline-flex;
  margin-top: 0;
}

.shelf-sections {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: -12px 0 34px;
}

.shelf-section {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(223, 209, 191, 0.76);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  text-decoration: none;
}

.shelf-section span {
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.85rem;
}

@media (max-width: 980px) {
  .controls,
  .dashboard,
  .shelf-sections,
  .more-filters__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shelf-row__center {
    grid-template-columns: repeat(2, var(--wall-cover-width));
    gap: 56px var(--wall-cover-gap);
  }

  .cover-stage {
    min-height: 0;
  }

  .placeholder-title {
    min-height: 0;
  }

  .favorite-toggle {
    right: 14px;
  }

  .search {
    grid-column: 1 / -1;
  }

  .map-toolbar,
  .map-shell {
    grid-template-columns: 1fr;
  }

  .map-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-panel {
    min-height: 0;
    padding: 22px 0 0;
    border-left: 0;
    border-top: 1px solid rgba(223, 209, 191, 0.78);
  }
}

@media (max-width: 660px) {
  :root {
    --wall-cover-width: 100%;
    --wall-cover-gap: 10px;
  }

  .hero {
    min-height: min(680px, 88svh);
    background-position: 58% center;
  }

  .topbar {
    min-height: 72px;
    align-items: center;
    padding: 10px 0;
  }

  .auth-panel {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 18px;
  }

  .brand {
    min-width: 0;
    font-size: 0.92rem;
  }

  .brand__logo {
    width: 44px;
    height: 44px;
  }

  .menu-toggle {
    position: relative;
    z-index: 3;
    display: grid;
    place-content: center;
    gap: 5px;
    width: 46px;
    height: 46px;
    margin-left: auto;
    padding: 0;
    border: 1px solid rgba(255, 248, 237, 0.4);
    border-radius: 50%;
    background: rgba(24, 15, 12, 0.42);
    color: #fff8ed;
  }

  .menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .menu-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(7px) rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-7px) rotate(-45deg);
  }

  .topbar__menu {
    position: absolute;
    z-index: 2;
    top: 66px;
    right: -6px;
    left: -6px;
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 18px;
    border: 1px solid rgba(255, 248, 237, 0.18);
    border-radius: 16px;
    background: rgba(24, 15, 12, 0.97);
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
  }

  .topbar__menu[data-open="true"] {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .topbar__links {
    display: grid;
    gap: 2px;
  }

  .topbar__links a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 10px;
  }

  .topbar__stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .topbar__stats span {
    text-align: center;
  }

  .hero__content {
    padding: 44px 0 110px;
  }

  h1 {
    font-size: clamp(2.65rem, 14vw, 4.5rem);
  }

  .hero__copy {
    margin-top: 20px;
    font-size: 1rem;
  }

  main,
  .topbar,
  .hero__content {
    width: min(100% - 28px, 1180px);
  }

  .dashboard,
  .shelf-sections,
  .more-filters__grid {
    grid-template-columns: 1fr;
  }

  .controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clear-filters,
  .more-filters {
    grid-column: 1 / -1;
  }

  .shelf-row__center {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 34px var(--wall-cover-gap);
  }

  .library-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .book-card {
    min-height: auto;
  }

  .cover-stage {
    min-height: 0;
  }

  .placeholder-title {
    min-height: 0;
  }

  .favorite-toggle {
    right: 12px;
  }

  .reader-detail-grid {
    grid-template-columns: 1fr;
  }

  .drawer-book {
    grid-template-columns: 1fr;
  }

  .map-controls {
    grid-template-columns: 1fr;
  }

  .map-search {
    grid-column: auto;
  }

  .canon-map {
    min-height: 540px;
  }

  .shelf-rail {
    top: auto;
    right: 10px;
    bottom: 12px;
    left: 10px;
    width: auto;
    max-height: min(78vh, 620px);
    transform: translateY(calc(100% - 50px));
  }

  .shelf-rail[data-open="true"],
  .shelf-rail[data-pinned="true"] {
    transform: translateY(0);
  }

  .shelf-rail__affordance {
    top: -48px;
    right: auto;
    left: 0;
    width: auto;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(140, 47, 40, 0.2);
    border-radius: 999px;
  }

  .shelf-rail__affordance-label {
    writing-mode: horizontal-tb;
    transform: none;
  }

  .shelf-rail__panel {
    max-height: min(72vh, 580px);
    border: 1px solid rgba(223, 209, 191, 0.78);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -18px 38px rgba(36, 26, 21, 0.13);
  }
}

@media (prefers-reduced-motion: reduce) {
  .book-cover,
  .book-overlay,
  .book-card,
  .shelf-rail,
  .shelf-rail__panel {
    transition: none;
  }

  .menu-toggle span,
  .topbar__menu {
    transition: none;
  }

  .book-cover-link:hover .book-cover,
  .book-cover-link:focus-visible .book-cover {
    transform: none;
  }
}
