html:has(body.page-library-explorer),
.page-library-explorer {
  overflow-x: clip;
}

.page-library-explorer {
  --library-ink: var(--color-text-primary);
  --library-muted: var(--color-text-secondary);
  --library-rule: color-mix(in srgb, var(--color-accent-umber) 24%, transparent);
  --library-paper: #f6f0df;
  --library-paper-deep: #e9dec4;
  --library-accent: var(--color-accent-umber);
  --library-bronze: var(--color-accent-bronze);
  background: var(--color-bg-page);
}

.page-library-explorer .library-explorer {
  position: relative;
  isolation: isolate;
  max-width: none;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.page-library-explorer .site-footer {
  position: relative;
  z-index: 1;
}

#passage-results {
  scroll-margin-top: 6rem;
}

.page-library-explorer .library-explorer > :not(.immersive-rails, .immersive-panorama, .filter-backdrop, .filter-drawer) {
  position: relative;
  z-index: 2;
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.page-library-explorer .immersive-panorama {
  position: relative;
  z-index: 1;
  overflow: clip;
}

@media (min-width: 1180px) {
  .page-library-explorer {
    --immersive-center-width: 1040px;
    --immersive-rail-opacity: 1;
  }

  .page-library-explorer .library-explorer > :not(.immersive-rails, .immersive-panorama, .filter-backdrop, .filter-drawer) {
    width: min(1040px, calc(100% - 2rem));
  }

  .page-library-explorer .immersive-rails__edge::before {
    filter: saturate(0.98) contrast(1.1);
  }

  .page-library-explorer .immersive-rails__edge::after {
    background:
      linear-gradient(to bottom, color-mix(in srgb, var(--color-bg-page) 8%, transparent), transparent 16%, transparent 84%, color-mix(in srgb, var(--color-bg-page) 12%, transparent)),
      linear-gradient(to right, transparent 76%, var(--color-bg-page));
  }

  .page-library-explorer .immersive-rails__edge--right::after {
    background:
      linear-gradient(to bottom, color-mix(in srgb, var(--color-bg-page) 8%, transparent), transparent 16%, transparent 84%, color-mix(in srgb, var(--color-bg-page) 12%, transparent)),
      linear-gradient(to left, transparent 76%, var(--color-bg-page));
  }
}

.library-path-hero {
  padding-block: clamp(2rem, 4vw, 3.5rem) clamp(2rem, 4vw, 3.5rem);
}

.library-path-hero h1 {
  max-width: 26ch;
  margin: 0.45rem 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(2.65rem, 5vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.library-path-hero > p:not(.eyebrow) {
  max-width: 95ch;
  margin: 0;
  color: var(--library-muted);
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  line-height: 1.62;
}

.library-figures { margin-top: clamp(1.7rem, 3vw, 2.5rem); }
.library-figures > dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0; border-block: 1px solid var(--library-rule); }
.library-figures > dl > div { padding: 1.1rem 1rem 1.15rem 0; }
.library-figures dt { color: var(--library-muted); font: 600 .76rem/1.3 var(--font-sans); }
.library-figures dd { margin: .3rem 0 0; color: var(--library-ink); font: 500 clamp(1.5rem, 2.5vw, 2.15rem)/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.library-figures__more { border-bottom: 1px solid var(--library-rule); }
.library-figures__more > summary { display: flex; width: fit-content; align-items: center; gap: .5rem; padding-block: 1rem; color: var(--library-accent); cursor: pointer; font-weight: 750; list-style: none; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .32rem; }
.library-figures__more > summary::-webkit-details-marker { display: none; }
.library-figures__more > summary:focus-visible { outline: 2px solid var(--library-accent); outline-offset: .28rem; }
.library-figures__more > summary svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; transition: transform 180ms var(--ease-out); }
.library-figures__more[open] > summary svg { transform: rotate(180deg); }
.library-figures__more > dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding-bottom: 1rem; }
.library-figures__more > dl > div { padding: .8rem 1rem .9rem 0; border-top: 1px solid var(--library-rule); }
.library-figures__more > dl dd { font-size: clamp(1.25rem, 2vw, 1.7rem); }
.library-figures__more > p { margin: 0 0 1rem; max-width: 75ch; color: var(--library-muted); font-size: .79rem; line-height: 1.5; }
@media (max-width: 680px) { .library-figures > dl, .library-figures__more > dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .library-figures__more > summary svg { transition: none; } }

.exploration-paths {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  overflow: hidden;
  border: 1px solid var(--library-rule);
  background: var(--library-rule);
}

.exploration-path {
  position: relative;
  min-height: 9rem;
  padding: 1.25rem;
  color: var(--library-ink);
  background: color-mix(in srgb, var(--color-bg-page) 96%, white);
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.exploration-path:hover,
.exploration-path[aria-current="page"] {
  color: var(--color-text-inverse);
  background: var(--library-accent);
}

.exploration-path:focus-visible {
  z-index: 1;
  outline: 3px solid var(--color-focus-ring);
  outline-offset: -3px;
}

.exploration-path__index {
  display: block;
  margin-bottom: 1.25rem;
  color: var(--library-bronze);
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
}

.exploration-path:hover .exploration-path__index,
.exploration-path[aria-current="page"] .exploration-path__index {
  color: #f0d39b;
}

.exploration-path strong,
.exploration-path > span:last-child {
  display: block;
}

.exploration-path strong {
  margin-bottom: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.22rem;
}

.exploration-path > span:last-child {
  color: var(--library-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.exploration-path:hover > span:last-child,
.exploration-path[aria-current="page"] > span:last-child {
  color: color-mix(in srgb, var(--color-text-inverse) 76%, transparent);
}

.page-library-explorer .immersive-panorama--library {
  margin-block: 0;
}

.library-toolbar {
  position: sticky !important;
  top: var(--header-h, 4.5rem);
  z-index: 30 !important;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(13rem, 18rem) auto auto;
  align-items: center;
  gap: 1rem;
  min-height: 4.5rem;
  margin-top: 0 !important;
  padding: 0.7rem 0.85rem 0.7rem 1.2rem;
  border-block: 1px solid var(--library-rule);
  background: color-mix(in srgb, var(--color-bg-page) 94%, transparent);
  backdrop-filter: blur(16px);
}

.library-toolbar__modes,
.library-toolbar__search button svg {
  display: none;
}

.library-toolbar__identity {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  white-space: nowrap;
}

.library-toolbar__identity span {
  font-family: var(--font-display);
  font-weight: 700;
}

.library-toolbar__identity strong {
  color: var(--library-muted);
  font-size: 0.78rem;
}

.library-toolbar__active {
  display: flex;
  gap: 0.4rem;
  min-width: 0;
  overflow: hidden;
}

.library-toolbar__active span {
  flex: 0 0 auto;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--library-rule);
  border-radius: 999px;
  color: var(--library-muted);
  font-size: 0.76rem;
}

.library-toolbar__search {
  display: flex;
  min-width: 0;
}

.library-toolbar__search label {
  min-width: 0;
  flex: 1;
}

.library-toolbar__search input {
  width: 100%;
  min-height: 2.75rem;
  padding-inline: 0.8rem;
  border: 1px solid var(--library-rule);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  background: var(--color-surface-raised);
  color: var(--library-ink);
  font: inherit;
  font-size: 0.8rem;
}

.library-toolbar__search button {
  min-height: 2.75rem;
  padding-inline: 0.8rem;
  border: 1px solid var(--library-accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--library-accent);
  color: var(--color-text-inverse);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
}

.library-toolbar__search input:focus-visible,
.library-toolbar__search button:focus-visible {
  position: relative;
  z-index: 1;
}

.library-sort {
  display: flex;
  gap: 0.35rem;
}

.library-sort select,
.filter-drawer select,
.filter-drawer input[type="search"],
.concept-search input,
.passage-search-hero input,
.page-reader input {
  min-height: 2.75rem;
  border: 1px solid var(--library-rule);
  border-radius: var(--radius-sm);
  background: var(--color-surface-raised);
  color: var(--library-ink);
}

.library-sort select {
  max-width: 10rem;
  padding-inline: 0.65rem 1.7rem;
  font-size: 0.8rem;
}

.filter-toggle {
  display: inline-flex;
  min-height: 2.8rem;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem 0.55rem 1rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--library-accent);
  color: var(--color-text-inverse);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.filter-toggle span {
  display: grid;
  min-width: 1.6rem;
  height: 1.6rem;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, white 18%, transparent);
  font-size: 0.75rem;
}

.page-library-explorer .library-explorer > .filter-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  background: rgba(17, 24, 19, 0.52);
}

.page-library-explorer .library-explorer > .filter-drawer {
  position: fixed;
  z-index: 90;
  inset: 0 0 0 auto;
  left: auto;
  right: 0;
  width: min(31rem, 100%);
  overflow-y: auto;
  padding: clamp(1.25rem, 4vw, 2.25rem);
  border-left: 1px solid var(--library-rule);
  background: var(--color-bg-page);
  box-shadow: -18px 0 50px rgba(16, 23, 18, 0.2);
}

.filter-drawer[hidden],
.filter-backdrop[hidden] {
  display: none;
}

.filter-drawer > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.3rem;
  border-bottom: 1px solid var(--library-rule);
}

