:root {
  --navy: #2c3e50;
  --warm-white: #fafaf8;
  --stone-grey: #e8e4df;
  --dark: #141414;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Inter", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.8;
  color: var(--navy);
  background: var(--warm-white);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  padding-top: 140px;
}

@media (min-width: 768px) {
  main {
    padding-top: 160px;
  }
}

.container {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-narrow {
  max-width: 48rem;
}

.container-wide {
  max-width: 80rem;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid rgba(44, 62, 80, 0.2);
  padding: 0.75rem 0;
}

.site-header .inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.logo img {
  height: 5rem;
  width: auto;
  object-fit: contain;
}

@media (min-width: 768px) {
  .logo img {
    height: 6rem;
  }
}

.logo-text {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.nav-desktop {
  display: none;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  flex-wrap: nowrap;
  gap: 1.15rem;
}

@media (min-width: 1024px) {
  .nav-desktop {
    display: flex;
  }
}

@media (min-width: 1280px) {
  .nav-desktop {
    gap: 2rem;
  }
}

.nav-link {
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
  transition: opacity 0.3s;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  opacity: 1;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.25rem;
  width: 100%;
  height: 1px;
  background: var(--navy);
  transform: scaleX(0);
  transition: transform 0.3s;
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.nav-signout {
  display: inline;
  margin: 0;
  padding: 0;
}

.nav-signout-btn {
  font: inherit;
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
}

.nav-signout-btn:hover {
  opacity: 1;
}

.nav-mobile .nav-signout {
  display: block;
  margin-top: 0.5rem;
}

.btn {
  display: inline-block;
  padding: 1rem 2rem;
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--navy);
  background: transparent;
  color: var(--navy);
  cursor: pointer;
  transition: background 0.3s, color 0.3s, opacity 0.3s;
  font-family: var(--font-sans);
}

.btn:hover {
  background: var(--navy);
  color: #fff;
}

.btn-primary {
  background: var(--navy);
  color: #fff;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-white {
  border-color: #fff;
  color: #fff;
}

.btn-white:hover {
  background: #fff;
  color: var(--navy);
}

.menu-toggle {
  display: block;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--navy);
}

@media (min-width: 1024px) {
  .menu-toggle {
    display: none;
  }

  .nav-mobile {
    display: none;
  }
}

.nav-mobile {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #fff;
  padding: 6rem 1.5rem 2rem;
  flex-direction: column;
  gap: 1.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-20px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.nav-mobile.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-mobile a {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.6;
}

.nav-mobile a.active {
  opacity: 1;
}

/* Footer */
.site-footer {
  background: var(--navy);
  color: #fff;
  padding: 5rem 1.5rem 2rem;
}

.site-footer .grid {
  max-width: 80rem;
  margin: 0 auto 4rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 768px) {
  .site-footer .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.site-footer .logo img {
  filter: brightness(0) invert(1);
  height: 7rem;
  margin-bottom: 1.5rem;
}

.site-footer .tagline {
  font-size: 0.875rem;
  opacity: 0.7;
  max-width: 18rem;
}

.site-footer a {
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.site-footer a:hover {
  opacity: 1;
}

.site-footer .copyright {
  max-width: 80rem;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  opacity: 0.5;
}

.site-footer .site-version {
  max-width: 80rem;
  margin: 0.5rem auto 0;
  text-align: center;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  opacity: 0.4;
}

/* Hero */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
  color: #fff;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(44, 62, 80, 0.45);
  mix-blend-mode: multiply;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 64rem;
  padding: 0 1.5rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 8vw, 5rem);
  letter-spacing: 0.1em;
  margin: 0 0 2rem;
}

.hero p {
  font-size: clamp(1.125rem, 2vw, 1.25rem);
  max-width: 36rem;
  margin: 0 auto 3rem;
}

/* Sections */
.section {
  padding: 6rem 1.5rem;
}

.section-white {
  background: #fff;
}

.section-warm {
  background: var(--warm-white);
}

.section-grey {
  background: var(--stone-grey);
}

.section-navy {
  background: var(--navy);
  color: #fff;
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.5rem);
  text-align: center;
  margin: 0 0 3rem;
}

.eyebrow {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 1.5rem;
}

.divider {
  width: 100%;
  height: 1px;
  background: rgba(44, 62, 80, 0.2);
  margin: 2rem 0;
}

.prose {
  font-size: 1.125rem;
  line-height: 1.8;
}

.prose p {
  margin: 0 0 1.5rem;
  opacity: 0.9;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose h2 {
  font-size: 1.875rem;
  margin: 4rem 0 1.5rem;
}

.prose h3 {
  font-size: 1.5rem;
  margin: 2.5rem 0 1rem;
}

.prose ul {
  margin: 0 0 1.5rem;
  padding-left: 1.5rem;
}

.prose ul li {
  margin-bottom: 0.75rem;
}

.prose em {
  font-style: italic;
}

.prose strong,
.library-document-prose strong {
  font-weight: 600;
  opacity: 1;
}

/* Library document bodies: flush left and right edges (book-like measure) */
.library-document-prose {
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.library-document-prose h1,
.library-document-prose h2,
.library-document-prose h3,
.library-document-prose h4 {
  text-align: left;
  hyphens: none;
  -webkit-hyphens: none;
}

/* Markdown / HTML tables inside library prose */
.prose .table-scroll,
.library-document-prose .table-scroll {
  width: 100%;
  max-width: 100%;
  margin: 0 0 1.75rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.prose table,
.library-document-prose table {
  width: 100%;
  min-width: 36rem;
  margin: 0;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 0.98rem;
  line-height: 1.55;
  text-align: left;
  hyphens: none;
  -webkit-hyphens: none;
}

.prose thead th,
.library-document-prose thead th {
  padding: 0.75rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(44, 62, 80, 0.7);
  background: var(--stone-grey);
  border-bottom: 1px solid rgba(44, 62, 80, 0.14);
  vertical-align: bottom;
}

.prose tbody td,
.library-document-prose tbody td {
  padding: 0.9rem 1rem;
  vertical-align: top;
  border-bottom: 1px solid rgba(44, 62, 80, 0.1);
  opacity: 1;
}

.prose tbody tr:last-child td,
.library-document-prose tbody tr:last-child td {
  border-bottom: none;
}

.prose tbody tr:nth-child(even) td,
.library-document-prose tbody tr:nth-child(even) td {
  background: rgba(44, 62, 80, 0.03);
}

/* Three column grid */
.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
}

@media (min-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
  }

  .grid-3 > div {
    padding: 0 3rem;
  }

  .grid-3 > div:not(:last-child) {
    border-right: 1px solid rgba(44, 62, 80, 0.1);
  }
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.card {
  border: 1px solid var(--navy);
  background: #fff;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 280px;
}

.card h3 {
  font-size: 1.875rem;
  margin: 0 0 1rem;
}

.card .amount {
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.6;
  font-family: var(--font-sans);
}

/* Library search */
.library-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem 2rem;
  max-width: 36rem;
  margin: 0 0 3rem;
  padding: 0;
}

.library-stats > div {
  margin: 0;
}

.library-stats dt {
  margin: 0 0 0.35rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--navy) 55%, transparent);
}

