/* Bibliothek search, results, reader, and comparison layout. */
.library-page {
  --library-background: rgba(255, 255, 255, 0.42);
  --library-panel: #fff;
  --library-muted: rgba(131, 121, 109, 0.72);
  --library-soft-border: rgba(131, 121, 109, 0.42);
  box-sizing: border-box;
  margin: 0 auto;
  max-width: 100rem;
  padding: clamp(2rem, 4vw, 4.5rem) 0 clamp(3rem, 6vw, 6rem);
  width: 100%;
}

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

.library-page button,
.library-page input,
.library-page select,
.library-page summary {
  color: inherit;
  font: inherit;
}

.library-page button,
.library-page summary,
.library-page label:has(input[type="checkbox"]) {
  cursor: pointer;
}

.library-page button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.library-page :focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

.library-filters {
  background: var(--library-background);
  border: 1px solid var(--color-border);
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  padding: clamp(1rem, 2vw, 1.5rem);
  position: relative;
  z-index: 5;
}

.library-search-row {
  align-items: start;
  display: grid;
  grid-template-columns: minmax(0, 19.8rem) 12rem auto;
  justify-content: start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.library-search-row .library-field {
  min-width: 0;
  max-width: none;
  width: 100%;
}

.library-search-row input:placeholder-shown {
  text-align: left;
}

.library-search-row select,
.library-search-options select {
  background: var(--library-panel);
  border: 1px solid var(--library-soft-border);
  border-radius: 0;
  font-size: 0.86rem;
  min-height: 2.75rem;
  padding: 0.55rem 0.65rem;
  max-width: 100%;
}

.library-search-select {
  position: relative;
}

.library-search-select select {
  appearance: none;
  cursor: pointer;
  display: block;
  padding-right: 2rem;
  width: 100%;
}

.library-search-select::after {
  pointer-events: none;
}

.library-search-mode__label {
  align-items: center;
  background: var(--library-panel);
  display: flex;
  font-size: 0.86rem;
  inset: 1px 2rem 1px 1px;
  padding: 0.55rem 0.65rem;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.library-search-select:has(select:open)::after {
  content: "−";
}

.library-search-options {
  margin-bottom: 1rem;
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  min-width: 0;
  font-size: 0.86rem;
}

.library-search-check {
  align-items: flex-start;
  display: flex;
  gap: 0.5rem;
}

.library-search-check input {
  accent-color: var(--color-primary);
  flex: 0 0 auto;
  height: 1.05rem;
  width: 1.05rem;
  margin: calc((1.45em - 1.05rem) / 2) 0 0;
}

.library-filters-toggle[hidden],
#library-filter-body[hidden],
#library-filter-settings[hidden] {
  display: none;
}

@media (max-width: 782px) {
  .library-search-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .library-search-row .library-field {
    grid-column: 1 / -1;
  }
}

.library-filters__heading-row,
.library-panel-header,
.library-filter-footer,
.library-comparison__heading-row,
.library-comparison {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.library-filters__heading-row {
  margin-bottom: 1.25rem;
}

.library-filters h2,
.library-results h2,
.library-reader h2,
.library-comparison h2 {
  font-size: 1.35rem;
  line-height: 1.15;
  margin: 0;
}

.library-filter-grid {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.library-field,
.library-filter-menu {
  flex: 1 1 8rem;
  max-width: 10.5rem;
  min-width: 8rem;
}

.library-field--keyword {
  flex-basis: 16rem;
  max-width: 18rem;
  min-width: min(16rem, 100%);
}

.library-filter-menu--formal {
  flex-basis: 11rem;
  max-width: 13.5rem;
}

.library-filter-menu--category {
  flex-basis: 10rem;
  min-width: 9.5rem;
}

.library-filter-body > .library-filter-menu--category {
  margin-bottom: 1rem;
}

.library-filter-menu--collection {
  flex-basis: 11rem;
  max-width: 13.5rem;
}

.library-field--comments {
  flex-basis: 13.5rem;
  max-width: 15rem;
  min-width: min(13.5rem, 100%);
}

.library-filter-menu__search > span,
.library-filter-menu__panel--dates label > span {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.045em;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.library-field input,
.library-filter-menu__panel input[type="search"],
.library-filter-menu__panel input[type="date"] {
  background: var(--library-panel);
  border: 1px solid var(--library-soft-border);
  border-radius: 0;
  font-size: 0.86rem;
  min-height: 2.75rem;
  padding: 0.55rem 0.65rem;
  width: 100%;
}

.library-filter-menu input::placeholder {
  color: var(--library-muted);
  opacity: 1;
}

.library-field input::placeholder {
  color: inherit;
  opacity: 1;
}

.library-field input:placeholder-shown {
  text-align: center;
}

.library-filter-menu {
  align-self: end;
  position: relative;
}

.library-filter-toggle,
.library-filter-menu > summary {
  align-items: center;
  background: var(--library-panel);
  border: 1px solid var(--library-soft-border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.4rem 2rem 0.4rem 0.6rem;
  position: relative;
}

.library-filter-menu--category > summary {
  padding-left: 0.9rem;
}

.library-field input,
.library-search-select select,
.library-filter-toggle > span:first-child,
.library-filter-menu > summary > span:first-child {
  font-size: 0.82rem;
  line-height: 1.15;
}

.library-filter-toggle > span:first-child,
.library-filter-menu > summary > span:first-child {
  white-space: nowrap;
}

.library-filter-menu > summary::-webkit-details-marker {
  display: none;
}

.library-search-select::after,
.library-filter-toggle::after,
.library-filter-menu > summary::after {
  content: "+";
  font-size: 1.35rem;
  font-weight: 350;
  line-height: 1;
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
}

.library-filter-toggle[aria-expanded="true"]::after,
.library-filter-menu[open] > summary::after {
  content: "−";
}

.library-filter-menu__value {
  color: var(--library-muted);
  font-size: 0.75rem;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-filter-menu__panel {
  background: var(--library-panel);
  border: 1px solid var(--color-border);
  box-shadow: 0 1rem 2.5rem rgba(72, 65, 57, 0.15);
  left: 0;
  margin-top: 0.4rem;
  max-height: min(28rem, 60vh);
  max-width: min(30rem, calc(100vw - 2rem));
  min-width: min(22rem, calc(100vw - 2rem));
  overflow-y: auto;
  padding: 1rem;
  position: absolute;
  top: 100%;
  width: min(24rem, calc(100vw - 2rem));
  z-index: 10;
}

.library-filter-menu.is-aligned-right .library-filter-menu__panel {
  left: auto;
  right: 0;
}

.library-filter-menu--collection .library-filter-menu__panel {
  min-width: min(28rem, calc(100vw - 2rem));
}

.library-filter-menu__panel--dates {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(8rem, 1fr));
}

.library-option-group {
  border: 0;
  display: grid;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
}

.library-filter-menu__search {
  display: block;
  margin-bottom: 0.75rem;
}

.library-option-group label {
  align-items: flex-start;
  display: flex;
  gap: 0.65rem;
  line-height: 1.25;
  min-height: 2.65rem;
  padding: 0.4rem 0.5rem;
}

.library-option-group label:hover {
  background: var(--color-secondary-beige);
}

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

.library-topic-tree {
  list-style: none;
  margin: 0;
  padding: 0;
}

.library-topic-tree .library-topic-tree {
  padding-left: 1.25rem;
}

.library-topic-tree li:has(> .library-topic-children) > label {
  min-height: 0;
  padding-bottom: 0;
}

.library-topic-children > summary {
  color: var(--library-muted);
  font-size: 0.8rem;
  list-style-position: inside;
  min-height: 1.5rem;
  padding: 0 0.5rem 0.2rem 2.2rem;
}

.library-option-group__empty {
  color: var(--library-muted);
  font-size: 0.85rem;
  margin: 0;
  padding: 0.75rem 0.5rem;
}

.library-option-group input {
  accent-color: var(--color-primary);
  flex-shrink: 0;
  height: 1.05rem;
  margin: calc((1.25em - 1.05rem) / 2) 0 0;
  width: 1.05rem;
}

.library-filter-menu__hint {
  border-top: 1px solid var(--library-soft-border);
  color: var(--library-muted);
  font-size: 0.8rem;
  margin: 0.75rem 0 0;
  padding-top: 0.75rem;
}

.library-filter-footer {
  border-top: 1px solid var(--library-soft-border);
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
}

.library-active-filters {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  min-width: 0;
}

.library-active-filters__label {
  font-size: 0.8rem;
  font-weight: 700;
}

.library-active-filters__empty {
  color: var(--library-muted);
  font-size: 0.85rem;
}

.library-active-filters__items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.library-active-filter {
  align-items: center;
  background: var(--library-panel);
  border: 1px solid var(--library-soft-border);
  color: inherit;
  display: inline-flex;
  font-size: 0.78rem;
  gap: 0.45rem;
  line-height: 1.2;
  padding: 0.35rem 0.5rem;
  text-decoration: none;
}

.library-active-filter:hover,
.library-active-filter:focus-visible {
  border-color: var(--color-primary);
}

.library-active-filter span {
  font-size: 1rem;
  line-height: 0.8;
}

.library-filter-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.5rem;
}

.library-button {
  align-items: center;
  border: 1px solid var(--color-primary);
  color: inherit;
  display: inline-flex;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0.55rem 1rem;
  text-decoration: none;
}

.library-page .library-button--primary {
  background: var(--color-primary);
  color: var(--color-secondary-beige);
}

.library-button--quiet {
  background: transparent;
}

.library-workspace {
  display: grid;
  grid-template-columns: minmax(19rem, 0.36fr) minmax(0, 0.64fr);
  height: clamp(44rem, 78vh, 68rem);
  min-height: 0;
}

.library-results,
.library-reader {
  background: var(--library-panel);
  border: 1px solid var(--color-border);
  min-height: 0;
  overflow: hidden;
}

.library-results {
  border-right: 0;
  display: flex;
  flex-direction: column;
}

.library-reader {
  display: flex;
  flex-direction: column;
}

.library-panel-header {
  border-bottom: 1px solid var(--library-soft-border);
  flex: 0 0 auto;
  gap: 1rem;
  height: 7rem;
  padding: 1rem 1.15rem;
}

.library-results__count {
  flex: 0 0 auto;
  font-size: 0.9rem;
  font-weight: 650;
  margin: 0;
}

.library-panel-header--results {
  align-items: center;
}

.library-results__summary {
  align-items: flex-start;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.library-results__sort {
  flex: 0 0 10rem;
  margin-left: auto;
}

.library-results__sort select {
  background: var(--library-panel);
  border: 1px solid var(--library-soft-border);
  font-size: 0.78rem;
  min-height: 2.25rem;
  padding: 0.35rem 1.8rem 0.35rem 0.55rem;
  width: 100%;
}

.library-panel-header--reader {
  flex-wrap: wrap;
  padding-left: clamp(1.25rem, 4vw, 3.75rem);
  padding-right: clamp(1.25rem, 4vw, 3.75rem);
  row-gap: 0.5rem;
}

.library-page .library-highlight-toggle {
  background: transparent;
  border: 1px solid var(--library-soft-border);
  font-size: 0.78rem;
  min-height: 2.25rem;
  padding: 0.35rem 0.55rem;
}

.library-result-list {
  flex: 1 1 auto;
  list-style: none;
  margin: 0;
  min-height: 0;
  overscroll-behavior: contain;
  overflow-y: auto;
  padding: 0;
  scrollbar-gutter: stable;
}

.library-result-list > li {
  border-bottom: 1px solid var(--library-soft-border);
  display: grid;
  gap: 0.45rem;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 0 0.8rem 0 0;
}

.library-result-list > .library-result-list__title-page {
  display: block;
  padding-right: 0;
}

.library-result-list__title-page .library-result__title {
  font-size: 1.2rem;
  font-weight: 700;
}

.library-result {
  background: transparent;
  border: 0;
  color: inherit;
  display: block;
  min-width: 0;
  padding: 0.7rem 1.15rem;
  text-align: left;
  text-decoration: none;
}

.library-result:hover,
.library-result:focus-visible {
  background: rgba(203, 184, 163, 0.18);
}

.library-result.is-selected {
  background: rgba(203, 184, 163, 0.24);
  box-shadow: inset 0.2rem 0 var(--color-primary);
}

.library-result__title,
.library-result__meta {
  display: block;
}

.library-result__title {
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.25;
}

.library-result__meta {
  color: var(--library-muted);
  font-size: 0.78rem;
  margin-top: 0.25rem;
}

.library-compare-toggle {
  align-items: center;
  align-self: center;
  display: flex;
  gap: 0.35rem;
  font-size: 0.72rem;
}

.library-compare-toggle input {
  accent-color: var(--color-primary);
  margin: 0;
}

.library-results__empty {
  color: var(--library-muted);
  margin: 0;
  padding: 2rem 1.15rem;
}

.library-pagination {
  align-items: center;
  border-top: 1px solid var(--library-soft-border);
  display: flex;
  flex: 0 0 auto;
  font-size: 0.8rem;
  justify-content: space-between;
  margin-top: auto;
  padding: 0.8rem 1.15rem;
}

.library-pagination a {
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0.25rem;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.library-pagination__disabled {
  color: var(--library-muted);
}

.library-reader__document {
  flex: 1;
  overflow-y: auto;
  padding: clamp(1.75rem, 4vw, 3.75rem) clamp(1.25rem, 4vw, 3.75rem) clamp(3rem, 6vw, 5rem);
}

.library-reader__document-header,
.library-reader__content,
.library-reader__collections,
.library-reader__title-page {
  max-width: 52rem;
}

.library-reader__document-header {
  border-top: 1px solid var(--library-soft-border);
  margin-top: 1rem;
  padding-top: 1rem;
}

.library-reader__metadata {
  display: grid;
  font-size: 0.82rem;
  gap: 0.75rem;
  line-height: 1.35;
  margin: 0;
  padding: 0;
}

.library-reader__metadata dt {
  font-weight: 700;
  margin: 0;
}

.library-reader__metadata dd {
  margin: 0.2rem 0 0;
}

.library-search-highlight {
  background: #e6e4e1;
  color: inherit;
}

.library-reader__content.has-hidden-highlights .library-search-highlight {
  background: transparent;
  color: inherit;
}

.library-reader__content + .library-reader__collections,
.library-reader__content + .library-reader__document-header {
  margin-top: clamp(9rem, 21.6vw, 14.4rem);
}

.library-reader__title-page-text {
  font-size: clamp(1.08rem, 1.6vw, 1.2rem);
  line-height: 1.65;
}

.library-reader__title-page-text > :first-child {
  margin-top: 0;
}

.library-reader__title-page-images {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  margin-top: clamp(2rem, 5vw, 3.5rem);
}

.library-reader__title-page-images figure {
  margin: 0;
}

.library-reader__title-page-images img {
  display: block;
  height: auto;
  width: 100%;
}

.library-reader__empty {
  color: var(--library-muted);
  font-size: clamp(1.08rem, 1.6vw, 1.2rem);
  line-height: 1.65;
  margin: 0;
  max-width: 52rem;
}

.library-reader__collections {
  font-size: 0.9rem;
  line-height: 1.5;
}

.library-reader__collections p {
  margin: 0.5rem 0 0;
}

.library-reader__collections p:first-child {
  margin-top: 0;
}

.library-reader__collections a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.library-reader__content strong {
  font-size: inherit;
}

.library-reader__content > :first-child {
  margin-top: 0;
}

.library-reader__content > :last-child {
  margin-bottom: 0;
}

.library-page .library-compare-toggle,
.library-page .library-comparison {
  display: none;
}

.library-comparison {
  background: var(--color-secondary-beige);
  border: 1px solid var(--color-border);
  border-top: 0;
  gap: 0.35rem;
  grid-template-columns: minmax(0, 1fr);
  padding: 0.65rem 1.15rem;
}

.library-comparison__heading-row {
  gap: 0.75rem;
}

.library-comparison__status {
  color: var(--library-muted);
  font-size: 0.85rem;
  margin: 0;
}

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

.library-comparison__slot {
  align-items: center;
  border: 1px solid var(--library-soft-border);
  display: flex;
  font-size: 0.85rem;
  gap: 0.5rem;
  min-height: 2.5rem;
  min-width: 0;
  padding: 0.2rem 0.5rem;
}

.library-comparison__slot [data-library-compare-title] {
  flex: 1;
  overflow-wrap: anywhere;
}

.library-comparison__slot.is-filled {
  background: var(--library-panel);
  border-color: var(--color-primary);
}

.library-comparison__slot button {
  background: transparent;
  border: 1px solid var(--library-soft-border);
  flex: 0 0 auto;
  font-size: 1.2rem;
  min-height: 2rem;
  min-width: 2rem;
  padding: 0.1rem 0.4rem;
}

.has-comparison-selection .library-compare-toggle {
  font-weight: 700;
}

body.library-comparison-open {
  overflow: hidden;
}

#library-comparison-view {
  background: var(--color-secondary-beige);
  border: 0;
  color: inherit;
  height: 100dvh;
  inset: 0;
  margin: 0;
  max-height: none;
  max-width: none;
  padding: 1rem;
  position: fixed;
  width: 100%;
}

#library-comparison-view[open] {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#library-comparison-view::backdrop {
  background: var(--color-secondary-beige);
}

.library-comparison-view__header {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 1rem;
  justify-content: space-between;
}

.library-comparison-view__header h2,
.library-comparison-card__header h3 {
  margin: 0;
}

#library-comparison-view-heading {
  outline: none;
}

.library-comparison-grid {
  display: grid;
  flex: 1;
  gap: 1rem;
  grid-auto-rows: minmax(0, 1fr);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 0;
}

[data-library-compare-card] {
  background: var(--library-panel);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.library-comparison-card__header {
  align-items: center;
  border-bottom: 1px solid var(--library-soft-border);
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: space-between;
  padding: 0.75rem 1rem;
}

.library-comparison-card__moves {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.library-comparison-card__moves button {
  background: transparent;
  border: 1px solid var(--library-soft-border);
  font-size: 0.8rem;
  min-height: 2rem;
  padding: 0.25rem 0.5rem;
}

.library-comparison-text {
  flex: 1;
  max-width: none;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 1.5rem;
  scrollbar-gutter: stable;
}

@media (min-width: 783px) and (hover: hover) and (pointer: fine) {
  .library-page.library-comparison-enabled .library-compare-toggle {
    display: flex;
  }

  .library-page.library-comparison-enabled .library-comparison {
    display: grid;
  }
}

@media (max-width: 1180px) {
  .library-workspace {
    grid-template-columns: minmax(17rem, 0.4fr) minmax(0, 0.6fr);
  }
}

@media (min-width: 783px) and (max-width: 1000px) {
  .library-panel-header {
    height: 10rem;
  }

  .library-panel-header--results {
    flex-wrap: wrap;
  }

  .library-results__summary {
    flex-basis: 100%;
  }
}

@media (max-width: 782px) {
  .library-page {
    padding-top: 1.75rem;
  }

  .library-filters {
    padding: 1rem;
  }

  .library-filter-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .library-field,
  .library-filter-menu {
    max-width: none;
    min-width: 0;
  }

  .library-filter-menu__panel,
  .library-filter-menu--category .library-filter-menu__panel,
  .library-filter-menu--formal .library-filter-menu__panel,
  .library-filter-menu--textart .library-filter-menu__panel,
  .library-filter-menu--collection .library-filter-menu__panel,
  .library-filter-menu--classifications .library-filter-menu__panel,
  .library-filter-menu--visibility .library-filter-menu__panel {
    box-shadow: none;
    left: auto;
    margin-top: 0;
    max-height: none;
    min-width: 0;
    position: static;
    right: auto;
    width: 100%;
  }

  .library-filter-toggle,
  .library-filter-menu > summary {
    align-items: flex-start;
  }

  .library-filter-toggle > span:first-child,
  .library-filter-menu > summary > span:first-child {
    white-space: normal;
  }

  .library-filter-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .library-filter-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .library-workspace {
    display: block;
    height: auto;
    min-height: 0;
  }

  .library-results,
  .library-reader {
    min-height: 31rem;
  }

  .library-results {
    border-right: 1px solid var(--color-border);
    height: clamp(36rem, 80vh, 48rem);
  }

  .library-reader {
    border-top: 0;
  }

  .library-panel-header {
    height: auto;
    min-height: 5.5rem;
  }

}

@media (max-width: 480px) {
  .library-page {
    padding-left: 0.3rem;
    padding-right: 0.3rem;
  }

  .library-filters__heading-row,
  .library-panel-header {
    align-items: flex-start;
  }

  .library-panel-header--results {
    flex-wrap: wrap;
  }

  .library-results__summary {
    flex-basis: 100%;
  }

  .library-filters h2,
  .library-results h2,
  .library-reader h2,
  .library-comparison h2 {
    font-size: 1.15rem;
  }

  .library-result-list > li {
    display: block;
    padding: 0;
  }

  .library-result {
    width: 100%;
  }

  .library-result-list > li:not(.library-result-list__title-page) .library-result {
    padding-bottom: 0.35rem;
  }

  .library-compare-toggle {
    padding: 0 1.15rem 0.6rem;
  }

}

@media (max-width: 600px) and (orientation: portrait) {
  .library-filters__heading-row {
    align-items: stretch;
    flex-direction: column;
    gap: 0.75rem;
  }

  .library-field--keyword input:placeholder-shown,
  .library-field--comments input:placeholder-shown {
    text-align: left;
  }

  .library-results {
    height: auto;
    min-height: 0;
  }

  .library-result-list {
    flex: 0 0 auto;
    overflow-y: visible;
    overscroll-behavior: auto;
    scrollbar-gutter: auto;
  }
}

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

.library-access-gate {
  box-sizing: border-box;
  margin: 0 auto;
  max-width: 50rem;
  padding: clamp(2rem, 7vw, 6rem) 1rem;
  width: 100%;
}

.library-access-gate__panel {
  background: #fff;
  border: 1px solid var(--color-border);
  padding: clamp(1.4rem, 4vw, 2.5rem);
}

.library-access-gate h1 {
  margin: 0 0 1.25rem;
}

.library-access-gate p:last-child {
  margin-bottom: 0;
}

.library-access-gate .post-password-form {
  margin: 0;
}

.library-access-gate .post-password-form label {
  display: grid;
  gap: 0.45rem;
  margin: 1rem 0;
}

.library-access-gate .post-password-form input[type="password"] {
  border: 1px solid var(--color-border);
  box-sizing: border-box;
  font: inherit;
  max-width: 24rem;
  padding: 0.7rem 0.8rem;
  width: 100%;
}

.library-access-gate .post-password-form input[type="submit"] {
  background: var(--color-primary);
  border: 1px solid var(--color-primary);
  color: var(--color-secondary-beige);
  cursor: pointer;
  font: inherit;
  padding: 0.7rem 1rem;
}
