/* Library search and PDF viewer. Colors follow the active theme and skin. */
.lib-search,
.lib-find {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}
.lib-search .form-control,
.lib-find .form-control {
  flex: 1 1 220px;
  min-width: 0;
}
.lib-search-label {
  flex: 1 0 100%;
  margin: 0;
  color: var(--usl-heading, #fff);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
}
.lib-search .custom-select {
  flex: 0 1 240px;
  max-width: 100%;
}
.lib-meta {
  color: var(--usl-muted, #8899aa);
  font-size: .92rem;
  margin: 4px 0;
}
.lib-notice {
  color: var(--usl-muted, #8899aa);
  font-size: .92rem;
}
.lib-notice a,
.lib-actions a,
.lib-pager a,
.lib-pages a {
  color: var(--usl-accent, #e94560);
}
.lib-results {
  list-style: none;
  margin: 0;
  padding: 0;
}
.lib-results li {
  border-top: 1px solid var(--usl-border, rgba(255, 255, 255, .08));
  padding: 14px 0;
}
.lib-results a {
  color: var(--usl-heading, #fff);
  font-weight: 600;
  text-decoration: none;
}
.lib-results a:hover {
  color: var(--usl-accent, #e94560);
  text-decoration: underline;
}
.lib-snippet mark,
.lib-results mark {
  background: #f5d76e;
  color: #1a1a2e;
  padding: 0 .15em;
}
.lib-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.lib-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
}
.lib-toolbar button {
  background: transparent;
  color: var(--usl-heading, #fff);
  border: 1px solid var(--usl-border-2, rgba(255, 255, 255, .3));
  border-radius: 6px;
  padding: 4px 10px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
}
.lib-toolbar input[type="number"] {
  width: 4.5rem;
  margin: 0 4px;
}
.lib-pager {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 8px;
}
.lib-stage-wrap {
  overflow: auto;
  background: #3a3f46;
  border-radius: 8px;
  padding: 12px;
}
.lib-stage {
  position: relative;
  margin: 0 auto;
  width: fit-content;
  max-width: 100%;
}
.lib-stage canvas {
  display: block;
}
#lib-highlights {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
}
.lib-hl {
  position: absolute;
  background: rgba(255, 214, 0, .45);
  border-radius: 2px;
}
.lib-hl.current {
  outline: 2px solid #e94560;
  background: rgba(255, 214, 0, .75);
}
.usl-landing.usl-landing-wide {
  max-width: 1100px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.lib-topics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  grid-auto-rows: auto;
  align-items: start;
  gap: 12px;
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}
.lib-topics > li {
  min-width: 0;
  height: auto;
}
.lib-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: auto;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--usl-border, rgba(255, 255, 255, .12));
  border-radius: 10px;
  background: rgba(255, 255, 255, .03);
  color: var(--usl-heading, #fff);
}
.lib-tile-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.lib-tile-head:hover {
  color: inherit;
  text-decoration: none;
}
.lib-tile-head:hover .lib-tile-name {
  color: var(--usl-accent, #e94560);
}
.lib-tile-name {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--usl-heading, #fff);
  overflow-wrap: anywhere;
}
.lib-tile-count,
.lib-tile-desc,
.lib-tile-docs,
.lib-tile-more {
  color: var(--usl-muted, #8899aa);
  font-size: .92rem;
}
.lib-tile-desc {
  overflow-wrap: anywhere;
}
.lib-tile-docs {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.lib-tile-docs li {
  margin: 0 0 4px;
}
.lib-tile-docs a,
.lib-tile-more {
  display: block;
  overflow-wrap: anywhere;
  color: var(--usl-accent, #e94560);
  text-decoration: none;
}
.lib-tile-docs a:hover,
.lib-tile-more:hover {
  text-decoration: underline;
}
.lib-tile-more {
  margin-top: 4px;
}
.lib-lead-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 20px;
  margin: 0 0 22px;
}
.lib-lead-row .lede {
  flex: 1 1 18rem;
  margin: 0;
}
.lib-essentials {
  flex: 0 0 auto;
  margin: 0;
}
.lib-essentials a {
  display: inline-block;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .02em;
  color: var(--usl-accent, #e94560);
  text-decoration: none;
  border: 1px solid var(--usl-border-2, rgba(255, 255, 255, .3));
  border-radius: 999px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, .03);
}
.lib-essentials a:hover,
.lib-essentials a:focus {
  color: var(--usl-accent, #e94560);
  text-decoration: underline;
}
.lib-shelf,
.lib-series {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.lib-shelf li {
  flex: 1 1 240px;
  border: 1px solid var(--usl-border, rgba(255, 255, 255, .12));
  border-radius: 10px;
  padding: 12px 14px;
}
.lib-shelf a {
  color: var(--usl-heading, #fff);
  font-weight: 700;
  text-decoration: none;
}
.lib-shelf a:hover,
.lib-chip:hover {
  color: var(--usl-accent, #e94560);
}
.lib-chip {
  display: inline-block;
  margin: 0 6px 6px 0;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--usl-border-2, rgba(255, 255, 255, .3));
  color: var(--usl-accent, #e94560);
  text-decoration: none;
  font-size: .92rem;
}
.lib-chips,
.lib-doc-topics {
  margin: 0 0 12px;
}
.lib-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0 0 12px;
  color: var(--usl-muted, #8899aa);
  font-size: .92rem;
}
.lib-crumbs a,
.lib-sort a {
  color: var(--usl-accent, #e94560);
}
.lib-sort {
  color: var(--usl-muted, #8899aa);
}
@media (max-width: 640px) {
  .lib-topics {
    grid-template-columns: 1fr;
  }
  .lib-search .custom-select,
  .lib-search .btn {
    flex: 1 1 100%;
  }
}
