@keyframes cursorBlink {
  0%, 45% { border-right-color: #fff; }
  55%, 90% { border-right-color: transparent; }
  100% { border-right-color: #fff; }
}

#alfredscreenshot {
  color: #fff;
  padding: 10px;
  margin-bottom: 60px;
  max-width: 692px;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  outline: 1px solid rgba(0, 0, 0, 0.3);
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.2);
}

/**********/
/* Search */
/**********/

#alfredscreenshot #alfredscreenshotsearch {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
  padding: 0 2px;
}

/* Search field */
#alfredscreenshot #alfredscreenshotsearch > div {
  background: rgba(0, 0, 0, 0.2);
  width: 100%;
  padding: 12px 0;
  border-radius: 16px;
}

/* Search input */
#alfredscreenshot #alfredscreenshotsearch > div > p {
  font-size: 30px;
  line-height: 1em;
  padding: 2px 0px 2px 10px;
  margin: 0;
  border-right: solid 1.5px #fff;
  animation: cursorBlink 1s linear infinite;
  display: inline-block;
}

/* Alfred hat */
#alfredscreenshot #alfredscreenshotsearch > img {
  height: 38px;
}

/***********/
/* Results */
/***********/

#alfredscreenshot #alfredscreenshotresults > div {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px;
  align-items: center;
  padding: 5px 0;
  margin: 2px 0 0 0;
}

/* Result image */
#alfredscreenshot #alfredscreenshotresults > div > img {
  padding: 0 8px;
  width: 48px;
  height: 48px;
}
#alfredscreenshot #alfredscreenshotresults > div > :nth-child(1) {
  grid-column: 1;
  grid-row: 1 / span 2;
}

/* Result title */
#alfredscreenshot #alfredscreenshotresults > div > :nth-child(2) {
  grid-column: 2;
  grid-row: 1;
  font-size: 20px;
  line-height: 1em;
  padding: 0;
  margin: 0;
  align-self: end;
}

/* Result subtitle */
#alfredscreenshot #alfredscreenshotresults > div > :nth-child(3) {
  grid-column: 2;
  grid-row: 2;
  font-size: 12px;
  line-height: 1em;
  color: rgba(255, 255, 255, 0.5);
  padding: 0;
  margin: 0;
  align-self: start;
}

/* Result shortcut */
#alfredscreenshot #alfredscreenshotresults > div > :nth-child(4) {
  grid-column: 3;
  grid-row: 1 / span 2;
  color: rgba(255, 255, 255, 0.6);
  padding: 0 14px;
  margin: 0;
  font-size: 17px;
}

/* Selected result */
#alfredscreenshot #alfredscreenshotresults > div:first-child {
  background: #2d8795; border-radius: 16px;
}
#alfredscreenshot #alfredscreenshotresults > div:first-child > :nth-child(4) {
  padding-right: 20px;
}

/* Single result without subtext */
#alfredscreenshot #alfredscreenshotresults > div:nth-child(4) > :nth-child(2) {
  grid-row: 1 / span 2;
  margin-bottom: 3px;
  align-self: center;
}

#alfredscreenshot #alfredscreenshotresults > div:nth-child(4) > :nth-child(3) {
  display: none;
  align-self: center;
}

/**************/
/* Responsive */
/**************/

@media (max-width: 560px) {
  #alfredscreenshot {
    font-size: 0.8em;
    padding: 6px;
  }

  /* Search field */
  #alfredscreenshot #alfredscreenshotsearch {
    padding: 0;
  }
  #alfredscreenshot #alfredscreenshotsearch > :nth-child(1) {
    padding: 2px 0px 2px 10px;
  }
  #alfredscreenshot #alfredscreenshotsearch > :nth-child(2) {
    height: 28px;
  }

  /* Alfred results */
  #alfredscreenshot #alfredscreenshotresults > div {
    padding: 6px 0;
  }
  #alfredscreenshot #alfredscreenshotresults > div > img {
    padding: 0 10px;
    width: 30px;
    height: 30px;
  }
  #alfredscreenshot #alfredscreenshotresults > div > :nth-child(2) {
    margin: 0 0 4px 0;
  }
}