/* Protein type picker of the header search (search-type.js). Square controls,
 * 1 px borders, one accent; the popover is the only element with a menu shadow. */
.search-shell.has-ptype {
  grid-template-columns: 150px 136px minmax(140px, 1fr) auto;
}

.search-shell .st-button {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0 8px;
  color: var(--ink-soft);
  text-align: left;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  font-weight: 400;
}

.search-shell .st-button[hidden] {
  display: none;
}

.search-shell .st-button:hover:not(:disabled) {
  color: var(--ink);
  background: var(--surface-soft);
}

.search-shell .st-button.is-set {
  color: var(--ink);
}

.st-button-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.st-caret {
  flex: 0 0 auto;
  width: 0;
  height: 0;
  border-top: 5px solid currentColor;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

.st-popover {
  position: absolute;
  z-index: 45;
  max-width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-menu);
}

.st-popover[hidden] {
  display: none;
}

.st-popover .st-filter {
  display: block;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  font-size: 13.5px;
}

.st-popover .st-filter:focus {
  box-shadow: inset 0 0 0 2px var(--focus-ring);
}

.st-list {
  max-height: min(420px, 60vh);
  margin: 0;
  padding: 0 0 4px;
  overflow-y: auto;
  list-style: none;
}

.st-head {
  padding: 8px 10px 3px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.st-empty {
  padding: 10px;
  color: var(--ink-soft);
  font-size: 13px;
}

.st-opt {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 10px;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  line-height: 1.35;
}

.st-opt:hover,
.st-opt.is-active {
  background: var(--teal-soft);
}

.st-opt.is-active {
  outline: 1px solid var(--teal);
  outline-offset: -1px;
}

.st-opt[aria-selected="true"] .st-name {
  font-weight: 600;
  color: var(--teal-dark);
}

.st-opt.st-child {
  padding-left: 34px;
}

.st-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.st-grp {
  flex: 0 1 auto;
  max-width: 40%;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.st-n {
  flex: 0 0 auto;
  min-width: 3.2em;
  color: var(--ink-soft);
  text-align: right;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.st-twisty {
  position: relative;
  flex: 0 0 auto;
  align-self: center;
  width: 14px;
  height: 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.st-twisty::before,
.st-twisty[data-open="0"]::after {
  position: absolute;
  top: 50%;
  left: 50%;
  content: "";
  background: var(--ink-soft);
  transform: translate(-50%, -50%);
}

.st-twisty::before {
  width: 8px;
  height: 1px;
}

.st-twisty[data-open="0"]::after {
  width: 1px;
  height: 8px;
}

.st-twisty.st-twisty-none {
  visibility: hidden;
}

.st-opt:not(.st-group):not(.st-child) .st-twisty {
  display: none;
}

.st-token {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 5px 0 0;
  font-size: 12.5px;
}

.st-token[hidden] {
  display: none;
}

.st-token-box {
  display: inline-flex;
  align-items: stretch;
  max-width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--surface);
}

.st-token-text {
  min-width: 0;
  padding: 1px 6px;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.st-token-text b {
  font-weight: 600;
}

.st-token-box button {
  height: auto;
  min-height: 0;
  padding: 0 6px;
  color: var(--ink-soft);
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface-soft);
  font-size: 13px;
  line-height: 1;
}

.st-token-box button:hover:not(:disabled) {
  color: var(--red);
  background: var(--surface-soft);
}

@media (max-width: 1150px) {
  .search-shell.has-ptype {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    grid-template-rows: 34px 36px;
  }

  .search-shell.has-ptype select {
    grid-column: 1;
    grid-row: 1;
    border-right: 1px solid var(--line);
  }

  .search-shell.has-ptype .st-button {
    grid-column: 2 / -1;
    grid-row: 1;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .search-shell.has-ptype input {
    grid-column: 1 / 3;
    grid-row: 2;
  }

  .search-shell.has-ptype button#searchButton {
    grid-column: 3;
    grid-row: 2;
  }
}

@media (max-width: 600px) {
  .st-list {
    max-height: 62vh;
  }

  .st-opt {
    padding: 7px 10px;
  }

  .st-opt.st-child {
    padding-left: 34px;
  }

  .st-grp {
    display: none;
  }
}