.filter-drawer h2 {
  margin: 0.25rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.35rem);
}

.filter-drawer__header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.filter-drawer > header [data-filter-close] {
  display: grid;
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border: 1px solid var(--library-rule);
  border-radius: 50%;
  background: transparent;
  color: var(--library-ink);
  cursor: pointer;
  font-size: 1.5rem;
}

.filter-drawer__apply-top {
  min-height: 2.75rem;
}

.filter-drawer form,
.filter-drawer label,
.filter-drawer label > span {
  display: grid;
}

.filter-drawer form {
  gap: 1.05rem;
}

.filter-drawer label {
  gap: 0.42rem;
}

.filter-drawer label > span {
  color: var(--library-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.filter-drawer select,
.filter-drawer input[type="search"] {
  width: 100%;
  padding-inline: 0.8rem;
}

.filter-drawer__count {
  margin: 0.8rem 0 0;
  padding: 1rem;
  border-block: 1px solid var(--library-rule);
  background: transparent;
}

.filter-drawer__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.5rem;
}

.filter-drawer__actions > a {
  color: var(--library-accent);
  font-weight: 700;
  text-decoration-color: color-mix(in srgb, var(--library-bronze) 62%, transparent);
  text-underline-offset: 0.2em;
}

body.has-filter-drawer {
  overflow: hidden;
}

.library-mode-heading,
.concept-search {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(18rem, 1fr);
  gap: clamp(2rem, 7vw, 7rem);
  align-items: end;
  padding-block: clamp(3.5rem, 7vw, 6.5rem) 2.25rem;
  border-bottom: 1px solid var(--library-rule);
}

.library-mode-heading h2,
.concept-search h2,
.passage-search-hero h2 {
  max-width: 14ch;
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5.5vw, 4.6rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

.library-mode-heading > p,
.concept-search > div > p:last-child {
  margin: 0;
  color: var(--library-muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.library-private-timeline-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto;
  gap: 1.5rem;
  align-items: baseline;
  margin-block: 2rem 4rem;
  padding-block: 1rem;
  border-block: 1px solid var(--library-rule);
}

.library-private-timeline-notice h2,
.library-private-timeline-notice p {
  margin: 0;
}

.library-private-timeline-notice h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.2;
}

.library-private-timeline-notice p {
  max-width: 62ch;
  color: var(--library-muted);
}

.library-private-timeline-notice a {
  white-space: nowrap;
  color: var(--library-accent);
  font-weight: 700;
}

.library-mode-heading > p a {
  color: var(--library-accent);
  font-weight: 700;
}

.work-shelf {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 4rem;
  border: 1px solid var(--library-rule);
  background: var(--library-rule);
}

.work-card {
  display: grid;
  grid-template-columns: minmax(8.5rem, 0.72fr) minmax(0, 1.55fr);
  gap: clamp(1rem, 2.5vw, 1.75rem);
  min-width: 0;
  padding: clamp(1rem, 2.5vw, 1.6rem);
  background: var(--color-bg-page);
}

.work-card__cover,
.work-page__cover,
.reader-sheet--cover > div {
  --work-cover-tone: var(--color-text-primary);
  --work-cover-wash: linear-gradient(180deg, color-mix(in srgb, var(--work-cover-tone) 8%, transparent), color-mix(in srgb, var(--work-cover-tone) 18%, transparent) 58%, color-mix(in srgb, var(--work-cover-tone) 44%, var(--color-text-primary) 34%, transparent) 100%);
  position: relative;
  isolation: isolate;
  overflow: visible;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-sm) var(--radius-md) var(--radius-md) var(--radius-sm);
  background: var(--library-accent);
  color: white;
  transform: perspective(900px) rotateY(-4deg);
  transform-origin: left center;
  transform-style: preserve-3d;
}

.work-card__cover {
  align-self: start;
  container-type: inline-size;
  margin-right: 0.45rem;
  box-shadow:
    3px 1px 0 var(--library-paper),
    6px 3px 0 var(--color-border-strong),
    12px 17px 28px rgba(26, 31, 23, 0.22);
  text-decoration: none;
}

.work-card__cover::before,
.work-page__cover::before,
.reader-sheet--cover > div::before {
  position: absolute;
  z-index: 2;
  inset: 0 auto 0 0;
  width: clamp(0.55rem, 8%, 1.1rem);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  background: linear-gradient(90deg, color-mix(in srgb, var(--color-text-primary) 55%, transparent), color-mix(in srgb, var(--color-text-inverse) 12%, transparent) 52%, color-mix(in srgb, var(--color-text-primary) 28%, transparent));
  box-shadow: 1px 0 color-mix(in srgb, var(--color-text-inverse) 18%, transparent), 3px 0 7px color-mix(in srgb, var(--color-text-primary) 22%, transparent);
  content: "";
  pointer-events: none;
}

.work-card__cover::after,
.work-page__cover::after,
.reader-sheet--cover > div::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: inherit;
  background: var(--work-cover-wash);
  content: "";
}

