.ticket {
  border: 1px solid var(--custom-border-color);
  border-radius: 0.25rem;

  & form {
    border-top: 1px solid var(--divider-color);
    padding: 1rem;

    & fieldset {
      margin: 0;
    }

    /* An inline <a> takes no vertical margin, and the form's own
       .btn-secondary rule sizes it to match the Save button below. */
    & .copy-purchaser-details {
      display: inline-block;
      margin-bottom: 1rem;
    }
  }

  & .ticket-details {
    border-top: 1px solid var(--divider-color);
    padding: 1rem;

    & dl {
      display: grid;
      grid-template-columns: auto 1fr;
      gap: 0.25rem 1rem;
      margin: 0 0 1rem;
    }

    & dt {
      color: var(--custom-text-color-muted);
      font-size: 0.825rem;
    }

    & dd {
      margin: 0;
    }

    & p {
      margin: 1rem 0 0;
      color: var(--custom-text-color-muted);
      font-size: 0.825rem;
    }
  }

  & .ticket-link,
  & .ticket-anonymous {
    display: inline-flex;
    gap: 1rem;
    width: 100%;
    padding: 1rem !important;
    border-radius: 0 !important;

    & div.icon {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;

      & span {
        font-size: 0.725rem;
      }
    }

    & div.details {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: start;

      & em {
        color: #828282;
        font-size: 0.825rem;
        font-style: normal;
      }
    }
  }

  & .ticket-link:hover {
    background: var(--custom-text-background-color-hover);
  }

  & .state {
    border-radius: 0.25rem;
    padding: 0 0.5rem;
    font-size: 0.825rem;

    &.complete {
      border: 1px solid #b1ddbf;
      background: #dffae8;
      color: #2f7f3f;
    }

    &.incomplete {
      border: 1px solid #e1e1e1;
      background: #efefef;
      color: #7e7e7e;
    }
  }
}

.ticket + .ticket {
  margin-top: 1rem;
}