.library-stats dd {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--navy);
}

@media (max-width: 520px) {
  .library-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    max-width: none;
  }

  .library-stats dd {
    font-size: 1.75rem;
  }
}

.library-search {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 2rem;
  max-width: 36rem;
}

.library-search-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.6;
}

.library-search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-family: var(--font-sans);
  color: var(--navy);
  background: #fff;
  border: 1px solid rgba(44, 62, 80, 0.2);
  outline: none;
  transition: border-color 0.2s;
}

.library-search-input::placeholder {
  opacity: 0.45;
}

.library-search-input:hover,
.library-search-input:focus {
  border-color: var(--navy);
}

/* Library filters (collapsible; closed by default) */
.library-filters-panel {
  margin-bottom: 4rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(44, 62, 80, 0.1);
}

.library-filters-panel[hidden] {
  display: none;
}

.library-filters-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  opacity: 0.7;
  user-select: none;
}

.library-filters-summary::-webkit-details-marker {
  display: none;
}

.library-filters-summary::before {
  content: "▸";
  display: inline-block;
  transition: transform 0.15s ease;
  opacity: 0.7;
}

.library-filters-panel[open] > .library-filters-summary::before {
  transform: rotate(90deg);
}

.library-filters-panel[open] > .library-filters-summary {
  margin-bottom: 1.25rem;
  opacity: 0.85;
}

