/* The header's patient search, from the receptionist deck's .sdlg / .sfield / .sres. */
#akashic-health-records-patient-portal-root [data-slot="dialog-content"].ahr-psearch {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 512px;
  min-width: 0;
  max-width: calc(100vw - 40px);
  padding: 0;
  overflow: hidden;
}

#akashic-health-records-patient-portal-root .ahr-psearch .ahr-psearch__title {
  margin: 0;
  padding: 16px 16px 10px;
  text-align: left;
}

#akashic-health-records-patient-portal-root .ahr-psearch__body {
  min-height: 0;
  padding: 0 16px 16px;
}

/* The field is the shared composite (.ak-field.ak-field-shell); the glyph and the bare input sit in a row. */
#akashic-health-records-patient-portal-root .ahr-psearch__field {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
}

#akashic-health-records-patient-portal-root .ahr-psearch__field > input {
  flex: 1;
  min-width: 0;
}

#akashic-health-records-patient-portal-root .ahr-psearch__field > svg {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--faint);
  pointer-events: none;
}

#akashic-health-records-patient-portal-root .ahr-psearch .ahr-psearch__hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 20px 2px;
  font-size: 13.5px;
  color: var(--ink-muted);
}

#akashic-health-records-patient-portal-root .ahr-psearch__hint > svg {
  flex: none;
  width: 15px;
  height: 15px;
}

#akashic-health-records-patient-portal-root .ahr-psearch .ahr-psearch__hint--failed {
  justify-content: space-between;
  color: var(--danger);
}

#akashic-health-records-patient-portal-root .ahr-psearch__hint--failed .btn {
  flex: none;
}

#akashic-health-records-patient-portal-root .ahr-psearch__results {
  max-height: 288px;
  margin: 6px 0 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

#akashic-health-records-patient-portal-root .ahr-psearch__row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 9px 8px;
  border-top: 1px solid var(--line-soft);
  font-size: 13.5px;
  color: var(--ink-strong);
  cursor: pointer;
}

#akashic-health-records-patient-portal-root .ahr-psearch__row:first-child {
  border-top: 0;
}

#akashic-health-records-patient-portal-root .ahr-psearch__row[aria-selected="true"] {
  border-radius: 6px;
  background: var(--sunken);
}

#akashic-health-records-patient-portal-root .ahr-psearch__row .ahr-inbox-avatar {
  flex: none;
  width: 26px;
  height: 26px;
  font-size: 10px;
}

#akashic-health-records-patient-portal-root .ahr-psearch .ahr-psearch__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#akashic-health-records-patient-portal-root .ahr-psearch .ahr-psearch__sub {
  flex: none;
  margin-left: auto;
  font-size: 12.5px;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* A phone opens it as a sheet from the bottom edge. */
@media (max-width: 640px) {
  #akashic-health-records-patient-portal-root [data-slot="dialog-content"].ahr-psearch {
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    max-height: 82vh;
    border-radius: 14px 14px 0 0;
    transform: none;
    translate: none;
  }
}