.work-card__cover img,
.work-page__cover img,
.reader-sheet--cover img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  filter: saturate(0.72) contrast(0.95);
}

.work-card--private .work-card__cover img {
  object-fit: contain;
  background: var(--library-paper);
}

[data-cover-tone="limestone"] {
  --work-cover-tone: var(--color-border-strong);
}

[data-cover-tone="umber"] {
  --work-cover-tone: var(--color-accent-umber);
}

[data-cover-tone="olive"] {
  --work-cover-tone: var(--color-editorial-olive);
}

[data-cover-tone="bronze"] {
  --work-cover-tone: var(--color-accent-bronze);
}

[data-cover-tone="slate"] {
  --work-cover-tone: var(--color-cover-slate);
}

[data-cover-tone="ink"] {
  --work-cover-tone: var(--color-text-primary);
}

[data-cover-focal="left"] img {
  object-position: 28% center;
}

[data-cover-focal="center"] img {
  object-position: center;
}

[data-cover-focal="right"] img {
  object-position: 72% center;
}

[data-cover-scale="close"] img {
  object-fit: cover;
}

[data-cover-scale="wide"] img {
  object-fit: cover;
  filter: saturate(0.68) contrast(0.93) brightness(1.03);
}

.work-card__cover-copy,
.reader-sheet--cover span {
  position: absolute;
  z-index: 3;
  inset: auto 0 0;
  display: grid;
  gap: 0.35rem;
  width: 100%;
  min-width: 0;
  padding: 1rem;
}

.work-card__cover-copy strong,
.reader-sheet--cover strong {
  display: block;
  max-width: 100%;
  font-family: var(--font-display);
  line-height: 1.05;
  overflow-wrap: anywhere;
  hyphens: auto;
  text-wrap: balance;
}

.work-card__cover-copy strong {
  font-size: clamp(0.82rem, 7cqi, 1.22rem);
}

.reader-sheet--cover strong {
  font-size: clamp(1rem, 2vw, 1.45rem);
}

.work-card__cover-copy span,
.reader-sheet--cover em {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.75rem;
  font-style: normal;
}

.work-card--private .work-card__cover-copy { max-height: 100%; overflow: hidden; }
.work-card--private .work-card__cover-copy strong,
.work-card--private .work-card__cover-copy span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}
.work-card--private .work-card__cover-copy strong { -webkit-line-clamp: 5; }
.work-card--private .work-card__cover-copy span { -webkit-line-clamp: 2; }

.work-card__body {
  position: relative;
  min-width: 0;
}

.work-card__favorite {
  position: absolute;
  top: 0;
  right: 0;
}

.work-card__type {
  margin: 0 0 0.55rem;
  color: var(--library-bronze);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.work-card h2 {
  min-width: 0;
  margin: 0;
  padding-right: 3.2rem;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.4vw, 1.8rem);
  line-height: 1.12;
  overflow-wrap: anywhere;
  hyphens: auto;
  text-wrap: balance;
}

.work-page__title-row,
.passage-page__title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.work-page__title-row h1,
.passage-page__title-row h1 {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  hyphens: auto;
  text-wrap: balance;
}

.work-page__favorite,
.passage-page__favorite,
.passage-result__favorite {
  flex: 0 0 auto;
}

.passage-result__excerpt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: start;
}

.work-card h2 a,
.work-timeline h3 a,
.concept-index h3 a,
.passage-table-wrap a,
.work-page a,
.passage-page a,
.corpus-breadcrumbs a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--library-bronze) 60%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.work-card h2 a:hover,
.work-timeline h3 a:hover,
.concept-index h3 a:hover,
.passage-table-wrap a:hover,
.work-page a:hover,
.passage-page a:hover,
.corpus-breadcrumbs a:hover {
  color: var(--library-accent);
  text-decoration-thickness: 2px;
}

.work-card__entities {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.9rem 0;
}

.work-page__entities {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-block: 0.85rem 1.15rem;
}

.entity-action {
  position: relative;
  display: inline-flex;
}

.entity-action__trigger {
  display: inline-flex;
  min-height: 2.25rem;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.6rem;
  border: 1px solid var(--library-rule);
  border-radius: 999px;
  background: transparent;
  color: var(--library-ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
}

.entity-action__trigger:hover,
.entity-action__trigger[aria-expanded="true"] {
  border-color: var(--library-accent);
  background: color-mix(in srgb, var(--library-accent) 8%, transparent);
}

.entity-action__trigger img {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  object-fit: cover;
}

.entity-popover {
  position: absolute;
  z-index: 60;
  top: calc(100% + 0.45rem);
  left: 0;
  width: min(17rem, calc(100vw - 2rem));
  padding: 0.85rem;
  border: 1px solid var(--library-rule);
  background: var(--color-surface-raised);
  box-shadow: 0 15px 35px rgba(17, 24, 19, 0.18);
}

.entity-popover[hidden] {
  display: none;
}

.entity-popover strong,
.entity-popover a,
.entity-popover button {
  display: block;
  width: 100%;
}

.entity-popover strong {
  margin-bottom: 0.55rem;
  font-family: var(--font-display);
}

.entity-popover a,
.entity-popover button {
  padding: 0.55rem 0;
  border: 0;
  border-top: 1px solid var(--library-rule);
  background: transparent;
  color: var(--library-ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  text-align: left;
  text-decoration: none;
}

.work-card__summary {
  margin: 0.9rem 0 1.2rem;
  color: var(--library-muted);
  font-size: 0.91rem;
  line-height: 1.62;
}

.work-card__learning-link {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  margin: -0.35rem 0 1rem;
  color: var(--library-accent);
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration-color: color-mix(in srgb, var(--library-bronze) 65%, transparent);
  text-underline-offset: 0.24em;
}

.work-card__learning-link:hover {
  text-decoration-thickness: 2px;
}

.learning-dialog {
  width: min(38rem, calc(100vw - 2rem));
  max-height: min(44rem, calc(100vh - 2rem));
  padding: 0;
  border: 1px solid var(--library-rule);
  background: var(--color-surface-raised);
  color: var(--library-ink);
  box-shadow: 0 2rem 5rem rgba(17, 24, 19, 0.28);
}

.learning-dialog::backdrop {
  background: rgba(17, 24, 19, 0.58);
  backdrop-filter: blur(3px);
}

.learning-dialog__panel {
  position: relative;
  padding: clamp(1.5rem, 5vw, 3rem);
}

.learning-dialog__close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--library-rule);
  background: transparent;
  color: var(--library-ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
}

.learning-dialog h2 {
  max-width: 27rem;
  margin: 0.35rem 0 0.65rem;
  padding-right: 3rem;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 5vw, 2.6rem);
  line-height: 1.05;
}