.library-filters {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .library-filters {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2rem 3rem;
  }
}

.library-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.library-filter-label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.6;
}

.library-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.library-filter-btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border: 1px solid rgba(44, 62, 80, 0.2);
  background: transparent;
  color: var(--navy);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  font-family: var(--font-sans);
}

.library-filter-btn:hover {
  border-color: var(--navy);
}

.library-filter-btn.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.library-sections {
  display: flex;
  flex-direction: column;
  gap: 6rem;
}

.library-section-title {
  font-size: 1.875rem;
  margin: 0 0 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(44, 62, 80, 0.1);
}

.library-empty {
  text-align: center;
  padding: 4rem 0;
}

.library-empty h3 {
  font-size: 1.875rem;
  margin: 0 0 1rem;
}

.library-empty p {
  opacity: 0.6;
  margin: 0;
}

.library-card[hidden] {
  display: none;
}

.library-card-locked {
  opacity: 0.65;
  border-style: dashed;
}

.library-card-locked:hover {
  border-color: rgba(44, 62, 80, 0.2);
}

.library-locked-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  opacity: 0.6;
}

.library-visibility-label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  opacity: 0.7;
  margin-right: 0.5rem;
}

.library-visibility-label.is-public {
  opacity: 0.55;
}

.library-visibility-label.is-internal {
  opacity: 0.85;
}

/* Collection intro: same measure and justification as a document, centered in the wide grid */
.library-collection-lead {
  max-width: 48rem;
  margin: 0 auto 3rem;
}

/* Library cards */
.library-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .library-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .library-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.library-card {
  border: 1px solid rgba(44, 62, 80, 0.2);
  padding: 2rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s;
}

.library-card:hover {
  border-color: var(--navy);
}

.library-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.library-card-kind {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  opacity: 0.55;
}

.library-card .format {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0;
  opacity: 0.6;
}

.format-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.library-card-collection {
  flex: 0 !important;
  font-family: var(--font-sans);
  font-size: 0.7rem !important;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  opacity: 0.55 !important;
  margin: 0 0 0.5rem !important;
}

.library-card h3 {
  font-size: 1.5rem;
  margin: 0 0 0.75rem;
}

.library-card p {
  font-size: 0.875rem;
  opacity: 0.8;
  flex: 1;
  margin: 0 0 1.25rem;
}

.library-card-sections {
  flex: 0 !important;
  font-size: 0.75rem !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.55 !important;
  margin: -0.5rem 0 1.25rem !important;
}

.library-card-tags {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.library-card-tags li {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border: 1px solid rgba(44, 62, 80, 0.18);
  border-radius: 999px;
  opacity: 0.75;
}

.library-card .actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.library-card .link {
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
}

.library-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 2.5rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--navy);
  opacity: 0.85;
}

.library-pager[hidden] {
  display: none !important;
}

.library-pager .pager-status {
  margin-right: auto;
}

.library-pager .pager-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.library-pager .pager-page {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  opacity: 0.75;
}

.library-pager button {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 0.55rem 1rem;
  border: 1px solid rgba(44, 62, 80, 0.2);
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  transition: border-color 0.3s;
}

.library-pager button:hover:not(:disabled) {
  border-color: var(--navy);
}

.library-pager button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Document references (ISO 690 numeric list) */
.library-references {
  margin-top: 3.5rem;
  margin-bottom: 2.5rem;
}

