/* it-69 Custom Objects — the contact-reference picker + small record touches. */

/* Eligible-types picker in the field builder: the house .contact-type-chip + .contact-type-badge
   (badge carries each type's background + icon color; active chip = secondary-container). Only the
   wrap layout is local. */
.bp-ref-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.contact-ref__card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.4rem 0.35rem 0.6rem;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 8px;
  background: var(--md-sys-color-surface-container-low);
  max-width: 100%;
}
.contact-ref__avatar { color: var(--md-sys-color-on-surface-variant); }
.contact-ref__card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.contact-ref__card-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contact-ref__card-sub {
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contact-ref__act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
}
.contact-ref__act:hover { background: var(--md-sys-color-surface-container-high); }
.contact-ref__act .material-symbols-rounded { font-size: 18px; }

.contact-ref__search-wrap { position: relative; }
/* Overlay the field rather than reflowing the form: absolute, anchored to the
   wrap, capped height with its own scroll so a long list never grows the card. */
.contact-ref__results {
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: 8px;
  overflow-y: auto;
}
.contact-ref__results:not(:empty) {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  max-height: 18rem;
  background: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  box-shadow: var(--md-sys-elevation-2, 0 2px 8px rgba(0, 0, 0, 0.15));
}
.contact-ref__option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.contact-ref__option:hover { background: var(--md-sys-color-surface-container); }
.contact-ref__option-name { font-weight: 500; }
.contact-ref__option-sub { font-size: 0.8rem; }
.contact-ref__empty { padding: 0.5rem 0.7rem; }
