.source-layout { white-space: pre; overflow-x: auto; padding: 1rem; background: hsl(var(--muted)); line-height: 1.65; max-width: 100%; }
.source-layout:focus { outline: 2px solid currentColor; }
.source-locators { columns: 18rem; }
.source-locators li { break-inside: avoid; margin-bottom: .5rem; }
.source-page-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(6rem,1fr)); gap: .5rem; }
.source-page-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.source-citation, article code { overflow-wrap: anywhere; }
article details img { max-width: 100%; height: auto; }
/* Both directory generators use these stable form IDs. Native selects have a
   long intrinsic width; let every field shrink inside the reading column. */
#source-search, #source-library-search {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: .7rem;
  min-width: 0; margin: 2rem 0 1rem;
}
#source-search label, #source-library-search label {
  display: block; min-width: 0; font-size: 14px; font-weight: 550;
  overflow-wrap: anywhere;
}
#source-search input[type="search"], #source-search select,
#source-library-search input[type="search"], #source-library-search select {
  display: block; box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%;
  min-height: 44px; padding: 10px 12px;
  border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--background)); color: hsl(var(--foreground)); font: 16px var(--sans);
}
#source-library-search label > input[type="search"], #source-library-search label > select { margin-top: 6px; }
#source-search input[type="checkbox"], #source-library-search input[type="checkbox"] {
  width: auto; margin: 0 .4rem 0 0; accent-color: hsl(var(--foreground));
}
#source-search button, #source-library-search button {
  justify-self: start; max-width: 100%; min-height: 44px; padding: 8px 16px;
  border: 1px solid hsl(var(--foreground)); border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--foreground)); color: hsl(var(--background)); font: 500 14px var(--sans);
  white-space: normal; cursor: pointer;
}
.static main > .panel + .panel { margin-top: 16px; }
#source-results li { margin: 1rem 0; }