.library-references-heading {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  margin: 0 0 1.25rem;
  opacity: 0.55;
}

.library-references-list {
  margin: 0;
  padding: 0 0 0 1.5rem;
  list-style: decimal;
  display: grid;
  gap: 0.85rem;
}

.library-references-list > li {
  font-size: 0.9375rem;
  line-height: 1.55;
  padding-left: 0.5rem;
  /* Clear fixed header (main uses 140px / 160px padding-top) + a little air */
  scroll-margin-top: 10.5rem;
}

@media (min-width: 768px) {
  .library-references-list > li {
    scroll-margin-top: 12rem;
  }
}

/* Inline [n] citations in library body prose → #ref-n */
a.library-cite {
  color: inherit;
  text-decoration: none;
  margin-left: 0.1em;
  opacity: 0.72;
}

a.library-cite:hover,
a.library-cite:focus-visible {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

a.library-cite sup {
  font-size: 0.7em;
  line-height: 0;
  font-weight: 500;
}

.library-references-citation {
  /* Hanging indent for wrapped citation lines */
  display: block;
  padding-left: 1.25rem;
  text-indent: -1.25rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.library-references-citation a {
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.library-references-note {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.875rem;
  opacity: 0.72;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Document record card (catalog citation) */
.library-doc-record-container {
  max-width: 56rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.library-doc-record-container .library-references + .library-doc-record {
  margin-top: 0;
}

.library-doc-record-wrap {
  background: var(--warm-white);
  padding: 0 0 4rem;
  margin-top: -3rem;
}

.library-doc-record-wrap .library-doc-record {
  margin-top: 0;
}

.library-doc-record {
  margin-top: 3.5rem;
  /* Keep long IDs/paths/labels inside the card border on narrow viewports */
  overflow-wrap: anywhere;
  min-width: 0;
}

@media (max-width: 639px) {
  .library-doc-record.library-card {
    padding: 1.25rem;
  }
}

.library-doc-record + .library-doc-record-admin {
  margin-top: 1.25rem;
}

.library-doc-record:hover {
  border-color: rgba(44, 62, 80, 0.2);
}

.library-doc-record-admin {
  border-style: dashed;
  border-color: rgba(44, 62, 80, 0.22);
  background: rgba(44, 62, 80, 0.02);
}

.library-doc-record-admin:hover {
  border-color: rgba(44, 62, 80, 0.35);
}

.library-doc-record-heading {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  margin: 0 0 1.25rem;
  opacity: 0.55;
}

.library-doc-record-admin .library-doc-record-heading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  opacity: 0.7;
}

.library-doc-record-admin-badge {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  padding: 0.15rem 0.45rem;
  border: 1px solid rgba(44, 62, 80, 0.28);
  border-radius: 999px;
  opacity: 0.85;
}

.library-doc-record-list {
  margin: 0;
  display: grid;
  gap: 0.65rem 2rem;
  min-width: 0;
}

@media (min-width: 640px) {
  .library-doc-record-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .library-doc-record-list > div:nth-child(-n+2) {
    grid-column: 1 / -1;
  }
}

.library-doc-record-list > div {
  display: grid;
  /* Stack label/value on narrow screens — Style Reference labels exceed a fixed dt column */
  grid-template-columns: minmax(0, 1fr);
  gap: 0.2rem;
  align-items: baseline;
  min-width: 0;
}

@media (min-width: 480px) {
  .library-doc-record-list > div {
    grid-template-columns: 8.5rem minmax(0, 1fr);
    gap: 0.75rem;
  }
}

.library-doc-record-list dt {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.55;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}

.library-doc-record-list dd {
  margin: 0;
  font-size: 0.875rem;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.library-doc-id,
.library-doc-path {
  text-decoration: none;
  display: inline-block;
  max-width: 100%;
  min-width: 0;
}

button.library-doc-id {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  max-width: 100%;
  min-width: 0;
}

.library-doc-id:hover,
.library-doc-path:hover {
  text-decoration: underline;
}

.library-doc-id.is-copied,
.library-doc-id.is-copied:hover {
  text-decoration: none;
  opacity: 0.7;
}

.library-doc-record-list code,
.library-doc-id code,
.library-doc-path code {
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  /* Allow wrap on narrow screens — long ULID / slug paths / tags overflow otherwise */
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.form-group label {
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
}

.form-group input,
.form-group textarea {
  padding: 0.75rem 1rem;
  border: 1px solid var(--navy);
  background: transparent;
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 1rem;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  box-shadow: 0 0 0 1px var(--navy);
}

.form-panel {
  background: var(--warm-white);
  border: 1px solid rgba(44, 62, 80, 0.1);
  padding: 3rem;
}

.subscribe-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 28rem;
  margin: 0 auto 2rem;
}

@media (min-width: 640px) {
  .subscribe-form {
    flex-direction: row;
  }
}

.subscribe-form input {
  flex: 1;
  padding: 1rem 1.5rem;
  border: 1px solid var(--navy);
  background: #fff;
  font-family: var(--font-sans);
  font-weight: 300;
}

/* Audio player */
.audio-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.play-btn {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  border: 1px solid rgba(44, 62, 80, 0.2);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s;
}

.play-btn:hover {
  border-color: var(--navy);
}

.play-btn svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* Page header */
.page-header {
  text-align: center;
  padding: 8rem 1.5rem 6rem;
}

.page-header h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  margin: 0 0 1.5rem;
}

.page-header .subtitle {
  font-size: 0.875rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.8;
}

/* Education comparison (library) — side-by-side tables */
.compare-intro {
  max-width: 40rem;
  margin: 0 auto 4rem;
  text-align: center;
}

.compare-intro h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  margin: 0 0 1.5rem;
}

.compare-intro .prose {
  margin: 0 auto;
}

.compare-tables {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  max-width: 56rem;
  margin: 0 auto;
}

.compare-table-wrap {
  margin: 0;
}

.compare-table-wrap figcaption {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.5vw, 1.875rem);
  font-weight: 500;
  text-align: center;
  margin: 0 0 1.25rem;
  letter-spacing: 0.02em;
}

.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.compare-table thead th {
  width: 50%;
  padding: 0.85rem 1.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: left;
  vertical-align: bottom;
  background: var(--stone-grey);
  border-bottom: 1px solid rgba(44, 62, 80, 0.12);
}

.compare-table thead th:first-child {
  border-radius: 2px 0 0 0;
  color: rgba(44, 62, 80, 0.65);
}

.compare-table thead th:last-child {
  border-radius: 0 2px 0 0;
  background: var(--navy);
  color: rgba(250, 250, 248, 0.85);
  border-bottom-color: transparent;
}

.compare-table tbody td {
  width: 50%;
  padding: 1.75rem 1.5rem;
  font-size: 1.05rem;
  line-height: 1.7;
  vertical-align: top;
  background: #fff;
  border-bottom: 1px solid rgba(44, 62, 80, 0.1);
}

.compare-table tbody td:first-child {
  color: rgba(44, 62, 80, 0.78);
  border-right: 1px solid rgba(44, 62, 80, 0.1);
  border-radius: 0 0 0 2px;
}

.compare-table tbody td:last-child {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  line-height: 1.55;
  background: rgba(44, 62, 80, 0.04);
  border-radius: 0 0 2px 0;
}

.compare-table tbody td strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--navy);
  opacity: 1;
}

