.demo {
  overflow: hidden;
  border-radius: 0.75rem;

  &__preview {
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
    border-bottom-width: 0;
    color: $colorBlack;
    background-color: $colorWhite;
    max-height: unquote("max(300px, 60vh)");
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    border: 3px solid $colorBlack;
  }

  &__source {
    background-color: $colorBlack;
  }

  &__scroller {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  &__tabs {
    display: flex;
    flex: 1 1 auto;
    padding: 0 1.25rem 0 1.25rem;
    border-bottom: 2px solid rgba($colorWhite, 0.1);
  }

  &__tab {
    position: relative;
    display: inline-flex;
    position: relative;
    background-color: transparent;
    color: rgba($colorWhite, 0.7);
    padding: 0.3rem 0 calc(0.3rem + 2px) 0;
    font: inherit;
    font-family: "JetBrainsMono", monospace;
    font-size: 0.85rem;
    border: none;
    margin-right: 1rem;
    margin-bottom: -2px;
    border-bottom: 2px solid transparent;

    &.is-active,
    &:hover {
      color: $colorWhite;
    }

    &.is-active {
      font-weight: 700;
      border-bottom-color: $colorWhite
    }
  }

  &__code {
    pre {
      margin: 0;
      border-radius: 0;
    }
  }

  &__meta {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
    border-top: 1px solid rgba($colorWhite, 0.1);
    border-bottom-left-radius: inherit;
    border-bottom-right-radius: inherit;
    background-color: $colorBlack;
    white-space: nowrap;
    color: rgba($colorWhite, 0.5);
  }

  &__name {
    display: none;

    @media (min-width: 600px) {
      display: block;
      overflow: hidden;
      text-overflow: ellipsis;
      padding-right: 0.5rem;
    }
  }

  &__link {
    margin-left: auto;

    &:hover {
      color: $colorWhite;
    }
  }

  &__error {
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    border: 3px solid $colorBlack;
    background-color: $colorRed;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
  }
}
