/* header */
.site-header {
  background: var(--page);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  min-height: calc(var(--header-h) - 1px); /* wraps only when the nav can't fit (below ~360px) */
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 12px;
  padding-block: 10px;
}
.wordmark {
  font-size: 20px;
  font-weight: 800; letter-spacing: -0.02em; line-height: 1;
  color: var(--ink); text-decoration: none;
}
.site-nav { display: flex; align-items: center; padding-top: 3px; margin-inline: -5px; }
.site-nav a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 5px;
  font-size: 14px; font-weight: 500; line-height: 1;
  color: var(--ink); text-decoration: none;
  border-radius: var(--r-control);
}
.site-nav a:hover:not([aria-current]) { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.site-nav a[aria-current] { border-radius: 0; box-shadow: inset 0 -2px 0 var(--ink); }
.site-nav__label { display: none; }
@media (min-width: 640px) {
  .site-header__inner { column-gap: var(--s-5); }
  .wordmark { font-size: clamp(22px, calc(22px + 6 * var(--wide)), 28px); }
  .site-nav { margin-inline: 0; gap: clamp(20px, calc(20px + 8 * var(--wide)), 28px); }
  .site-nav a {
    padding: 8px clamp(10px, calc(10px + 6 * var(--wide)), 16px);
    font-size: clamp(16px, calc(16px + 5 * var(--wide)), 21px);
  }
  .site-nav__label { display: inline; }
  .site-nav__icon { display: none; }
}

/* footer */
.site-footer { margin-top: var(--s-9); padding-block: var(--s-7); background: var(--panel); font-size: var(--fs-small); }
.site-footer__inner { display: grid; gap: var(--s-5); }
.site-footer__inner > div p { margin-top: var(--s-2); color: var(--ink-2); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }
.site-footer nav a { display: inline-block; padding-block: 12px; margin-block: -12px; text-decoration: none; font-weight: 500; } /* 44px target, same layout */
.site-footer nav a:hover { text-decoration: underline; }
.site-footer .wordmark { font-size: 20px; }
.site-footer__note { color: var(--muted); max-width: 52ch; }
@media (min-width: 1024px) {
  .site-footer__inner { grid-template-columns: 1fr auto 1.2fr; align-items: start; gap: var(--s-7); }
  .site-footer__note { justify-self: end; }
}

/* photo door */
.door {
  position: relative; isolation: isolate;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start;
  gap: clamp(14px, calc(14px + 6 * var(--wide)), 20px);
  padding: clamp(20px, calc(20px + 8 * var(--wide)), 28px);
  padding-bottom: clamp(20px, calc(20px + 6 * var(--wide)), 26px);
  overflow: hidden;
  border-radius: var(--r-card);
  background: var(--ink);
  color: #fff; text-decoration: none;
}
.door > img {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--t-photo) var(--ease);
}
.door__scrim { position: absolute; inset: 0; z-index: -1; background: var(--scrim); }
.door__title {
  font-size: 26px;
  font-weight: 700; line-height: 1.1;
  color: #fff;
}
.door .btn {
  width: 100%;
  height: clamp(48px, calc(48px + 8 * var(--wide)), 56px);
  padding-inline: clamp(20px, calc(20px + 13 * var(--wide)), 33px);
  font-size: clamp(16px, calc(16px + 4.5 * var(--wide)), 20.5px);
}
@media (min-width: 640px) {
  .door__title { font-size: 24px; }
}
@media (min-width: 1024px) {
  .door__title { font-size: clamp(1.625rem, 1.436rem + .775vw, 2.25rem); }
  .door .btn { width: auto; }
}
.door:hover > img, .door:focus-visible > img { transform: scale(1.03); }
.door:hover .btn--primary, .door:focus-visible .btn--primary { background: var(--accent-hover); }
.door:hover .btn--on-photo, .door:focus-visible .btn--on-photo { background: var(--panel); }
.door:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* agent card */
.agent-card {
  position: relative; height: 100%;
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--page);
  border: 1px solid var(--line); border-radius: var(--r-card);
  transition: box-shadow var(--t-base) var(--ease), border-color var(--t-base) var(--ease);
}
.agent-card:hover { box-shadow: var(--shadow-hover); border-color: var(--line-strong); }
.agent-card__photo {
  width: 100%; height: auto;
  aspect-ratio: var(--agent-photo-ratio);
  object-fit: cover;
  transition: transform var(--t-photo) var(--ease);
}
.agent-card:hover .agent-card__photo { transform: scale(1.03); }
.agent-card .save { position: absolute; top: 12px; right: 12px; z-index: 1; }
.agent-card .save:focus-visible { outline-offset: 0; box-shadow: 0 0 0 4px #fff; } /* white halo keeps the ring visible on any photo */
.agent-card__body {
  display: flex; flex-direction: column; flex: 1;
  padding: 12px clamp(14px, calc(14px + 2 * var(--wide)), 16px);
}
.agent-card__name {
  font-size: clamp(17px, calc(17px + 2 * var(--wide)), 19px);
  font-weight: 600; line-height: 1.2;
}
.agent-card__name a { text-decoration: none; }
.agent-card__name a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.agent-card__name a:focus-visible { outline: none; }
.agent-card:has(.agent-card__name a:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.agent-card__headline {
  margin-top: 2px;
  font-size: clamp(15px, calc(15px + 2 * var(--wide)), 17px); font-weight: 400; line-height: 1.35;
  color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.agent-card__verified {
  display: flex; align-items: center; gap: 6px;
  margin-top: 8px;
  font-size: clamp(14px, calc(14px + 3 * var(--wide)), 17px); font-weight: 500; line-height: 1.4;
  color: var(--success);
}
.agent-card__verified .icon { width: 18px; height: 18px; }

/* agent card, directory variant: 4:3 whole-head crop, fixed type for narrow grid columns */
.agent-card--directory .agent-card__photo { aspect-ratio: 4 / 3; background: var(--panel); } /* panel shows until a lazy photo arrives */
.photo--fallback {
  display: grid; place-items: center;
  background: var(--panel); color: var(--muted);
  font-size: 28px; font-weight: 600; letter-spacing: .02em;
}
.agent-card--directory .agent-card__body { padding: 14px 16px 16px; }
.agent-card--directory .agent-card__name { font-size: 17px; overflow-wrap: anywhere; }
.agent-card--directory .agent-card__headline { font-size: 15px; }
.agent-card__meta { margin-top: 6px; font-size: var(--fs-micro); line-height: 1.4; color: var(--muted); }
.agent-card__meta span { white-space: nowrap; }
.agent-card__status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 8px; }
.agent-card--directory .agent-card__verified { margin-top: 0; font-size: 14px; }

/* availability pill */
.pill { display: inline-block; padding: 2px 10px; border-radius: var(--r-pill); font-size: var(--fs-micro); font-weight: 500; line-height: 1.4; }
.pill--open { background: var(--success-soft); color: var(--success); }
.pill--limited { background: var(--accent-soft); color: var(--ink); }
.pill--closed { background: var(--panel); color: var(--muted); }

/* agent grid (directory): 2 compact columns on phones, 2 / 3 / 4 from 640 / 1024 / 1280 */
.agent-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
/* opportunity card grid: 1 / 2 / 3 columns from 0 / 640 / 1024 */
.card-grid { display: grid; gap: var(--s-3); margin-top: var(--s-4); }
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); } }
@media (min-width: 1024px) { .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.agent-skeleton { display: grid; gap: 10px; padding-bottom: 16px; border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.agent-skeleton span { height: 12px; margin-inline: 16px; border-radius: var(--r-pill); background: var(--panel); }
.agent-skeleton span:first-child { height: auto; aspect-ratio: 4 / 3; margin: 0 0 6px; border-radius: 0; }
.agent-skeleton span:last-child { width: 50%; }
@media (max-width: 639.98px) {
  .agent-card--directory .agent-card__body { padding: 12px; }
  .agent-card--directory .agent-card__name { font-size: 16px; }
  .agent-card--directory .agent-card__headline { font-size: 14px; }
  .agent-card--directory .agent-card__meta { font-size: 12px; }
  .agent-card--directory .agent-card__verified { font-size: 13px; }
  .agent-card--directory .agent-card__verified .icon { width: 16px; height: 16px; }
  .agent-card--directory .pill { font-size: 12px; padding-inline: 8px; }
  .agent-card--directory .save { top: 8px; right: 8px; }
}
@media (min-width: 640px) { .agent-grid { gap: var(--s-5); } }
@media (min-width: 1024px) { .agent-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .agent-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }


/* opportunity card */
.opp-card {
  position: relative; height: 100%;
  container-type: inline-size;
  display: flex; flex-direction: column; gap: var(--s-3);
  padding: 20px;
  background: var(--page);
  border: 1px solid var(--line); border-radius: var(--r-card);
  transition: box-shadow var(--t-base) var(--ease), border-color var(--t-base) var(--ease);
}
.opp-card:hover { box-shadow: var(--shadow-hover); border-color: var(--line-strong); }
.opp-card__top { display: flex; align-items: center; gap: var(--s-3); }
.logo { display: grid; place-items: center; flex: none; border-radius: 22%; background: var(--logo); color: #FFFFFF; font-weight: 700; line-height: 1; }
.opp-card__logo { width: 40px; height: 40px; font-size: 18px; }
.opp-card__company {
  flex: 1; min-width: 0;
  font-size: 15px; font-weight: 600; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.opp-card .save { position: relative; z-index: 1; }
.opp-card__title {
  font-size: var(--fs-h3); font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.opp-card__title a { text-decoration: none; }
.opp-card__title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.opp-card__title a:focus-visible { outline: none; }
.opp-card:has(.opp-card__title a:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.opp-card__meta { margin-top: calc(-1 * var(--s-2)); font-size: var(--fs-micro); line-height: 1.4; color: var(--muted); }
.opp-card .terms { margin-top: auto; }

/* terms strip */
.terms {
  display: grid; grid-auto-flow: column; grid-auto-columns: auto; /* content-sized columns keep values on one line in narrow cards */
  margin: 0; padding: 10px 12px;
  background: var(--panel); border-radius: var(--r-control);
}
.terms > div { display: flex; flex-direction: column; min-width: 0; padding: 0 8px; }
.terms > div:first-child { padding-left: 0; }
.terms > div:last-child { padding-right: 0; }
.terms > div + div { border-left: 1px solid var(--line); }
.terms dd {
  margin: 0;
  font-size: var(--fs-figure); font-weight: 700; line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
.terms > div:first-child dd { color: var(--accent-ink); }
.terms dt { order: 1; font-size: var(--fs-micro); line-height: 1.35; color: var(--muted); }
@container (max-width: 290px) { .terms dd { font-size: var(--fs-body); } } /* narrow cards: three values still fit on one line */
@container (max-width: 250px) { .terms { padding-inline: 10px; } .terms dd { font-size: var(--fs-small); } .terms > div { padding: 0 6px; } } /* 320px screens */

/* toast */
.toast-region {
  position: fixed; left: 50%; bottom: 16px; z-index: 50;
  width: min(420px, calc(100% - 32px));
  transform: translateX(-50%);
}
.toast {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: 12px 16px;
  background: var(--ink); color: #fff;
  border-radius: var(--r-control);
  box-shadow: var(--shadow-hover);
  font-size: var(--fs-small); line-height: 1.4;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}
@starting-style { .toast { opacity: 0; transform: translateY(8px); } }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition-duration: 160ms; }
.toast__action {
  flex: none; padding: 4px 0;
  background: none; border: 0; color: #fff;
  font-weight: 600; text-decoration: underline; cursor: pointer;
}
.toast__action:focus-visible { outline-color: #fff; }

/* sector link */
.sector-link {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  min-height: 52px; padding: 0 16px 0 20px;
  background: var(--panel);
  border: 1px solid transparent; border-radius: var(--r-pill);
  font-size: var(--fs-body); font-weight: 500; line-height: 1.25;
  text-decoration: none;
  transition: border-color var(--t-base) var(--ease);
}
.sector-link:hover { border-color: var(--muted); }
.sector-link__count { color: var(--muted); font-variant-numeric: tabular-nums; }

/* text input and select */
.input {
  width: 100%; height: 48px; padding: 0 14px;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--r-control);
  font-size: var(--fs-body);
  transition: border-color var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}
.input::placeholder { color: var(--muted); opacity: 1; }
.input:hover { border-color: var(--muted); }
.input:focus-visible { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(244,181,37,.45); }
.select { position: relative; display: inline-flex; }
.select select { appearance: none; padding-right: 42px; cursor: pointer; }
.select .icon { position: absolute; right: 12px; top: 50%; translate: 0 -50%; pointer-events: none; }

/* chips */
.chip-list { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip--filter {
  position: relative; /* keeps its visually hidden radio inside, so focusing it never scrolls the sheet */
  gap: 6px; min-height: 32px; padding: 0 14px;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line-strong);
  font-size: var(--fs-small); font-weight: 500; line-height: 1.2;
  cursor: pointer;
  transition: background-color var(--t-base) var(--ease), border-color var(--t-base) var(--ease);
}
.chip--filter:hover { background: var(--panel); }
.chip--filter:has(:checked) { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip--filter:has(:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
button.chip--filter { padding-right: 10px; }
.chip--filter .icon { width: 16px; height: 16px; }
@media (forced-colors: active) { .chip--filter:has(:checked) { forced-color-adjust: none; background: Highlight; color: HighlightText; border-color: Highlight; } }

/* filter panel */
.filter-panel fieldset { min-width: 0; margin: 0; padding: 20px 0; border: 0; }
.filter-panel fieldset + fieldset { border-top: 1px solid var(--line); }
.filter-panel fieldset:first-child { padding-top: 0; }
.filter-panel legend { float: left; width: 100%; padding: 0; font-size: 15px; font-weight: 600; line-height: 1.3; }
.filter-panel legend + * { clear: both; }
.filter-hint { padding-top: 4px; font-size: var(--fs-micro); line-height: 1.4; color: var(--muted); }
.filter-options, .filter-panel .chip-list { margin-top: 10px; }
.filter-option {
  display: flex; align-items: center; gap: 10px;
  min-height: 34px;
  font-size: 15px; line-height: 1.3;
  cursor: pointer;
}
@media (pointer: coarse) { .filter-option { min-height: 44px; } }
.filter-option input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--ink); cursor: pointer; }
.filter-option__count { color: var(--muted); font-variant-numeric: tabular-nums; }
.filter-option.is-empty { color: var(--muted); } /* zero matches: the whole option dims to --muted, which keeps 4.5:1 */
.filter-more { height: 36px; margin: 4px 0 0 28px; padding: 0; }

/* filter sheet (below 1024px) */
.sheet {
  width: 100%; max-width: none; height: 100%; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: var(--page); color: var(--ink);
}
.sheet[open] { display: flex; flex-direction: column; transition: opacity var(--t-slow) var(--ease), translate var(--t-slow) var(--ease); }
.sheet::backdrop { background: rgba(17,17,17,.4); }
body:has(.sheet[open]) { overflow: hidden; }
.sheet__header {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: 12px 16px 12px 20px;
  border-bottom: 1px solid var(--line);
}
.sheet__header h2 { font-size: 20px; line-height: 1.2; }
.sheet__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 20px; }
.sheet__footer {
  display: flex; gap: var(--s-3);
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.sheet__footer .btn--primary { flex: 1; }
@starting-style { .sheet[open] { opacity: 0; translate: 0 16px; } }
@media (min-width: 640px) {
  .sheet { width: 420px; margin-left: auto; border-left: 1px solid var(--line); }
  @starting-style { .sheet[open] { translate: 24px 0; } }
}
@media (prefers-reduced-motion: reduce) {
  @starting-style { .sheet[open] { translate: none; } }
  .sheet[open] { transition-duration: 120ms; }
}

/* opportunity row (list page): separate cards below 1024px, one bordered list from 1024px */
.opp-list { display: grid; gap: var(--s-3); }
.opp-list > li {
  background: var(--page);
  border: 1px solid var(--line); border-radius: var(--r-card);
}
.opp-row {
  position: relative;
  display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; align-items: center;
  gap: 10px var(--s-3);
  padding: 20px;
  transition: background-color var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease), border-color var(--t-base) var(--ease);
}
.opp-row:hover { box-shadow: var(--shadow-hover); border-color: var(--line-strong); }
.opp-row__logo { width: 40px; height: 40px; font-size: 18px; }
.opp-row__main { display: contents; overflow-wrap: anywhere; }
.opp-row__company {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s-2);
  min-width: 0;
  font-size: 15px; font-weight: 600; line-height: 1.3;
}
.opp-row__title, .opp-row__meta, .opp-row .terms { grid-column: 1 / -1; }
.opp-row__title { font-size: var(--fs-h3); font-weight: 600; line-height: 1.35; }
.opp-row__title a { text-decoration: none; }
.opp-row__title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.opp-row__title a:focus-visible { outline: none; }
.opp-row:has(.opp-row__title a:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.opp-row__meta { margin-top: -6px; font-size: var(--fs-micro); line-height: 1.4; color: var(--muted); }
.opp-row .save { position: relative; z-index: 1; grid-column: 3; grid-row: 1; }
.opp-row .terms { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row; row-gap: 10px; margin-top: 2px; }
.opp-row .terms > div { padding: 0 12px; }
.opp-row .terms > div:nth-child(odd) { padding-left: 0; border-left: 0; }
.opp-row .terms dd { font-size: var(--fs-body); }
.opp-row .terms dd:has(> .visually-hidden) { color: var(--muted); font-weight: 400; }

@media (min-width: 640px) {
  .opp-row { grid-template-columns: 48px minmax(0, 1fr) 40px; column-gap: var(--s-4); row-gap: 0; align-items: start; }
  .opp-row__logo { width: 48px; height: 48px; font-size: 21px; }
  .opp-row__main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
  .opp-row__title, .opp-row__meta { grid-column: auto; }
  .opp-row__meta { margin-top: 0; }
  .opp-row .terms { grid-column: 2 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: var(--s-3); }
  .opp-row .terms > div:nth-child(odd) { padding-left: 12px; border-left: 1px solid var(--line); }
  .opp-row .terms > div:first-child { padding-left: 0; border-left: 0; }
}

@media (min-width: 1024px) {
  .opp-list { gap: 0; border: 1px solid var(--line); border-radius: var(--r-card); }
  .opp-list > li { border: 0; border-radius: 0; }
  .opp-list > li + li { border-top: 1px solid var(--line); }
  .opp-list > li:first-child { border-radius: var(--r-card) var(--r-card) 0 0; }
  .opp-list > li:last-child { border-radius: 0 0 var(--r-card) var(--r-card); }
  .opp-list > li:only-child { border-radius: var(--r-card); }
  .opp-row { padding: 16px 20px; }
  .opp-row:hover { box-shadow: none; background: var(--hover); border-color: var(--line); }
  .opp-row:has(.opp-row__title a:focus-visible) { outline-offset: -2px; }
}

/* one line per row from 1440px: below that, beside the 280px filters, the title column would be too narrow for a 70-character title */
@media (min-width: 1440px) {
  .opp-row { grid-template-columns: 48px minmax(0, 1fr) auto 40px; align-items: center; }
  .opp-row .terms { grid-column: 3; grid-row: 1; grid-template-columns: 110px 96px 120px 110px; margin: 0; padding: 0; background: none; }
  .opp-row .terms > div, .opp-row .terms > div:first-child, .opp-row .terms > div:nth-child(odd) { padding: 2px 0 2px 16px; border-left: 1px solid var(--line); }
  .opp-row .save { grid-column: 4; }
}

/* loading skeleton */
.opp-skeleton { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px var(--s-4); padding: 20px; }
.opp-skeleton span { height: 12px; border-radius: var(--r-pill); background: var(--panel); }
.opp-skeleton span:first-child { grid-row: span 2; width: 48px; height: 48px; }
.opp-skeleton span:nth-child(2) { width: 70%; height: 16px; align-self: end; }
.opp-skeleton span:nth-child(3) { width: 40%; }

/* empty state */
.empty-state { display: grid; justify-items: center; gap: var(--s-3); padding: var(--s-7) var(--s-4); text-align: center; }
.empty-state h2 { font-size: 20px; font-weight: 600; line-height: 1.3; }
.empty-state p { max-width: 44ch; color: var(--muted); }
.empty-state .btn { margin-top: var(--s-2); }

/* directory list pages */
.directory { padding-top: var(--s-5); }
.directory__intro { max-width: 720px; }
.directory__intro h1, .not-found h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); letter-spacing: -0.01em; }

/* 404, and short pages that keep the footer at the bottom of tall viewports */
.not-found { padding-block: var(--s-8); text-align: center; }
.not-found .lede { max-width: 44ch; margin-inline: auto; }
.not-found__actions { display: grid; gap: var(--s-3); margin-top: var(--s-5); }
@media (min-width: 640px) {
  .not-found { padding-block: var(--s-9); }
  .not-found__actions { display: flex; flex-wrap: wrap; justify-content: center; }
}
body:has(.shortlist, .not-found) { display: flex; flex-direction: column; min-height: 100svh; }
main:has(.shortlist, .not-found) { flex: 1; }

.search { position: relative; max-width: 520px; margin-top: var(--s-5); }
.search .icon { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.search .input { padding-left: 44px; }
.search .input::-webkit-search-cancel-button {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; margin-right: -4px;
  background: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center / 18px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center / 18px no-repeat;
  cursor: pointer;
}
.search .input::-webkit-search-cancel-button:hover { background: var(--ink); }

.directory__layout { margin-top: var(--s-6); }
.directory__filters { display: none; }

.results-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.results-toolbar__filters { flex: none; }
.sort { flex: 1 1 180px; display: flex; align-items: center; justify-content: flex-end; gap: var(--s-2); }
.sort label { font-size: 15px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.sort .select { flex: 1; max-width: 240px; }
.results-count {
  flex-basis: 100%; min-height: 1lh;
  scroll-margin-top: 16px;
  margin-top: var(--s-2);
  font-size: 18px; font-weight: 600; line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.results-count:focus { outline: none; }
.results-count:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* phones: the select alone, labelled for screen readers, so Filters and Sort share one row */
@media (max-width: 639.98px) {
  .sort label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); margin-top: var(--s-4); }
.active-filters .btn { padding-inline: 8px; }

.opp-list, .agent-grid, .directory__results > .empty-state { margin-top: var(--s-4); }

.results-more { display: grid; justify-items: center; gap: var(--s-3); margin-top: var(--s-6); }
.results-more p { color: var(--muted); font-size: var(--fs-small); }

@media (min-width: 640px) { .directory { padding-top: 40px; } }

@media (min-width: 1024px) {
  .directory__layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 40px; align-items: start; }
  .directory__filters {
    display: block;
    position: sticky; top: 16px;
    max-height: calc(100vh - 32px); overflow-y: auto; overscroll-behavior: contain;
    margin: -4px; padding: 4px 12px 4px 4px; /* room for focus rings inside the scroll box */
    scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
  }
  .results-toolbar__filters { display: none; }
  .results-count { order: -1; flex: 1 1 auto; margin-top: 0; }
  .sort { flex: none; }
  .sort .select { width: 220px; }
}

/* breadcrumb */
.breadcrumb ol { display: flex; margin: 0; padding: 0; list-style: none; align-items: center; min-width: 0; font-size: var(--fs-small); line-height: 1.4; color: var(--muted); }
.breadcrumb li { flex: none; white-space: nowrap; }
.breadcrumb li + li::before { content: "/"; padding-inline: var(--s-2); color: var(--line-strong); }
.breadcrumb li:last-child { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb a { display: inline-block; padding-block: 12px; margin-block: -12px; color: var(--ink-2); } /* 44px target, same layout */
.breadcrumb a:hover { color: var(--ink); }

/* tags (read-only) */
.tags { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.tag { padding: 4px 12px; background: var(--panel); border-radius: var(--r-pill); font-size: var(--fs-micro); line-height: 1.4; }

/* form fields */
.field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field__label { padding: 0; font-size: var(--fs-small); font-weight: 600; line-height: 1.4; }
.field__hint, .field__count { font-size: var(--fs-micro); line-height: 1.4; color: var(--muted); }
.field__count { font-variant-numeric: tabular-nums; }
.field__count.is-over { color: var(--danger); font-weight: 600; }
.field .select { display: flex; }
textarea.input { height: auto; min-height: 140px; padding-block: 12px; line-height: var(--lh-body); resize: vertical; }
.field__error { display: flex; gap: 6px; font-size: var(--fs-small); font-weight: 500; line-height: 1.4; color: var(--danger); }
.field__error .icon { width: 18px; height: 18px; margin-top: 1px; }
.field.has-error .input { border-color: var(--danger); }
.field.has-error .chip--filter { border-color: var(--danger); }
.pill-group { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: 4px; }
.pill-group .chip--filter { min-height: 44px; padding-inline: 18px; font-size: 15px; }
.pill-group input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; } /* the native radio covers its pill, so it is the click and tap target */

/* error summary */
.error-summary { padding: var(--s-4) var(--s-5); background: var(--danger-soft); border-radius: var(--r-card); scroll-margin-top: var(--s-5); }
.error-summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.error-summary h2 { font-size: var(--fs-h3); font-weight: 700; }
.error-summary ul { margin-top: var(--s-2); padding: 0; list-style: none; display: grid; gap: 6px; }
.error-summary a { color: var(--danger); font-weight: 500; }
.error-summary a:hover { text-decoration-thickness: 2px; }

/* form success */
.form-success { display: grid; gap: var(--s-3); justify-items: start; padding: var(--s-5); background: var(--success-soft); border-radius: var(--r-card); }
.form-success:focus { outline: none; }
.form-success:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.form-success h2 { font-size: var(--fs-h2); letter-spacing: -0.01em; }
.form-success p { max-width: 60ch; color: var(--ink-2); }
.form-success__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-2); }

/* sticky action bar (below 1024px) */
.apply-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; gap: var(--s-3);
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  background: var(--page); border-top: 1px solid var(--line);
  transition: translate var(--t-slow) var(--ease), visibility 0s;
}
.apply-bar .btn--primary { flex: 1; }
.apply-bar .icon-btn { width: 48px; height: 48px; }
.apply-bar.is-hidden { translate: 0 100%; visibility: hidden; transition: translate var(--t-slow) var(--ease), visibility 0s var(--t-slow); }
body:has(.apply-bar) { padding-bottom: calc(73px + env(safe-area-inset-bottom)); }
html:has(.apply-bar) { scroll-padding-bottom: calc(73px + env(safe-area-inset-bottom)); } /* keeps focused controls clear of the bar (WCAG 2.4.11) */
body:has(.apply-bar:not(.is-hidden)) .toast-region { bottom: calc(89px + env(safe-area-inset-bottom)); }
@media (min-width: 1024px) {
  .apply-bar { display: none; }
  body:has(.apply-bar) { padding-bottom: 0; }
  html:has(.apply-bar) { scroll-padding-bottom: 0; }
  body:has(.apply-bar:not(.is-hidden)) .toast-region { bottom: 16px; }
}
