.ref-hero {
  padding-block: clamp(116px, 11vw, 150px) clamp(38px, 5vw, 68px);
}

.ref-hero .eyebrow {
  margin-bottom: 16px;
}

.ref-hero .eyebrow a {
  text-decoration: none;
}

.ref-hero .eyebrow a:hover {
  text-decoration: underline;
}

.ref-hero h1 {
  max-width: none;
  overflow-wrap: anywhere;
}

.ref-hero .lead {
  max-width: 66ch;
  margin-top: 18px;
}

.ref-directory {
  padding-block: clamp(32px, 4.4vw, 64px);
  background: var(--soft);
}

.ref-layout {
  display: grid;
  grid-template-columns: minmax(230px, 265px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(24px, 3vw, 50px);
}

.ref-filters, .ref-card, .ref-empty {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
}

.ref-filters {
  display: grid;
  gap: 5px;
  padding: clamp(18px, 2vw, 26px);
}

.ref-directory [hidden] {
  display: none;
}

.ref-filters[hidden] + .ref-results {
  grid-column: 1 / -1;
}

.ref-filters h2 {
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.ref-filters label {
  display: block;
  font-size: .95rem;
  font-weight: 700;
  color: var(--b800);
  margin-top: 10px;
}

.ref-facets {
  margin-top: 8px;
}

.ref-facets summary {
  min-height: 44px;
  padding-block: 8px;
  color: var(--b700);
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
}

.ref-fields label {
  margin-bottom: 4px;
}

.ref-filters :is(input, select) {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--b400);
  border-radius: 6px;
  color: var(--ink);
  background-color: #fff;
  font: inherit;
  font-size: 1rem;
  line-height: 1.35;
}

.ref-filters select {
  appearance: none;
  padding-right: 32px;
  text-overflow: ellipsis;
  background-image: linear-gradient(45deg, transparent 50%, var(--b600) 50%),
    linear-gradient(135deg, var(--b600) 50%, transparent 50%);
  background-position: right 16px center, right 11px center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.ref-filters button {
  justify-self: start;
  padding: 6px 0;
  min-height: 44px;
  margin-top: 4px;
  border: 0;
  background: transparent;
  color: var(--b700);
  font: inherit;
  font-size: .95rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.ref-heading {
  margin-bottom: 20px;
}

.ref-heading h2 {
  font-size: clamp(1.65rem, 2.5vw, 2.2rem);
}

.ref-heading p {
  max-width: 64ch;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.ref-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}

.ref-card {
  min-width: 0;
  padding: clamp(18px, 2vw, 25px);
  overflow-wrap: anywhere;
}

.ref-card:target {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.ref-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 10px;
  font-size: .875rem;
  line-height: 1.4;
}

.ref-kind {
  font-weight: 700;
  color: var(--b700);
}

.ref-client {
  color: var(--muted);
  border-left: 1px solid var(--b200);
  padding-left: 10px;
}

.ref-card h3 {
  margin-top: 13px;
  font-size: clamp(1.25rem, 1.7vw, 1.55rem);
  line-height: 1.16;
  hyphens: auto;
}

.ref-summary {
  margin-top: 8px;
  line-height: 1.45;
}

.ref-area {
  display: inline-block;
  margin-top: 15px;
  padding: 3px 9px;
  border-radius: 4px;
  background: #eaf0f5;
  color: var(--b700);
  font-size: .875rem;
  line-height: 1.5;
}

.ref-card details {
  margin-top: 15px;
  border-top: 1px solid var(--line);
}

.ref-card summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding-top: 5px;
  color: var(--b700);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.ref-card summary::-webkit-details-marker {
  display: none;
}

.ref-card summary::after {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-right: 4px;
}

.ref-card details[open] summary::after {
  transform: rotate(225deg);
}

.ref-role {
  margin-top: 8px;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.4;
}

.ref-card ul {
  margin: 8px 0 0;
  padding-left: 20px;
  line-height: 1.45;
}

.ref-card li + li {
  margin-top: 5px;
}

.ref-empty {
  padding: clamp(22px, 3vw, 40px);
}

.ref-empty p {
  max-width: 54ch;
  margin-bottom: 16px;
}

.ref-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 25px;
  margin-top: 26px;
  color: var(--b700);
  font-weight: 700;
  text-underline-offset: 3px;
}

@media (min-width: 801px) and (min-height: 700px) {
  .ref-filters {
    position: sticky;
    top: 100px;
  }
}

@media (max-width: 1000px) {
  .ref-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .ref-layout {
    grid-template-columns: 1fr;
  }

  .ref-filters {
    padding-block: 16px;
  }

  .ref-facets {
    margin-top: 2px;
  }

  .ref-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
    gap: 0 14px;
  }
}