.learning-dialog__work {
  margin: 0 0 1.25rem;
  color: var(--library-bronze);
  font-weight: 750;
}

.learning-dialog [data-learning-dialog-text] {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.7;
}

.learning-dialog__work-link {
  display: inline-block;
  margin-top: 1.5rem;
  color: var(--library-accent);
  font-weight: 750;
  text-underline-offset: 0.22em;
}

.work-card__facts {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--library-rule);
}

.work-card__facts div {
  display: grid;
  grid-template-columns: 5.3rem 1fr;
  gap: 0.65rem;
}

.work-card__facts dt,
.work-card__facts dd {
  margin: 0;
  font-size: 0.72rem;
}

.work-card__facts dt {
  color: var(--library-muted);
}

.cosp-badge {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0.15rem 0.35rem;
  border: 1px solid currentColor;
  border-radius: 999px;
}

.corpus-pagination,
.passage-neighbours,
.page-reader__nav {
  display: flex;
  min-height: 4.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-block: 2rem 5rem;
  padding-block: 1rem;
  border-block: 1px solid var(--library-rule);
}

.corpus-pagination a,
.passage-neighbours a {
  color: var(--library-ink);
  font-weight: 700;
}

.library-timeline-jump {
  position: sticky !important;
  z-index: 20 !important;
  top: var(--library-timeline-sticky-top, calc(var(--header-h, 4.5rem) + 4.5rem));
  display: flex;
  gap: var(--space-5);
  margin-top: calc(0rem - var(--space-7));
  overflow-x: auto;
  padding-block: var(--space-3) calc(var(--space-3) - 2px);
  border-block: 1px solid var(--color-border-subtle);
  background: color-mix(in srgb, var(--color-bg-page) 94%, transparent);
  scrollbar-color: var(--color-border-strong) transparent;
  backdrop-filter: blur(12px);
  transition: box-shadow 180ms var(--ease-out), background-color 180ms var(--ease-out);
}

.library-timeline-jump.is-stuck {
  background: color-mix(in srgb, var(--color-bg-page) 98%, transparent);
  box-shadow: 0 0.9rem 1.8rem rgba(37, 35, 31, 0.1);
}

.library-timeline-jump a {
  flex: 0 0 auto;
  padding: 0.3rem 0.08rem 0.38rem;
  box-shadow: inset 0 -2px transparent;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 650;
  text-decoration-color: transparent;
  text-underline-offset: 0.3em;
  transition: box-shadow 160ms var(--ease-out), color 160ms var(--ease-out);
}

.library-timeline-jump a:hover,
.library-timeline-jump a:focus-visible {
  color: var(--color-accent-bronze-hover);
}

.library-timeline-jump a.is-active,
.library-timeline-jump a[aria-current="location"] {
  box-shadow: inset 0 -2px var(--color-accent-bronze);
  color: var(--color-text-primary);
}

.library-timeline-eras {
  padding-block: 0;
}

.library-timeline-era {
  --library-era-surface: var(--color-bg-page);
  --library-era-line: #47706b;
  padding-block: clamp(4.5rem, 8vw, 7.5rem);
  background: var(--library-era-surface);
  box-shadow: 0 0 0 100vmax var(--library-era-surface);
  clip-path: inset(0 -100vmax);
  scroll-margin-top: calc(var(--library-timeline-sticky-top, var(--header-h, 4.5rem)) + 4rem);
}

.library-timeline-era--ancient {
  --library-era-surface: #efe5d4;
  --library-era-line: #47706b;
}

.library-timeline-era--crossroads {
  --library-era-surface: #e6e9dc;
  --library-era-line: #69713f;
}

.library-timeline-era--modern {
  --library-era-surface: #e9e3dc;
  --library-era-line: #76503e;
}

.library-timeline-era--contemporary {
  --library-era-surface: #e1e9e7;
  --library-era-line: #47706b;
}

.library-timeline-era__header {
  display: grid;
  grid-template-columns: minmax(14rem, 0.72fr) minmax(18rem, 1fr);
  gap: var(--space-6) clamp(3rem, 8vw, 8rem);
  align-items: end;
  margin-bottom: var(--space-7);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-border-strong);
}

.library-timeline-era__header h2 {
  max-width: 13ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 4.25rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  text-wrap: balance;
}

.library-timeline-era__range {
  margin: var(--space-3) 0 0;
  color: var(--color-accent-bronze-hover);
  font-size: var(--font-size-sm);
  font-weight: 700;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.library-timeline-era__header > p {
  max-width: 52ch;
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-lg);
  line-height: 1.65;
}

.library-branch-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.library-branch-row {
  display: grid;
  grid-template-columns: 7.25rem minmax(0, 1fr);
  min-height: 7.25rem;
}

.library-branch-row--work {
  min-height: 17rem;
}

.library-branch-graph {
  position: relative;
  min-width: 0;
}

.library-branch-segment {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  left: 1rem;
  width: 3px;
  border-radius: 999px;
  background: var(--library-era-line);
  opacity: 0.86;
}

.library-branch-segment.is-first {
  top: 50%;
}

.library-branch-segment.is-last {
  bottom: 50%;
}

.library-branch-work-node,
.library-branch-landmark-node {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 1rem;
  width: 0.78rem;
  height: 0.78rem;
  border: 2px solid var(--library-era-line);
  border-radius: 50%;
  background: var(--library-era-line);
  box-shadow: 0 0.18rem 0.6rem color-mix(in srgb, var(--library-era-line) 28%, transparent);
  transform: translate(-50%, -50%);
}

.library-branch-landmark-line {
  position: absolute;
  z-index: 0;
  top: 50%;
  right: 0;
  left: 0;
  border-top: 1px dotted var(--color-accent-bronze);
  opacity: 0.55;
}

.library-branch-landmark-node {
  width: 0.72rem;
  height: 0.72rem;
  border: 0;
  border-radius: 0.1rem;
  background: var(--color-accent-bronze);
  box-shadow: none;
  transform: translate(-50%, -50%) rotate(45deg);
}

.library-branch-content {
  min-width: 0;
  padding: var(--space-3) 0 var(--space-4) var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
}

.library-timeline-event-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2) var(--space-3);
  margin: 0 0 var(--space-1);
}