.compare-table tbody td:last-child strong {
  font-size: 1.35rem;
}

.compare-example {
  display: block;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(44, 62, 80, 0.1);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.65;
  opacity: 0.85;
}

.compare-table tbody td:last-child .compare-example {
  border-top-color: rgba(44, 62, 80, 0.12);
  opacity: 0.9;
}

.compare-example-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  opacity: 0.55;
}

.compare-closing {
  max-width: 40rem;
  margin: 5rem auto 0;
  padding-top: 3rem;
  border-top: 1px solid rgba(44, 62, 80, 0.12);
  text-align: center;
}

.compare-closing h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin: 0 0 1rem;
}

.compare-closing .divider {
  margin: 0 auto 2rem;
}

.compare-closing .prose {
  text-align: left;
}

@media (max-width: 700px) {
  .compare-table,
  .compare-table thead,
  .compare-table tbody,
  .compare-table tr,
  .compare-table th,
  .compare-table td {
    display: block;
    width: 100%;
  }

  .compare-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
  }

  .compare-table tbody td {
    border-right: none;
    border-radius: 0;
  }

  .compare-table tbody td:first-child {
    border-bottom: none;
    padding-bottom: 1.25rem;
  }

  .compare-table tbody td:last-child {
    border-radius: 0 0 2px 2px;
  }

  .compare-table tbody td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 0.65rem;
    opacity: 0.55;
  }

  .compare-table tbody td:last-child::before {
    color: var(--navy);
    opacity: 0.7;
  }

  .compare-table tbody td strong {
    font-size: 1.2rem;
  }

  .compare-table tbody td:last-child strong {
    font-size: 1.25rem;
  }
}

