.site-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 1 auto;
  min-width: 0;
  gap: 14px;
  position: relative;
}

.site-header-actions>.account-menu,
.site-header-actions>.twitch-login {
  flex-shrink: 0;
}

.header-user-search {
  flex: 0 1 20ch;
  width: clamp(10ch, 20vw, 20ch);
  min-width: 0;
  max-width: 20ch;
  font: inherit;
}

.header-user-search {
  position: relative;
  margin: 0;
}

.user-search-field {
  position: relative;
  min-width: 0;
}

.user-search-field input[type="search"] {
  padding-left: 36px;
}

.header-user-search input {
  display: block;
  width: 100%;
  min-width: 0;
  height: var(--header-compact-control-size);
  padding: 2px 12px 2px 32px;
  appearance: none;
  /* Soften the long straight edge beside the small circular controls. */
  border-color: color-mix(in srgb, var(--header-control-border) 65%, transparent);
  outline: none;
  font: inherit;
  font-size: 16px;
}

.header-user-search input:focus-visible {
  background: var(--site-control);
  outline: 2px solid var(--site-focus);
  outline-offset: 3px;
}

.header-user-search:focus-within .header-search-icon {
  color: var(--site-text);
}

.header-search-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 10px;
  width: 16px;
  height: 16px;
  color: var(--site-text-muted);
  pointer-events: none;
}

.header-search-panel {
  position: absolute;
  z-index: 110;
  top: calc(100% + 8px);
  left: 0;
  width: max(100%, 240px);
  max-width: calc(100vw - 32px);
  max-height: min(400px, 60dvh);
  overflow-y: auto;
  border: 1px solid var(--site-border-control);
  border-radius: 8px;
  background: var(--site-panel);
  box-shadow: 0 10px 24px rgb(var(--site-black-rgb) / 40.000%);
}

.header-search-panel[hidden] {
  display: none;
}

.header-search-option {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--site-text);
  overflow-wrap: anywhere;
}

.header-search-option+.header-search-option {
  border-top: 1px solid var(--site-border-subtle);
}

.header-search-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.header-search-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--site-border-subtle);
  font-weight: 700;
}

.header-search-avatar img {
  position: absolute;
  inset: 0;
}

.header-search-status {
  color: var(--site-text-muted);
  font-size: 13px;
}

.header-search-option:hover,
.header-search-option[aria-selected="true"] {
  background: var(--site-border-subtle);
}

.header-search-status {
  margin: 0;
  padding: 12px;
}

.header-search-status:empty {
  display: none;
}

@media (max-width: 600px) {
  .site-header {
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .site-header-actions {
    flex: 1 1 240px;
    gap: 12px;
  }

  .header-user-search {
    flex-grow: 1;
  }
}