.library-timeline-event-heading time {
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.library-timeline-event-heading span {
  color: var(--color-text-secondary);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.library-timeline-landmark {
  max-width: 54rem;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--color-citation-bg);
  color: var(--color-text-primary);
  transition: background-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.library-timeline-landmark:hover {
  background: color-mix(in srgb, var(--color-citation-bg) 76%, white);
  box-shadow: 0 0.55rem 1.3rem rgba(63, 53, 42, 0.1);
  transform: translateY(-1px);
}

.library-timeline-landmark > p:last-child {
  margin: 0;
  line-height: 1.58;
}

.work-card--timeline {
  grid-template-columns: minmax(8.5rem, 0.42fr) minmax(0, 1.58fr);
  padding: 0;
  background: transparent;
}

.concept-search form,
.passage-search-hero form,
.page-reader > header form {
  display: flex;
  align-items: stretch;
}

.concept-search input,
.passage-search-hero input,
.page-reader input {
  width: 100%;
  padding-inline: 1rem;
}

.concept-search button,
.passage-search-hero button,
.page-reader form button {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.concept-index {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 5rem;
  border: 1px solid var(--library-rule);
  background: var(--library-rule);
}

.concept-index article {
  position: relative;
  min-height: 17rem;
  padding: 1.4rem;
  background: var(--color-bg-page);
}

.concept-index__count {
  margin: 0 0 2.3rem;
  color: var(--library-bronze);
  font-family: var(--font-display);
  font-size: 0.82rem;
}

.concept-index h3 {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
}

.concept-index__definition {
  margin-bottom: 4.2rem;
  color: var(--library-muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.concept-index__meta {
  position: absolute;
  left: 1.4rem;
  bottom: 2.9rem;
  margin: 0;
  color: var(--library-muted);
  font-size: 0.72rem;
}

.concept-index article > a:last-child {
  position: absolute;
  right: 1.4rem;
  bottom: 1.4rem;
  color: var(--library-accent);
  font-size: 0.82rem;
  font-weight: 700;
}

.passage-search-hero {
  padding-block: clamp(4rem, 8vw, 7rem);
  text-align: center;
}

.passage-search-hero h2 {
  max-width: 17ch;
  margin-inline: auto;
}

.passage-search-hero form {
  width: min(50rem, 100%);
  margin: 2.2rem auto 0;
}

.passage-search-hero label {
  flex: 1;
}

.passage-search-hero input {
  min-height: 3.55rem;
  font-size: 1.05rem;
}

.passage-search-hero ul {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
}

.passage-search-hero ul a {
  color: var(--library-muted);
  font-size: 0.82rem;
}

.passage-results {
  margin-bottom: 5rem;
}

.passage-results > header {
  padding-block: 1rem;
  border-bottom: 1px solid var(--library-rule);
}

.passage-table-wrap {
  overflow-x: auto;
}

.passage-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.passage-table-wrap th,
.passage-table-wrap td {
  padding: 0.9rem 0.7rem;
  border-bottom: 1px solid var(--library-rule);
  text-align: left;
  vertical-align: top;
}

.passage-table-wrap th {
  color: var(--library-muted);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.passage-table-wrap th a {
  display: inline-flex;
  min-height: 2.25rem;
  align-items: center;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--library-bronze) 45%, transparent);
  text-underline-offset: 0.22em;
}

.passage-table-wrap th[aria-sort] a {
  color: var(--library-ink);
  text-decoration-color: var(--library-bronze);
}

.filter-drawer__sort {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0;
  padding: 1rem 0 0;
  border: 0;
  border-top: 1px solid var(--library-rule);
}

.filter-drawer__sort legend {
  grid-column: 1 / -1;
  padding: 0;
  color: var(--library-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.passage-table-wrap td:first-child {
  min-width: 22rem;
  line-height: 1.5;
}

.passage-table-wrap mark {
  padding: 0.05em 0.14em;
  border-radius: 0.16rem;
  background: color-mix(in srgb, var(--library-bronze) 24%, var(--library-paper));
  color: inherit;
}

.library-empty-state {
  max-width: 48rem;
  margin-block: clamp(4rem, 9vw, 8rem) !important;
  padding: clamp(2rem, 5vw, 4rem);
  border-block: 1px solid var(--library-rule);
  background: color-mix(in srgb, var(--library-bronze) 6%, transparent);
}

.library-empty-state h1,
.library-empty-state h2,
.library-empty-state h3 {
  margin-top: 0;
  font-family: var(--font-display);
}

.corpus-breadcrumbs {
  padding-block: 1rem;
  border-bottom: 1px solid var(--library-rule);
}

.corpus-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.78rem;
}

.corpus-breadcrumbs a,
.corpus-breadcrumbs [aria-current="page"] {
  display: inline-block;
  min-height: 2.4rem;
  align-content: center;
}

.corpus-breadcrumbs li:not(:last-child)::after {
  margin-left: 0.35rem;
  color: var(--library-muted);
  content: "/";
}

.work-page,
.passage-page {
  padding-block: clamp(2.5rem, 6vw, 5rem) 6rem;
}

.source-commerce--prominent {
  margin-block: var(--space-5);
  padding-block: var(--space-4);
  border-block: 1px solid var(--library-rule);
}

.work-page__hero .source-commerce--prominent {
  margin-bottom: 0;
}

.source-commerce--prominent > h3 {
  margin: 0 0 var(--space-1);
  color: var(--library-ink);
  font-family: var(--font-display);
  font-size: var(--font-size-lg);
}

.source-commerce--prominent > p {
  max-width: 65ch;
  margin: 0;
  color: var(--library-muted);
  font-size: var(--font-size-xs);
  line-height: 1.45;
}

.source-commerce--prominent > p:first-of-type {
  color: var(--library-bronze);
  font-weight: 700;
}

.source-commerce--prominent .source-commerce__language {
  margin-top: var(--space-3);
}

.source-commerce--prominent .source-commerce__language h4 {
  margin: 0 0 var(--space-2);
  color: var(--library-ink);
  font-size: var(--font-size-sm);
}

.source-commerce--prominent .source-commerce__manifestation + .source-commerce__manifestation {
  margin-top: var(--space-3);
}

.source-commerce--prominent .source-commerce__manifestation p {
  margin: 0 0 var(--space-1);
  color: var(--library-muted);
  font-size: var(--font-size-xs);
}

.source-commerce--prominent .source-commerce__manifestation ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.source-commerce--prominent .source-commerce__manifestation a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--library-bronze);
  border-radius: var(--radius-sm);
  color: var(--library-accent);
  font-size: var(--font-size-sm);
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
}

.source-commerce--prominent .source-commerce__manifestation a:hover,
.source-commerce--prominent .source-commerce__manifestation a:focus-visible {
  background: var(--library-accent);
  color: var(--color-text-inverse);
}

.work-page__hero {
  display: grid;
  grid-template-columns: minmax(14rem, 0.72fr) minmax(0, 1.5fr);
  gap: clamp(2rem, 7vw, 7rem);
  align-items: start;
}

.work-page__cover {
  margin-right: 0.8rem;
  box-shadow:
    5px 2px 0 var(--library-paper),
    10px 5px 0 var(--color-border-strong),
    19px 28px 52px rgba(17, 24, 19, 0.25);
}

.work-page__hero h1,
.passage-page > header h1 {
  max-width: 13ch;
  margin: 0.45rem 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.work-page__byline {
  color: var(--library-bronze);
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.work-page__short {
  max-width: 60ch;
  color: var(--library-muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.work-page__hero dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--library-rule);
}

.work-page__hero dl div {
  min-width: 0;
}

.work-page__hero dt {
  color: var(--library-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.work-page__hero dd {
  margin: 0.2rem 0 0;
}

.work-date-evidence {
  margin-top: 0.45rem;
  color: var(--library-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.work-date-evidence summary {
  width: fit-content;
  color: var(--library-bronze);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--library-bronze) 48%, transparent);
  text-underline-offset: 0.18em;
}

.work-date-evidence p {
  max-width: 48ch;
  margin-block: 0.55rem 0;
}

.work-date-evidence ul {
  display: grid;
  gap: 0.3rem;
  margin: 0.55rem 0 0;
  padding-left: 1rem;
}

.work-learning {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: 2rem;
  margin-block: clamp(4rem, 10vw, 9rem);
  padding-block: 2.5rem;
  border-block: 1px solid var(--library-rule);
}

.work-learning h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.work-learning p:last-child {
  grid-column: 2;
  margin: -1.4rem 0 0;
  color: var(--library-muted);
  font-size: 1.15rem;
  line-height: 1.75;
}

.work-summary {
  display: grid;
  grid-template-columns: minmax(12rem, 0.7fr) minmax(0, 1.6fr);
  gap: clamp(2rem, 8vw, 8rem);
  margin-bottom: 6rem;
}

.work-summary p:not(.eyebrow) {
  margin-top: 0;
  color: var(--library-muted);
  font-size: 1rem;
  line-height: 1.75;
}

.work-summary > div:last-child p:not(.eyebrow):first-of-type {
  color: var(--library-ink);
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.work-concepts,
.manifestations {
  margin-block: 5rem;
}

.work-concepts h2,
.manifestations h2,
.historical-context h2,
.page-reader h2,
.passage-page__concepts h2 {
  margin: 0 0 1.3rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.concept-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.concept-badges a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--library-rule);
  border-radius: 999px;
  color: var(--library-ink);
  font-size: 0.82rem;
  text-decoration: none;
}

.concept-badges a:hover {
  border-color: var(--library-accent);
  background: color-mix(in srgb, var(--library-accent) 8%, transparent);
}

.concept-badges span {
  color: var(--library-muted);
  font-size: 0.7rem;
}

.historical-context {
  width: 100vw;
  margin-block: 7rem;
  margin-left: calc(50% - 50vw);
  padding: clamp(3rem, 7vw, 6rem) max(1rem, calc((100vw - 1120px) / 2));
  background: var(--library-accent);
  color: var(--color-text-inverse);
}

.historical-context > header {
  display: grid;
  grid-template-columns: 0.65fr 1fr;
  gap: 2rem;
  align-items: end;
  margin-bottom: 2rem;
}

.historical-context > header .eyebrow,
.historical-context > header h2 {
  grid-column: 1;
}

.historical-context > header p:last-child {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin: 0;
  color: color-mix(in srgb, var(--color-text-inverse) 72%, transparent);
  line-height: 1.65;
}

.historical-context__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.historical-context figure {
  margin: 0;
}

.historical-context figure:nth-child(2) {
  transform: translateY(2rem);
}

.historical-context img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.historical-context figcaption {
  display: grid;
  gap: 0.35rem;
  padding-top: 0.8rem;
  font-size: 0.8rem;
}

.historical-context figcaption span {
  color: color-mix(in srgb, var(--color-text-inverse) 70%, transparent);
  line-height: 1.5;
}

.historical-context figcaption a {
  color: #f0d39b;
}

.historical-context__world {
  margin-top: clamp(4rem, 8vw, 7rem);
  padding-top: clamp(2.5rem, 5vw, 4rem);
  border-top: 1px solid color-mix(in srgb, var(--color-text-inverse) 32%, transparent);
}

.historical-context__world > header {
  display: flex;
  gap: 1rem 2rem;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.historical-context__world h3 {
  max-width: 22ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3.5vw, 2.6rem);
  font-weight: 600;
  line-height: 1.05;
  text-wrap: balance;
}

.historical-context__world > header p {
  margin: 0;
  color: color-mix(in srgb, var(--color-text-inverse) 72%, transparent);
  font-size: 0.82rem;
}

.historical-context__world-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.historical-context__world-grid figure:nth-child(2) {
  transform: none;
}

.historical-context__world-grid figcaption span {
  display: none;
}

.historical-context__world-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 2rem;
  margin: 2.5rem 0 0;
}

.historical-context__world-facts div {
  padding: 1rem 0;
  border-top: 1px solid color-mix(in srgb, var(--color-text-inverse) 24%, transparent);
}

.historical-context__world-facts dt {
  color: #f0d39b;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.historical-context__world-facts dd {
  margin: 0.45rem 0 0;
  color: color-mix(in srgb, var(--color-text-inverse) 86%, transparent);
  font-size: 0.9rem;
  line-height: 1.58;
}

.manifestations > p {
  max-width: 66ch;
  color: var(--library-muted);
}

.manifestations ul {
  margin: 2rem 0 0;
  padding: 0;
  border-top: 1px solid var(--library-rule);
  list-style: none;
}

.manifestations li {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 1rem;
  padding-block: 0.85rem;
  border-bottom: 1px solid var(--library-rule);
}

.manifestations li strong {
  color: var(--library-bronze);
}

.manifestations__source {
  font-size: 0.76rem;
}

.page-reader {
  margin-top: 7rem;
  padding: clamp(1rem, 4vw, 3rem);
  border: 1px solid var(--library-rule);
  background: color-mix(in srgb, var(--library-accent) 5%, var(--color-bg-page));
  overflow-anchor: none;
}

.page-reader > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.page-reader > header form {
  width: min(24rem, 100%);
}

.page-reader__stage {
  display: grid;
  min-height: min(48rem, 75vh);
  place-items: center;
  perspective: 1200px;
}

.reader-sheet {
  position: relative;
  width: min(42rem, 100%);
  min-height: min(42rem, 68vh);
  height: auto;
  overflow: visible;
  padding: clamp(1.5rem, 5vw, 4.5rem);
  border: 1px solid rgba(102, 82, 44, 0.2);
  background: var(--library-paper);
  box-shadow: 10px 14px 35px rgba(32, 31, 24, 0.16), inset -22px 0 30px rgba(92, 75, 46, 0.04);
  color: #26271f;
  transform-origin: left center;
  animation: reader-page-in 260ms ease-out;
}

.page-reader.is-loading .page-reader__stage {
  opacity: 0.62;
}

.page-reader[data-paper-period="ancient"] .reader-sheet {
  background-color: #eee2c5;
}

.page-reader[data-paper-period="classical"] .reader-sheet {
  background-color: #eadcba;
}

.page-reader[data-paper-period="contemporary"] .reader-sheet,
.page-reader[data-paper-period="fiction"] .reader-sheet {
  background-color: #fbfaf5;
}

.reader-sheet--cover {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.reader-sheet--cover > div {
  width: min(30rem, 82vw);
  box-shadow:
    5px 2px 0 var(--library-paper),
    10px 5px 0 var(--color-border-strong),
    19px 28px 52px rgba(17, 24, 19, 0.25);
}

.reader-sheet--cover span {
  padding: 2rem;
}

.reader-sheet--cover strong {
  font-size: clamp(2rem, 5vw, 3.6rem);
}

.reader-sheet > header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(70, 68, 48, 0.2);
  font-size: 0.75rem;
}

.reader-sheet blockquote {
  margin: clamp(2rem, 5vw, 4rem) 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.1vw, 1.42rem);
  line-height: 1.75;
}

.reader-sheet[dir="rtl"] blockquote,
.passage-page__representations > section[dir="rtl"] blockquote {
  direction: rtl;
  text-align: right;
  unicode-bidi: plaintext;
}

.reader-sheet[data-language="ar"] blockquote,
.passage-page__representations > section[data-language="ar"] blockquote {
  font-family: "Noto Naskh Arabic", "Amiri", "Geeza Pro", serif;
}

.reader-sheet[data-language="he"] blockquote,
.passage-page__representations > section[data-language="he"] blockquote {
  font-family: "Noto Serif Hebrew", "David Libre", "New Peninim MT", serif;
  line-height: 1.9;
}

.page-reader__nav {
  margin: 1.5rem 0 0;
}

.page-reader__nav a,
.page-reader__nav > span {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border: 1px solid var(--library-rule);
  border-radius: 50%;
  color: var(--library-ink);
  font-size: 1.35rem;
  text-decoration: none;
}

.page-reader__nav p {
  margin: 0;
  color: var(--library-muted);
  font-size: 0.8rem;
}

@keyframes reader-page-in {
  from { opacity: 0; transform: rotateY(-7deg) translateX(0.75rem); }
  to { opacity: 1; transform: rotateY(0) translateX(0); }
}

.work-contents {
  margin-top: clamp(3rem, 7vw, 6rem);
  padding: clamp(1.4rem, 4vw, 2.6rem);
  border: 1px solid var(--library-rule);
  background: color-mix(in srgb, var(--library-paper) 84%, transparent);
}

.work-contents > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: end;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--library-rule);
}

.work-contents h2,
.work-contents header p {
  margin: 0;
}

.work-contents header div p {
  max-width: 44rem;
  margin-top: 0.5rem;
  color: var(--library-muted);
}

.work-contents__path {
  color: var(--library-bronze);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: right;
}

.work-outline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.work-outline details {
  scroll-margin-top: calc(var(--header-h, 4rem) + 1.5rem);
  border: 1px solid var(--library-rule);
  background: var(--library-paper);
}

.work-outline summary {
  display: flex;
  min-height: 3.5rem;
  padding: 0.85rem 1rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
}

.work-outline summary span {
  color: var(--library-muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.work-outline details[open] summary {
  border-bottom: 1px solid var(--library-rule);
}

.work-outline--nested {
  grid-template-columns: 1fr;
  padding: 0.6rem;
  border-top: 1px solid var(--library-rule);
  background: color-mix(in srgb, var(--library-bronze) 5%, transparent);
}

.work-outline--nested details {
  background: color-mix(in srgb, var(--library-paper) 90%, white);
}

.work-outline ol {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0;
  margin: 0;
  padding: 0.5rem;
  list-style: none;
}

.work-outline li a {
  display: block;
  padding: 0.6rem 0.7rem;
  color: var(--library-ink);
  text-decoration-color: color-mix(in srgb, var(--library-bronze) 45%, transparent);
  text-underline-offset: 0.2em;
}

.work-outline li a:hover,
.work-outline li a:focus-visible {
  background: color-mix(in srgb, var(--library-bronze) 10%, transparent);
  text-decoration-color: var(--library-bronze);
}

.work-outline--flat {
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-contents__remainder {
  margin: 1.2rem 0 0;
  color: var(--library-muted);
  font-size: 0.82rem;
}

.passage-page {
  max-width: 58rem;
}

.passage-page > header {
  margin-bottom: 3rem;
}

.passage-page > header:has(+ .source-commerce--prominent) {
  margin-bottom: var(--space-4);
}

.passage-page > .source-commerce--prominent {
  margin-top: 0;
}

.passage-rights {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  width: fit-content;
  max-width: 46rem;
  margin-bottom: 2rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid currentColor;
  border-radius: var(--radius-sm);
  color: var(--library-accent);
  font-size: var(--font-size-sm);
  line-height: 1.45;
}

.passage-rights--protected {
  color: var(--color-warning);
}

.passage-rights strong {
  flex: 0 0 auto;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.passage-rights span {
  color: var(--library-muted);
}

.passage-page__position {
  margin: 1.25rem 0 0;
  color: var(--library-ink);
  font-weight: 750;
}

.passage-page__reference {
  margin: 0.3rem 0 0;
  color: var(--library-muted);
  font-size: var(--font-size-sm);
}

.passage-page > header h1 span {
  display: block;
  margin-top: 0.4rem;
  color: var(--library-bronze);
  font-size: 0.4em;
  letter-spacing: 0;
}

.passage-translation-tabs {
  display: flex;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--library-rule);
  border-bottom: 0;
  background: var(--color-bg-subtle);
  scrollbar-color: var(--color-border-strong) transparent;
}

.passage-neighbours a {
  display: grid;
  gap: 0.2rem;
  min-width: 10rem;
  text-decoration: none;
}

.passage-neighbours a[rel="next"] {
  text-align: right;
}

.passage-neighbours a span,
.passage-neighbours__position {
  color: var(--library-muted);
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.passage-neighbours a strong {
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

.passage-translation-tabs[hidden] {
  display: none;
}

.passage-translation-tabs button {
  flex: 0 0 auto;
  min-height: 2.75rem;
  padding: 0.7rem 1.15rem;
  border: 0;
  border-right: 1px solid var(--library-rule);
  background: transparent;
  color: var(--library-muted);
  cursor: pointer;
  font: inherit;
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.3em;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out), text-decoration-color 160ms var(--ease-out);
}

.passage-translation-tabs button:hover {
  color: var(--library-ink);
  text-decoration-color: var(--color-accent-bronze);
}

.passage-translation-tabs button[aria-selected="true"] {
  background: var(--library-accent);
  color: var(--color-text-inverse);
  text-decoration-color: var(--color-accent-bronze);
}

.passage-translation-tabs button:focus-visible {
  position: relative;
  z-index: 1;
  outline: 3px solid var(--color-focus-ring);
  outline-offset: -3px;
}

.passage-page__representations {
  display: grid;
  gap: 1px;
  border: 1px solid var(--library-rule);
  background: var(--library-rule);
}

.passage-translations .passage-page__representations {
  border-top: 0;
}

.passage-page__representations > section {
  padding: clamp(1.5rem, 5vw, 3.5rem);
  background: var(--library-paper);
  color: #26271f;
}

.passage-page__representations header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(70, 68, 48, 0.2);
}

.passage-page__representations h2,
.passage-page__representations p {
  margin: 0;
  font-size: 0.75rem;
}

.translation-provenance-badge {
  display: inline-block;
  margin-inline-start: 0.45rem;
  padding: 0.2rem 0.48rem;
  border: 1px solid var(--library-bronze);
  border-radius: var(--radius-sm);
  color: var(--library-accent);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  vertical-align: 0.15em;
}

.passage-page__representations blockquote {
  margin: clamp(2rem, 5vw, 4rem) 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.5vw, 1.55rem);
  line-height: 1.8;
}

@media (max-width: 640px) {
  .passage-rights {
    display: grid;
  }

  .passage-neighbours {
    align-items: start;
  }

  .passage-neighbours a {
    min-width: 0;
  }

  .passage-neighbours__position {
    align-self: center;
  }

  .passage-translation-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
    overflow: visible;
  }

  .passage-translation-tabs button {
    padding: 0.65rem 0.5rem;
    white-space: normal;
  }

  .passage-page__representations header {
    display: block;
  }

  .passage-page__representations header > p {
    margin-top: 0.65rem;
  }
}

.passage-page__concepts {
  margin-top: 4rem;
}

.passage-subreferences {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--library-rule);
}

.passage-subreferences ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 1.2rem 0 0;
  padding: 0;
  list-style: none;
}

.passage-subreferences a {
  display: grid;
  gap: 0.25rem;
  height: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--library-rule);
  color: var(--library-ink);
  text-decoration: none;
}

.passage-subreferences a:hover,
.passage-subreferences a:focus-visible {
  border-color: var(--library-bronze);
}

.passage-subreferences span {
  color: var(--library-bronze);
  font-size: 0.76rem;
  font-weight: 700;
}

.passage-subreferences small {
  color: var(--library-muted);
  line-height: 1.45;
}

@media (max-width: 920px) {
  .exploration-paths { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-private-timeline-notice { grid-template-columns: 1fr; gap: 0.7rem; }
  .library-private-timeline-notice a { white-space: normal; }
  .library-toolbar { grid-template-columns: 1fr auto; }
  .library-toolbar__active { grid-column: 1 / -1; grid-row: 2; }
  .library-toolbar__search { grid-column: 1; grid-row: 3; }
  .library-sort { grid-column: 2; grid-row: 3; }
  .filter-toggle { grid-column: 2; grid-row: 1; }
  .work-shelf { grid-template-columns: 1fr; }
  .concept-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-page__hero { grid-template-columns: minmax(12rem, 0.75fr) minmax(0, 1.25fr); gap: 2.5rem; }
  .historical-context > header { grid-template-columns: 1fr; }
  .historical-context > header p:last-child { grid-column: 1; grid-row: auto; }
  .historical-context__world-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .page-library-explorer .library-explorer > :not(.immersive-rails, .immersive-panorama, .filter-backdrop, .filter-drawer) { width: min(100% - 1.2rem, 1120px); }
  .library-path-hero { padding-top: 2.7rem; }
  .library-path-hero h1 { font-size: clamp(2.35rem, 12vw, 4.1rem); }
  .exploration-paths { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exploration-path { min-height: 3.5rem; padding: 0.75rem; }
  .exploration-path__index,
  .exploration-path > span:last-child { display: none; }
  .library-toolbar {
    top: var(--header-h, 4rem);
    width: 100% !important;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.4rem;
    padding: 0.45rem 0.6rem;
  }
  .library-toolbar__modes {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 1;
    gap: 0.2rem;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
  }
  .library-toolbar__modes a {
    flex: 1 1 auto;
    min-height: 2.65rem;
    align-content: center;
    padding: 0.45rem 0.3rem;
    border-radius: var(--radius-sm);
    color: var(--library-ink);
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
  }
  .library-toolbar__modes a[aria-current="page"] {
    background: var(--library-accent);
    color: var(--color-text-inverse);
  }
  .library-toolbar__identity,
  .library-toolbar__active,
  .library-sort { display: none; }
  .library-toolbar__search { grid-column: 1; grid-row: 2; min-width: 0; }
  .library-toolbar__search button { min-width: 2.75rem; padding: 0; display: grid; place-items: center; }
  .library-toolbar__search button span { display: none; }
  .library-toolbar__search button svg { display: block; width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 2; }
  .filter-toggle { grid-column: 2; grid-row: 2; min-height: 2.75rem; }
  .library-mode-heading,
  .concept-search,
  .work-page__hero,
  .work-summary { grid-template-columns: 1fr; gap: 1.5rem; }
  .library-timeline-era__header { grid-template-columns: 1fr; gap: var(--space-4); }
  .library-timeline-era__header > p { font-size: 1rem; }
  .library-branch-row { grid-template-columns: 1.8rem minmax(0, 1fr); }
  .library-branch-content { padding-left: var(--space-3); }
  .library-timeline-landmark { padding-inline: var(--space-3); }
  .work-card { grid-template-columns: 7.5rem minmax(0, 1fr); }
  .work-card__facts div { grid-template-columns: 1fr; gap: 0.1rem; }
  .concept-search form { width: 100%; }
  .concept-index { grid-template-columns: 1fr; }
  .work-card--timeline { grid-template-columns: 7rem minmax(0, 1fr); }
  .passage-search-hero form { display: grid; }
  .passage-search-hero button { border-radius: var(--radius-sm); }
  .passage-search-hero ul { flex-wrap: wrap; }
  .passage-table-wrap table,
  .passage-table-wrap thead,
  .passage-table-wrap tbody,
  .passage-table-wrap tr,
  .passage-table-wrap th,
  .passage-table-wrap td { display: block; }
  .passage-table-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .passage-table-wrap tr { padding-block: 1rem; border-bottom: 1px solid var(--library-rule); }
  .passage-table-wrap td { display: grid; grid-template-columns: 6rem 1fr; min-width: 0 !important; padding: 0.35rem 0; border: 0; }
  .passage-table-wrap td::before { color: var(--library-muted); content: attr(data-label); font-size: 0.68rem; text-transform: uppercase; }
  .work-page__hero { padding-top: 1rem; }
  .work-page__hero > .work-page__cover { order: 2; margin-top: var(--space-4); }
  .work-page__hero > div:last-child { order: 1; }
  .work-page__cover { width: min(18rem, 82vw); }
  .work-page__hero dl { grid-template-columns: 1fr; }
  .work-learning { grid-template-columns: 1fr; }
  .work-learning p:last-child { grid-column: 1; margin: 0; }
  .historical-context__grid { grid-template-columns: 1fr; }
  .historical-context__world > header { align-items: flex-start; flex-direction: column; }
  .historical-context__world-grid,
  .historical-context__world-facts { grid-template-columns: 1fr; }
  .work-contents > header,
  .work-outline,
  .passage-subreferences ol { grid-template-columns: 1fr; }
  .work-contents__path { text-align: left; }
  .historical-context figure:nth-child(2) { transform: none; }
  .page-reader > header { align-items: stretch; flex-direction: column; }
  .page-reader__stage { min-height: 65vh; }
  .reader-sheet { min-height: 58vh; }
  .page-library-explorer .library-explorer > .filter-drawer {
    inset: auto 0 0;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: 92vh;
    border-top: 1px solid var(--library-rule);
    border-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reader-sheet { animation: none; }
  .exploration-path { transition: none; }
}