/* Library breadcrumbs (collection context lives here, not above prev/next) */
.library-breadcrumbs {
  margin: 0 0 2.5rem;
}

.library-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.library-breadcrumbs li {
  display: inline-flex;
  align-items: center;
}

.library-breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin: 0 0.65rem;
  opacity: 0.4;
  speak: never;
}

.library-breadcrumbs a {
  color: inherit;
  text-decoration: none;
  opacity: 0.55;
  transition: opacity 0.25s ease;
}

.library-breadcrumbs a:hover {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.library-breadcrumbs:not(:has(li)) {
  display: none;
}

.library-doc-chrome {
  background: var(--warm-white);
  padding: 1.5rem 1.5rem 0;
}

.library-doc-chrome .library-breadcrumbs {
  margin-bottom: 0;
}

/* Collection series prev/next (catalog-driven; not body links) */
.library-series-nav {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(44, 62, 80, 0.12);
}

.library-series-nav-wrap {
  background: var(--warm-white);
  padding: 0 1.5rem 1rem;
}

.library-series-nav-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}

.library-series-nav-position {
  margin: 0;
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.45;
  order: -1;
}

@media (min-width: 640px) {
  .library-series-nav-links {
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    align-items: center;
  }

  .library-series-nav-position {
    order: 0;
  }
}

.library-series-nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  padding: 0.25rem 0;
  transition: opacity 0.25s ease;
}

.library-series-nav-link.is-empty {
  display: none;
}

@media (min-width: 640px) {
  .library-series-nav-link.is-empty {
    display: block;
    visibility: hidden;
    pointer-events: none;
  }
}

.library-series-nav-next {
  text-align: left;
}

@media (min-width: 640px) {
  .library-series-nav-next {
    text-align: right;
    align-items: flex-end;
  }
}

.library-series-nav-dir {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.55;
}

.library-series-nav-title {
  font-family: var(--font-display, "Cormorant Garamond", Georgia, serif);
  font-size: 1.15rem;
  line-height: 1.3;
}

.library-series-nav-link:hover .library-series-nav-dir,
.library-series-nav-link:hover .library-series-nav-title {
  opacity: 1;
}

