body {
  margin: 0;
  box-sizing: border-box;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
}

h1, h2 {
  text-align: center;
}

a {
  color: blue;
  text-decoration: none;
  outline-offset: 0.5rem;
  outline-color: currentColor;
}

a:where(:hover, :focus) {
  text-decoration: underline;
}

button {
  cursor: pointer;
  font-size: inherit;
}

input {
  font-size: inherit;
}

h1 {
  margin-block-start: 0;
}

.user-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: min(80%, 35rem);
  align-items: center;
  padding: 1rem;
  border: 1px solid black;
  border-radius: 5px;
  container-type: inline-size;

  & .route-section {
    display: flex;
    width: 100%;
    align-items: center;

    > span:first-child {
      margin-inline-end: 0.5rem;
    }

    > span:nth-child(2) {
      color: rgb(65, 65, 65);
      font-style: italic;
    }

    & button {
      margin-left: auto;
      display: flex;
      align-items: center;
      gap: 0.5rem;

      & > svg {
        height: 1rem;
      }
    }
  }

  @container (width < 20rem){
    .route-section button {
        > span {
          display: none;
        }

        > svg {
          height: .9rem;
        }
    }
  }

  .headers-section {
    margin-block-end: 1rem;
    display: grid;
    grid-template-columns: 1fr max-content;
    align-items: center;
    row-gap: 1rem;
    column-gap: 0.7rem;

    .short-version {
      display: none;
    }
  }

  @container (width < 35rem){
    .headers-section {
      margin-block-start: 1rem;
    }
  }

  @container (width < 15rem){
    .headers-section {
      .long-version {
        display: none;
      }

      .short-version {
        display: inline;
      }
    }
  }

  @container (width < 10rem){
    .headers-section {
      grid-template-columns: 1fr;
      row-gap: .25rem;

      & input {
        margin-block-end: 1rem;
      }
    }
  }

  .fetch-btns {
    display: flex;
    gap: 1rem;
    margin-block-end: 0.4rem;
  }

  @container (width < 27rem){
    .fetch-btns {
      flex-direction: column;
    }
  }
}

.output {
  margin-block-start: 2rem;

  & h2 {
    margin-block: 1rem 0.5rem;
  }

  & h2 + span {
    display: block;
    width: 100%;
    text-align: center;
  }

  & h3 {
    margin-block: 1rem 0.25rem;
  }

  .response-card {
    background-color: #e9e9e9;
    padding: 1rem;
    border: 1px solid currentColor;
    border-radius: 15px;
    color: #3f3f3f;
    font-style: italic;
  }
}


@media (width < 30rem) {
  body {
    font-size: 85%;
  }
}