.library-series-nav-link:hover .library-series-nav-title {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Evolution page */
.evolution-hero {
  min-height: 100vh;
  background: var(--dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.evolution-hero .bg {
  position: absolute;
  inset: 0;
  opacity: 0.4;
}

.evolution-hero .bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.evolution-hero .bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(20, 20, 20, 0.5), rgba(20, 20, 20, 0.8), var(--dark));
}

.evolution-hero .content {
  position: relative;
  z-index: 1;
  max-width: 56rem;
}

.evolution-hero h1 {
  font-size: clamp(3rem, 10vw, 5rem);
  margin: 0 0 2rem;
}

.chapter {
  padding: 6rem 1.5rem;
}

.chapter.dark {
  background: var(--dark);
  color: #fff;
}

.chapter.light {
  background: #fafafa;
  color: var(--dark);
}

.chapter-inner {
  max-width: 80rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .chapter-inner {
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
  }

  .chapter.reverse .chapter-inner {
    direction: rtl;
  }

  .chapter.reverse .chapter-inner > * {
    direction: ltr;
  }
}

.chapter .era {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.chapter .era::before {
  content: "";
  width: 3rem;
  height: 1px;
  background: currentColor;
  opacity: 0.3;
}

.chapter .era span {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.7;
}

.chapter h2 {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  margin: 0 0 1rem;
}

.chapter .subtitle {
  font-size: 1.25rem;
  font-weight: 300;
  opacity: 0.7;
  margin: 0 0 2.5rem;
}

.chapter-image {
  aspect-ratio: 4 / 5;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.chapter-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid currentColor;
  border-color: rgba(0, 0, 0, 0.1);
}

.chapter.dark .meta-grid {
  border-color: rgba(255, 255, 255, 0.1);
}

@media (min-width: 768px) {
  .meta-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.meta-grid .label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-bottom: 0.25rem;
}

.callout {
  padding: 1.5rem;
  border-radius: 0.75rem;
  margin-top: 2rem;
}

.chapter.light .callout {
  background: rgba(0, 0, 0, 0.05);
}

.chapter.dark .callout {
  background: rgba(255, 255, 255, 0.05);
}

.callout.danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.chapter.dark .callout.danger {
  color: #fca5a5;
}

/* Course syllabus */
.session-timeline {
  position: relative;
}

.session {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 0;
}

.session-num {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 0.875rem;
}

.session-num span {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid rgba(44, 62, 80, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  background: var(--warm-white);
}

.session-body {
  padding: 0.875rem 0 1.25rem;
  border-bottom: 1px solid rgba(44, 62, 80, 0.2);
  margin-bottom: 0.5rem;
}

.session:last-child .session-body {
  border-bottom: none;
}

.session h3 {
  font-size: 1rem;
  margin: 0 0 0.25rem;
}

.session .desc {
  font-size: 0.875rem;
  opacity: 0.7;
  margin: 0 0 0.625rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.tags span {
  font-size: 0.6875rem;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  background: rgba(44, 62, 80, 0.05);
  border: 1px solid rgba(44, 62, 80, 0.1);
  opacity: 0.6;
}

.outcomes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.625rem;
}

@media (min-width: 768px) {
  .outcomes-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.outcome {
  background: rgba(44, 62, 80, 0.05);
  border-radius: 0.5rem;
  padding: 0.75rem;
  font-size: 0.875rem;
  opacity: 0.7;
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
}

.outcome::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--navy);
  flex-shrink: 0;
  margin-top: 0.5rem;
}

.course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 1.25rem;
}

.course-meta dt {
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 0.125rem;
}

.course-meta dd {
  margin: 0;
  font-size: 0.875rem;
}

.text-center {
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Motion (matches original framer-motion fades)
   Hidden state has no transition (avoids paint→fade-out→fade-in jitter on nav).
   Transition runs only when .is-visible is applied by motion.js. */
@media (prefers-reduced-motion: no-preference) {
  .fade-motion {
    opacity: 0;
    transform: translateY(var(--fade-y, 20px));
  }

  .fade-motion.fade-scale {
    transform: scale(0.95);
  }

  .fade-motion.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition:
      opacity var(--fade-duration, 800ms) ease-out var(--fade-delay, 0ms),
      transform var(--fade-duration, 800ms) ease-out var(--fade-delay, 0ms);
  }

  .fade-motion.fade-scale.is-visible {
    transform: scale(1);
  }
}

.evolution-scroll-hint {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

@keyframes evolution-bounce {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(6px);
  }
}

.evolution-scroll-hint svg {
  animation: evolution-bounce 2s ease-in-out infinite;
}

/* Case study imagery */
.case-study-figure {
  margin: 0 0 2.5rem;
}

.prose .case-study-figure {
  margin: 2rem 0 2.5rem;
}

.case-study-figure img {
  width: 100%;
  height: auto;
  display: block;
}

.case-study-figure figcaption {
  font-size: 0.875rem;
  line-height: 1.5;
  opacity: 0.6;
  margin-top: 0.75rem;
}

.case-study-figures {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 2rem 0 2.5rem;
}

.case-study-figures .case-study-figure {
  margin: 0;
}

@media (min-width: 640px) {
  .case-study-figures {
    grid-template-columns: 1fr 1fr;
  }
}

/* About — founders portrait */
.founders-portrait {
  margin: 0 auto 5rem;
  max-width: 22rem;
  text-align: center;
}

.founders-portrait img {
  width: 100%;
  height: auto;
  display: block;
}

.founders-portrait figcaption {
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-top: 1rem;
}

/* Error pages (404, …) */
.error-page {
  text-align: center;
  padding: 4rem 0 8rem;
}

.error-page h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  margin: 0 0 1.5rem;
}

.error-page .prose {
  max-width: 32rem;
  margin: 0 auto 2.5rem;
}

.error-page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

/* Language switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.55rem;
}

.lang-switcher-link {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.55;
}

.lang-switcher-link:hover,
.lang-switcher-link.is-current {
  opacity: 1;
}

.lang-switcher-desktop {
  flex-shrink: 0;
  margin: 0;
  padding-inline-start: 0.85rem;
  border-inline-start: 1px solid rgba(44, 62, 80, 0.18);
}

.lang-switcher-mobile {
  margin-top: 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(44, 62, 80, 0.12);
  flex-wrap: wrap;
  gap: 1rem;
}

.lang-switcher-mobile .lang-switcher-link {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-transform: none;
}

.cookie-consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  padding: 1.25rem 1.5rem calc(1.25rem + env(safe-area-inset-bottom));
  background: var(--warm-white);
  border-top: 1px solid rgba(44, 62, 80, 0.2);
  box-shadow: 0 -8px 24px rgba(20, 20, 20, 0.06);
}

.cookie-consent-panel {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  align-items: flex-end;
  justify-content: space-between;
}

.cookie-consent-copy {
  flex: 1 1 20rem;
  max-width: 46rem;
}

.cookie-consent h2 {
  margin: 0 0 0.4rem;
  font-size: 1.5rem;
}

.cookie-consent p {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.cookie-consent p:last-child {
  margin-bottom: 0;
}

.cookie-consent a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.cookie-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.cookie-consent-btn {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--navy);
  background: transparent;
  color: var(--navy);
  cursor: pointer;
}

.cookie-consent-btn:hover,
.cookie-consent-btn:focus-visible {
  background: var(--navy);
  color: #fff;
}

.cookie-consent-btn[data-consent="granted"] {
  background: var(--navy);
  color: #fff;
  padding: 1rem 2rem;
  min-height: 3rem;
}

.cookie-consent-btn[data-consent="granted"]:hover,
.cookie-consent-btn[data-consent="granted"]:focus-visible {
  background: var(--navy);
  color: #fff;
  opacity: 0.9;
}

.library-card-translated {
  font-size: 0.85rem;
  opacity: 0.65;
  margin: 0.35rem 0 0;
}

.admin-lang-badge {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(44, 62, 80, 0.25);
  padding: 0.1rem 0.4rem;
  margin-inline-start: 0.4rem;
  vertical-align: middle;
}

/* RTL: logical flip; headings fall back to an RTL-capable serif */
[dir="rtl"] {
  --font-serif: "Cormorant Garamond", "Times New Roman", "David Libre", "Noto Serif Hebrew", serif;
}

[dir="rtl"] .nav-link::after {
  left: auto;
  right: 0;
}

[dir="rtl"] .library-series-nav-dir {
  unicode-bidi: isolate;
}
